function context_condition_map

cis7 context.module context_condition_map($reset = FALSE)
cle7 context.module context_condition_map($reset = FALSE)
elmsmedia7 context.module context_condition_map($reset = FALSE)
icor7 context.module context_condition_map($reset = FALSE)
meedjum_blog7 context.module context_condition_map($reset = FALSE)
mooc7 context.module context_condition_map($reset = FALSE)

Loads an associative array of conditions => context identifiers to allow contexts to be set by different conditions.

4 calls to context_condition_map()
context_condition::condition_used in sites/all/modules/ulmus/context/plugins/context_condition.inc
Check whether this condition is used by any contexts. Can be used to prevent expensive condition checks from being triggered when no contexts use this condition.
context_condition::get_contexts in sites/all/modules/ulmus/context/plugins/context_condition.inc
Retrieve all contexts with the condition value provided.
context_condition_context::get_contexts in sites/all/modules/ulmus/context/plugins/context_condition_context.inc
Retrieve all context conditions.
context_var_init in sites/all/modules/elmsln_contrib/context_var/context_var.module
Implements hook_init().

File

sites/all/modules/ulmus/context/context.module, line 411

Code

function context_condition_map($reset = FALSE) {
  static $condition_map;
  if (!isset($condition_map) || $reset) {
    if (!$reset && $cache = context_cache_get('condition_map')) {
      $condition_map = $cache;
    }
    else {
      $condition_map = array();
      foreach (array_keys(context_conditions()) as $condition) {
        if ($plugin = context_get_plugin('condition', $condition)) {
          foreach (context_enabled_contexts() as $context) {
            $values = $plugin->fetch_from_context($context, 'values');
            foreach ($values as $value) {
              if (!isset($condition_map[$condition][$value])) {
                $condition_map[$condition][$value] = array();
              }
              $condition_map[$condition][$value][] = $context->name;
            }
          }
        }
      }
      context_cache_set('condition_map', $condition_map);
    }
  }
  return $condition_map;
}
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.