You are here

function panels_renderer_legacy::render_region in Panels 6.3

Render a single panel region.

Primarily just a passthrough to the panel region rendering callback specified by the style plugin that is attached to the current panel region.

Parameters

$region_name: The ID of the panel region being rendered

$panes: An array of panes that are assigned to the panel that's being rendered.

Return value

The rendered HTML for the passed-in panel region.

1 call to panels_renderer_legacy::render_region()
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 263

Class

panels_renderer_legacy
Legacy render pipeline for a panels display.

Code

function render_region($region_name, $panes) {
  list($style, $style_settings) = panels_get_panel_style_and_settings($this->display->panel_settings, $region_name);
  $callback = 'render panel';

  // Retrieve the pid (can be a panel page id, a mini panel id, etc.), this
  // might be used (or even necessary) for some panel display styles.
  $owner_id = 0;
  if (isset($this->display->owner) && is_object($this->display->owner) && isset($this->display->owner->id)) {
    $owner_id = $this->display->owner->id;
  }

  // Check to see if we're actually running a current style plugin even though
  // we're in the legacy renderer
  if (version_compare($style['version'], 2.0, '>=')) {

    // We are, so pre-render the content as the current version expects
    foreach ($panes as $pane_id => $pane) {
      $content = panels_render_pane($pane, $this->display->content[$pane_id], $this->display);
      if ($content) {
        $panes[$pane_id] = $content;
      }
      else {
        unset($panes[$pane_id]);
      }
    }

    // And set the callback to the new key
    $callback = 'render region';
  }
  return theme($style[$callback], $this->display, $owner_id, $panes, $style_settings, $region_name, $style);
}