You are here

function _cache_actions_get_display_from_key in Cache Actions 7

Same name and namespace in other branches
  1. 6.2 cache_actions.rules.inc \_cache_actions_get_display_from_key()
  2. 7.2 cache_actions.install \_cache_actions_get_display_from_key()

Get a display out of a key specified in the UI.

Parameters

string $key the key:

Return value

panels_display a display.

2 calls to _cache_actions_get_display_from_key()
cache_actions_action_clear_panels_page_cache in ./cache_actions.rules.inc
Clear the cache of the specified panel page.
cache_actions_action_clear_panels_pane_cache in ./cache_actions.rules.inc
Clear the cache of panes in a mini panel.

File

./cache_actions.rules.inc, line 439
This file provides the rules integration for this module.

Code

function _cache_actions_get_display_from_key($key) {
  list($handler, $task, $subtask) = explode(':', $key);
  $task = page_manager_get_task($task);
  $handler = page_manager_load_task_handler($task, $subtask, $handler);

  // In-code handlers have the displays attached to them.
  if (isset($handler->conf['display'])) {
    $display = $handler->conf['display'];
  }
  elseif (isset($handler->conf['did'])) {
    $display = panels_load_display($handler->conf['did']);
  }
  _cache_actions_get_cache_key($handler, $display);
  return $display;
}