You are here

function ctools_context_cache_get in Chaos Tool Suite (ctools) 6

Get the cache for the context object.

This can pass through to a module provided cache if it exists, or the default cache will be used.

3 calls to ctools_context_cache_get()
ctools_context_ajax_item_add in includes/context-admin.inc
Ajax entry point to add an context
ctools_context_ajax_item_delete in includes/context-admin.inc
Ajax entry point to edit an item
ctools_context_ajax_item_edit in includes/context-admin.inc
Ajax entry point to edit an item

File

includes/context-admin.inc, line 83
includes/common-context.inc Provide API for adding contexts for modules that embed displays.

Code

function ctools_context_cache_get($fragment, $key) {

  // Separate the fragment into 'module' and 'argument'
  if (strpos($fragment, '-') === FALSE) {
    $module = $fragment;
    $argument = NULL;
  }
  else {
    list($module, $argument) = explode('-', $fragment, 2);
  }
  $function = $module . '_context_cache_get';
  if (function_exists($function)) {
    return $function($argument, $key);
  }
  else {
    return ctools_object_cache_get("context_object:{$module}", $key);
  }
}