You are here

function ctools_context_cache_set 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_set()
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 108
includes/common-context.inc Provide API for adding contexts for modules that embed displays.

Code

function ctools_context_cache_set($fragment, $key, $object) {

  // 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_set';
  if (function_exists($function)) {
    return $function($argument, $key, $object);
  }
  else {
    return ctools_object_cache_set("context_object:{$module}", $key, $object);
  }
}