function context_condition_context_all::execute

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

Execute.

Overrides context_condition_path::execute

File

sites/all/modules/ulmus/context/plugins/context_condition_context_all.inc, line 7

Class

context_condition_context_all
Expose active contexts as a context condition.

Code

function execute() {
  if ($this->condition_used()) {
    $active_contexts = array_keys(context_active_contexts());
    foreach ($this->get_contexts() as $context) {

      // Only test contexts that haven't been activated yet,
      // and have values set.
      if (!in_array($context->name, $active_contexts, TRUE) && $values = $this->fetch_from_context($context, 'values')) {

        // The condition is met if all contexts are active.
        if (count(array_intersect($values, $active_contexts)) == count($values)) {
          $this->condition_met($context);
        }
      }
    }

    // If the list of active contexts has changed, we need to recurse.
    if ($active_contexts != array_keys(context_active_contexts())) {
      $this->execute();
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.