function context_load

cis7 context.module context_load($name = NULL, $reset = FALSE)
cle7 context.module context_load($name = NULL, $reset = FALSE)
elmsmedia7 context.module context_load($name = NULL, $reset = FALSE)
icor7 context.module context_load($name = NULL, $reset = FALSE)
meedjum_blog7 context.module context_load($name = NULL, $reset = FALSE)
mooc7 context.module context_load($name = NULL, $reset = FALSE)

Context loader.

Parameters

$name: The name for this context object.

Return value

Returns a fully-loaded context definition.

7 calls to context_load()
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_context_list in sites/all/modules/ulmus/context/context.module
CTools list callback for bulk export.
context_enabled_contexts in sites/all/modules/ulmus/context/context.module
Wrapper around context_load() that only returns enabled contexts.
context_features_export in sites/all/modules/ulmus/features/includes/features.context.inc
Implements hook_features_export().

... See full list

File

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

Code

function context_load($name = NULL, $reset = FALSE) {
  static ctools_include('export');
  static $contexts;
  static $altered;
  if (!isset($contexts) || $reset) {
    $contexts = $altered = array();
    if (!$reset && $contexts = context_cache_get('context')) {
      // Nothing here.
    }
    else {
      if ($reset) {
        ctools_export_load_object_reset('context');
      }
      $contexts = ctools_export_load_object('context', 'all');
      context_cache_set('context', $contexts);
    }
  }
  if (isset($name)) {
    // Allow other modules to alter the value just before it's returned.
    if (isset($contexts[$name]) && !isset($altered[$name])) {
      $altered[$name] = TRUE;
      drupal_alter('context_load', $contexts[$name]);
    }
    return isset($contexts[$name]) ? $contexts[$name] : FALSE;
  }
  return $contexts;
}