You are here

function context_condition_query_string::execute in Context 7.3

Execute.

Overrides context_condition_path::execute

File

plugins/context_condition_query_string.inc, line 17
context_condition_query_string.inc

Class

context_condition_query_string
Expose query strings as a context condition.

Code

function execute() {
  if ($this
    ->condition_used()) {
    $current_query_string = empty($_SERVER["QUERY_STRING"]) ? '' : $_SERVER["QUERY_STRING"];
    foreach ($this
      ->get_contexts() as $context) {
      $query_strings = $this
        ->fetch_from_context($context, 'values');
      if ($this
        ->match($current_query_string, $query_strings, TRUE)) {
        $this
          ->condition_met($context);
      }
    }
  }
}