function context_condition_path::execute

cis7 context_condition_path.inc context_condition_path::execute()
cle7 context_condition_path.inc context_condition_path::execute()
elmsmedia7 context_condition_path.inc context_condition_path::execute()
icor7 context_condition_path.inc context_condition_path::execute()
meedjum_blog7 context_condition_path.inc context_condition_path::execute()
mooc7 context_condition_path.inc context_condition_path::execute()

Execute.

3 methods override context_condition_path::execute()
context_condition_context::execute in sites/all/modules/ulmus/context/plugins/context_condition_context.inc
Execute.
context_condition_context_all::execute in sites/all/modules/ulmus/context/plugins/context_condition_context_all.inc
Execute.
context_condition_query_string::execute in sites/all/modules/ulmus/context/plugins/context_condition_query_string.inc
Execute.

File

sites/all/modules/ulmus/context/plugins/context_condition_path.inc, line 46

Class

context_condition_path
Expose paths as a context condition.

Code

function execute() {
  if ($this->condition_used()) {
    // Include both the path alias and normal path for matching.
    $current_path = array(drupal_get_path_alias($_GET['q']));
    if ($current_path[0] != $_GET['q']) {
      $current_path[] = $_GET['q'];
    }
    foreach ($this->get_contexts() as $context) {
      $paths = $this->fetch_from_context($context, 'values');
      if ($this->match($current_path, $paths, TRUE)) {
        $this->condition_met($context);
      }
    }
  }
}