You are here

function panels_renderer_standard::render_regions in Panels 6.3

Same name and namespace in other branches
  1. 7.3 plugins/display_renderers/panels_renderer_standard.class.php \panels_renderer_standard::render_regions()

Render all prepared regions, placing already-rendered panes into their appropriate positions therein.

Return value

array An array of rendered panel regions, keyed on the region name.

1 call to panels_renderer_standard::render_regions()
panels_renderer_standard::render_layout in plugins/display_renderers/panels_renderer_standard.class.php
Perform display/layout-level render operations.
1 method overrides panels_renderer_standard::render_regions()
panels_renderer_simple::render_regions in plugins/display_renderers/panels_renderer_simple.class.php
Render all prepared regions, placing already-rendered panes into their appropriate positions therein.

File

plugins/display_renderers/panels_renderer_standard.class.php, line 580

Class

panels_renderer_standard
The standard render pipeline for a Panels display object.

Code

function render_regions() {
  $this->rendered['regions'] = array();

  // Loop through all panel regions, put all panes that belong to the current
  // region in an array, then render the region. Primarily this ensures that
  // the panes are arranged in the proper order.
  $content = array();
  foreach ($this->prepared['regions'] as $region_id => $conf) {
    $region_panes = array();
    foreach ($conf['pids'] as $pid) {

      // Only include panes for region rendering if they had some output.
      if (!empty($this->rendered['panes'][$pid])) {
        $region_panes[$pid] = $this->rendered['panes'][$pid];
      }
    }
    $this->rendered['regions'][$region_id] = $this
      ->render_region($region_id, $region_panes);
  }
  return $this->rendered['regions'];
}