class panels_display

  1. 7.x panels/panels.module panels_display
  2. 6.x-3.x panels/panels.module panels_display
  3. 6.x-2.x panels/panels.module panels_display

Forms the basis of a panel display


Expanded class hierarchy of panels_display


Contains filters are case sensitive
Namesort descending Modifiers Type Description
panels_display::add_pane function
panels_display::clone_pane function
panels_display::duplicate_pane function
panels_display::get_title function Get the title from a display.
panels_display::render function Render this panels display.


panels/panels.module, line 648

View source
class panels_display {
  var $args = array();
  var $content = array();
  var $panels = array();
  var $incoming_content = NULL;
  var $css_id = NULL;
  var $context = array();
  var $did = 'new';
  var $renderer = 'standard';

  function add_pane(&$pane, $location = NULL) {
    // If no location specified, use what's set in the pane.
    if (empty($location)) {
      $location = $pane->panel;
    else {
      $pane->panel = $location;

    // Generate a permanent uuid for this pane, and use
    // it as a temporary pid.
    $pane->uuid = ctools_uuid_generate();
    $pane->pid = 'new-' . $pane->uuid;

    // Add the pane to the approprate spots.
    $this->content[$pane->pid] = &$pane;
    $this->panels[$location][] = $pane->pid;

  function duplicate_pane($pid, $location = FALSE) {
    $pane = $this->clone_pane($pid);
    $this->add_pane($pane, $location);

  function clone_pane($pid) {
    $pane = clone $this->content[$pid];
    $pane->uuid = ctools_uuid_generate();
    return $pane;

   * Get the title from a display.
   * The display must have already been rendered, or the setting to set the
   * display's title from a pane's title will not have worked.
   * @return
   *   The title to use. If NULL, this means to let any default title that may be in use
   *   pass through. i.e, do not actually set the title.
  function get_title() {
    switch ($this->hide_title) {
        return '';

        return isset($this->stored_pane_title) ? $this->stored_pane_title : '';

      case FALSE: // For old exported panels that are not in the database.
        if (!empty($this->title)) {
          return filter_xss_admin(ctools_context_keyword_substitute($this->title, array(), $this->context));
        return NULL;

   * Render this panels display.
   * After checking to ensure the designated layout plugin is valid, a
   * display renderer object is spawned and runs its rendering logic.
   * @param mixed $renderer
   *    An instantiated display renderer object, or the name of a display
   *    renderer plugin+class to be fetched. Defaults to NULL. When NULL, the
   *    predesignated display renderer will be used.
  function render($renderer = NULL) {
    $layout = panels_get_layout($this->layout);
    if (!$layout) {
      return NULL;

    // If we were not given a renderer object, load it.
    if (!is_object($renderer)) {
      // If the renderer was not specified, default to $this->renderer
      // which is either standard or was already set for us.
      $renderer = panels_get_renderer_handler(!empty($renderer) ? $renderer : $this->renderer, $this);
      if (!$renderer) {
        return NULL;

    $output = '';
    // Let modules act just prior to render.
    foreach (module_implements('panels_pre_render') as $module) {
      $function = $module . '_panels_pre_render';
      $output .= $function($this, $renderer);

    $output .= $renderer->render();

    // Let modules act just after render.
    foreach (module_implements('panels_post_render') as $module) {
      $function = $module . '_panels_post_render';
      $output .= $function($this, $renderer);
    return $output;

Related topics

13 string references to 'panels_display'
hook_panels_delete_display in panels/panels.api.php
Fired before a display is deleted.
i18n_panels_panels_delete_display in panels/i18n_panels/i18n_panels.module
Implements hook_panels_display_delete().
panels_delete_display in panels/panels.module
Delete a display.
panels_export_display in panels/panels.module
Exports the provided display into portable code.
panels_load_displays in panels/panels.module
Load and fill the requested $display object(s).

... See full list