You are here

function panels_renderer_legacy::render_pane in Panels 6.3

Render the contents of a single pane.

This method retrieves pane content and produces a ready-to-render content object. It also manages pane-specific caching.

Parameters

stdClass $pane: A Panels pane object, as loaded from the database.

1 call to panels_renderer_legacy::render_pane()
panels_renderer_legacy::render_regions in plugins/display_renderers/panels_renderer_legacy.class.php
Render all panes in the attached display into their panel regions, then render those regions.

File

plugins/display_renderers/panels_renderer_legacy.class.php, line 211

Class

panels_renderer_legacy
Legacy render pipeline for a panels display.

Code

function render_pane(&$pane) {
  ctools_include('context');
  if (!is_array($this->display->context)) {
    $this->display->context = array();
  }
  $content = FALSE;
  $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache);
  if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) {
    $content = $cache->content;
  }
  else {
    $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context);
    foreach (module_implements('panels_pane_content_alter') as $module) {
      $function = $module . '_panels_pane_content_alter';
      $function($content, $pane, $this->display->args, $this->display->context);
    }
    if ($caching) {
      $cache = new panels_cache_object();
      $cache
        ->set_content($content);
      panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane);
      $content = $cache->content;
    }
  }

  // Pass long the css_id that is usually available.
  if (!empty($pane->css['css_id']) && is_object($content)) {
    $content->css_id = $pane->css['css_id'];
  }

  // Pass long the css_class that is usually available.
  if (!empty($pane->css['css_class']) && is_object($content)) {
    $content->css_class = $pane->css['css_class'];
  }
  return $content;
}