You are here

function cache_actions_rules_cache_get_cache in Cache Actions 7.2

Same name and namespace in other branches
  1. 6.2 plugins/cache/rules.inc \cache_actions_rules_cache_get_cache()
  2. 7 plugins/cache/rules.inc \cache_actions_rules_cache_get_cache()

Get cached content.

1 string reference to 'cache_actions_rules_cache_get_cache'
rules.inc in plugins/cache/rules.inc
Provides a simple time-based caching option for panel panes.

File

plugins/cache/rules.inc, line 31
Provides a simple time-based caching option for panel panes.

Code

function cache_actions_rules_cache_get_cache($conf, $display, $args, $contexts, $pane = NULL) {
  if (!empty($conf['new'])) {
    $cid = cache_actions_rules_cache_get_id($conf, $display, $args, $contexts, $pane);
    $cache = cache_get($cid, 'cache');
    if (!$cache) {
      return FALSE;
    }
    return $cache->data;
  }
  $message = 'The panel pane %pane is using the old cache actions caching mechanism,
      and won\'t be cached until you resave it.';
  $parameters = array(
    '%pane' => $pane->subtype,
  );
  watchdog('cache_actions', $message, $parameters, WATCHDOG_WARNING);

  // Be very verbose for people who can control panels.
  if (user_access('use panels caching features') && user_access('administer panels layouts')) {
    drupal_set_message(t($message, $parameters), 'warning');
  }
}