You are here

function context_condition_domain::execute in Context Domain 7

Execute.

Overrides context_condition_path::execute

File

plugins/context_condition_domain.inc, line 11

Class

context_condition_domain
Expose paths as a context condition.

Code

function execute() {
  if ($this
    ->condition_used()) {

    // Include both the path alias and normal path for matching.
    $current_domain = $_SERVER['HTTP_HOST'];
    foreach ($this
      ->get_contexts() as $context) {
      $domains = $this
        ->fetch_from_context($context, 'values');
      if ($this
        ->match($current_domain, $domains)) {
        $this
          ->condition_met($context);
      }
    }
  }
}