You are here

function panels_get_cached_content in Panels 7.3

Same name and namespace in other branches
  1. 5.2 includes/plugins.inc \panels_get_cached_content()
  2. 6.3 includes/plugins.inc \panels_get_cached_content()
  3. 6.2 includes/plugins.inc \panels_get_cached_content()

Get cached content for a given display and possibly pane.

Return value

The cached content, or FALSE to indicate no cached content exists.

2 calls to panels_get_cached_content()
panels_renderer_standard::render in plugins/display_renderers/panels_renderer_standard.class.php
Build inner content, then hand off to layout-specified theme function for final render step.
panels_renderer_standard::render_pane_content in plugins/display_renderers/panels_renderer_standard.class.php
Render the interior contents of a single pane.

File

includes/plugins.inc, line 42
Contains helper code for plugins and contexts.

Code

function panels_get_cached_content($display, $args, $context, $pane = NULL) {

  // Never use cache on a POST.
  if (!empty($_POST)) {
    return FALSE;
  }
  $method = $pane ? $pane->cache['method'] : $display->cache['method'];
  $function = panels_plugin_get_function('cache', $method, 'cache get');
  if (!$function) {
    return FALSE;
  }
  $conf = $pane ? $pane->cache['settings'] : $display->cache['settings'];
  $cache = $function($conf, $display, $args, $context, $pane);
  if (empty($cache)) {
    return FALSE;
  }

  // Restore it.
  $cache
    ->restore();
  return $cache;
}