You are here

function domaincontext_context_condition_domain::execute in Domain Context 7

Same name and namespace in other branches
  1. 6 plugins/domaincontext_context_condition_domain.inc \domaincontext_context_condition_domain::execute()

Executes condition callback.

File

plugins/domaincontext_context_condition_domain.inc, line 29
Context plugin to supply the domain as a context condition.

Class

domaincontext_context_condition_domain
Expose domains as a context condition.

Code

function execute() {
  $domain = domain_get_domain();
  $domain_id = $domain['domain_id'];
  if ($domain_id == 0) {
    $domain_id = -1;
  }
  $this->values[$domain_id] = array();
  $contexts = $this
    ->get_contexts($domain_id);
  foreach ($contexts as $context) {
    $this->values[$domain_id][] = $context->name;
    $this
      ->condition_met($context, $domain_id);
  }
}