You are here

function cache_actions_action_clear_panels_pane_cache in Cache Actions 7

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

Clear the cache of panes in a mini panel.

Parameters

string $handler the handler:

array $panes the panes to clear.:

2 string references to 'cache_actions_action_clear_panels_pane_cache'
cache_actions_rules_action_info in ./cache_actions.rules.inc
Implementation of hook_rules_action_info().
cache_actions_test_rules_defaults in cache_actions_test/cache_actions_test.rules_defaults.inc
Implementation of hook_rules_defaults(). Below are the rules needed for the testing.

File

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

Code

function cache_actions_action_clear_panels_pane_cache($handler, $panes) {
  if (module_exists('page_manager')) {
    ctools_include('plugins', 'panels');
    if (!is_numeric($handler)) {
      $display = _cache_actions_get_display_from_key($handler);
    }
    else {
      $display = panels_load_display($handler);
    }
    if (is_array($panes) && isset($display->content)) {
      foreach ($panes as $pane_id) {
        foreach ($display->content as $pane) {
          if ($pane->pid == $pane_id && !empty($pane->cache['method'])) {
            _cache_actions_clear_pane_cache($pane, $display);
          }
        }
      }
    }
  }
}