You are here

function panels_renderer_standard::render_layout in Panels 7.3

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

Perform display/layout-level render operations.

This method triggers all the inner pane/region rendering processes, passes that to the layout plugin's theme callback, and returns the rendered HTML.

If display-level caching is enabled and that cache is warm, this method will not be called.

Return value

string The HTML string representing the entire rendered, themed panel.

2 calls to panels_renderer_standard::render_layout()
panels_renderer_editor::render in plugins/display_renderers/panels_renderer_editor.class.php
Build inner content, then hand off to layout-specified theme function for final render step.
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.

File

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

Class

panels_renderer_standard

Code

function render_layout() {
  if (empty($this->prep_run)) {
    $this
      ->prepare();
  }
  $this
    ->render_panes();
  $this
    ->render_regions();
  if ($this->admin && !empty($this->plugins['layout']['admin theme'])) {
    $theme = $this->plugins['layout']['admin theme'];
  }
  else {
    $theme = $this->plugins['layout']['theme'];
  }

  // Determine whether to render layout.
  $show = TRUE;
  if (!$this->show_empty_layout && !$this->admin) {
    $show = FALSE;

    // Render layout if any region is not empty.
    foreach ($this->rendered['regions'] as $region) {
      if (is_string($region) && $region !== '') {
        $show = TRUE;
        break;
      }
    }
  }
  if (!$show) {
    return;
  }
  $this->rendered['layout'] = theme($theme, array(
    'css_id' => check_plain($this->display->css_id),
    'content' => $this->rendered['regions'],
    'settings' => $this->display->layout_settings,
    'display' => $this->display,
    'layout' => $this->plugins['layout'],
    'renderer' => $this,
  ));
  return $this->prefix . $this->rendered['layout'] . $this->suffix;
}