function panel_context_panels_cache_get in Panels 6.3
Same name and namespace in other branches
- 8.3 panels.module \panel_context_panels_cache_get()
- 7.3 panels.module \panel_context_panels_cache_get()
Get display edit cache on behalf of panel context.
The key is the second half of the key in this form: panel_context:TASK_NAME:HANDLER_NAME;
Related topics
File
- ./
panels.module, line 1405 - panels.module
Code
function panel_context_panels_cache_get($key) {
ctools_include('common', 'panels');
ctools_include('context');
ctools_include('context-task-handler');
// this loads the panel context inc even if we don't use the plugin.
$plugin = page_manager_get_task_handler('panel_context');
list($task_name, $handler_name) = explode(':', $key, 2);
$page = page_manager_get_page_cache($task_name);
if (isset($page->display_cache[$handler_name])) {
return $page->display_cache[$handler_name];
}
if ($handler_name) {
$handler =& $page->handlers[$handler_name];
}
else {
$handler =& $page->new_handler;
}
$cache = new stdClass();
$cache->display =& panels_panel_context_get_display($handler);
$cache->display->context = ctools_context_handler_get_all_contexts($page->task, $page->subtask, $handler);
$cache->display->cache_key = 'panel_context:' . $key;
$cache->content_types = panels_common_get_allowed_types('panels_page', $cache->display->context);
$cache->display_title = TRUE;
$cache->locked = $page->locked;
return $cache;
}