You are here

function _context_registry in Context 6.3

Same name and namespace in other branches
  1. 7.3 context.module \_context_registry()

Retrieves & caches the context registry.

2 calls to _context_registry()
context_conditions in ./context.module
Get all context conditions.
context_reactions in ./context.module
Get all context reactions.

File

./context.module, line 509

Code

function _context_registry($key = NULL, $reset = FALSE) {
  static $registry;
  if (!isset($registry) || $reset) {
    if (!$reset && ($cache = context_cache_get('registry'))) {
      $registry = $cache;
    }
    else {
      $registry = module_invoke_all('context_registry');
      drupal_alter('context_registry', $registry);
      context_cache_set('registry', $registry);
    }
  }
  if (isset($key)) {
    return isset($registry[$key]) ? $registry[$key] : array();
  }
  return $registry;
}