You are here

function panels_renderer_standard::render_pane 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_pane()

Render a pane using its designated style.

This method also manages 'title pane' functionality, where the title from an individual pane can be bubbled up to take over the title for the entire display.

Parameters

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

2 calls to panels_renderer_standard::render_pane()
panels_renderer_editor::render_pane in plugins/display_renderers/panels_renderer_editor.class.php
Render a pane using its designated style.
panels_renderer_standard::render_panes in plugins/display_renderers/panels_renderer_standard.class.php
Render all prepared panes, first by dispatching to their plugin's render callback, then handing that output off to the pane's style plugin.
1 method overrides panels_renderer_standard::render_pane()
panels_renderer_editor::render_pane in plugins/display_renderers/panels_renderer_editor.class.php
Render a pane using its designated style.

File

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

Class

panels_renderer_standard

Code

function render_pane(&$pane) {
  module_invoke_all('panels_pane_prerender', $pane);
  $content = $this
    ->render_pane_content($pane);
  if ($this->display->hide_title == PANELS_TITLE_PANE && !empty($this->display->title_pane) && $this->display->title_pane == $pane->pid) {

    // If the user selected to override the title with nothing, and selected
    // this as the title pane, assume the user actually wanted the original
    // title to bubble up to the top but not actually be used on the pane.
    if (empty($content->title) && !empty($content->original_title)) {
      $this->display->stored_pane_title = $content->original_title;
    }
    else {
      $this->display->stored_pane_title = !empty($content->title) ? $content->title : '';
    }
  }
  if (!empty($content->content)) {
    if (!empty($pane->style['style'])) {
      $style = panels_get_style($pane->style['style']);
      if (isset($style) && isset($style['render pane'])) {
        $output = theme($style['render pane'], array(
          'content' => $content,
          'pane' => $pane,
          'display' => $this->display,
          'style' => $style,
          'settings' => $pane->style['settings'],
        ));

        // This could be null if no theme function existed.
        if (isset($output)) {
          return $output;
        }
      }
    }

    // Fallback.
    return theme('panels_pane', array(
      'content' => $content,
      'pane' => $pane,
      'display' => $this->display,
    ));
  }
}