You are here

function _cache_actions_load_panes in Cache Actions 7.2

Same name and namespace in other branches
  1. 6.2 cache_actions.rules.inc \_cache_actions_load_panes()
  2. 7 cache_actions.rules.inc \_cache_actions_load_panes()

Load the panes configured to be handled by rules.

Parameters

stdClass $handler: Panel handler.

Return value

array Available panels.

1 call to _cache_actions_load_panes()
_cache_actions_get_panels_handlers in ./cache_actions.rules.inc
Get all existing handlers from page manager.

File

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

Code

function _cache_actions_load_panes($handler) {
  ctools_include('plugins', 'panels');
  ctools_include('content');
  $available_panes = array();
  if (isset($handler->conf['did'])) {
    $display = panels_load_display($handler->conf['did']);
  }
  else {
    $display = $handler->conf['display'];
  }
  if (isset($display->content)) {
    foreach ($display->content as $pane) {
      if (isset($pane->cache['method']) && $pane->cache['method'] == 'rules' && !empty($pane->cache['settings']['new']) && empty($pane->cache['settings']['substitute'])) {
        $pane_title = ctools_content_admin_title($pane->type, $pane->subtype, $pane->configuration, $display->context);
        $available_panes[$pane->cache['settings']['cache_key']] = $pane_title;
      }
    }
  }
  return $available_panes;
}