You are here

function theme_panels_pane in Panels 6.2

Same name and namespace in other branches
  1. 5.2 panels.module \theme_panels_pane()

Render a panel pane like a block.

A panel pane can have the following fields:

$pane->type -- the content type inside this pane $pane->subtype -- The subtype, if applicable. If a view it will be the view name; if a node it will be the nid, etc. $content->title -- The title of the content $content->content -- The actual content $content->links -- Any links associated with the content $content->more -- An optional 'more' link (destination only) $content->admin_links -- Administrative links associated with the content $content->feeds -- Any feed icons or associated with the content $content->subject -- A legacy setting for block compatibility $content->module -- A legacy setting for block compatibility $content->delta -- A legacy setting for block compatibility

2 theme calls to theme_panels_pane()
panels_render_pane in includes/display-render.inc
Render a pane using the appropriate style.
theme_panels_rounded_corners_style_render_pane in styles/rounded_corners.inc
Render callback for a single pane.

File

includes/display-render.inc, line 330
Contains Panels display rendering functions.

Code

function theme_panels_pane($content, $pane, $display) {
  if (!empty($content->content)) {
    $idstr = $classstr = '';
    if (!empty($content->css_id)) {
      $idstr = ' id="' . $content->css_id . '"';
    }
    if (!empty($content->css_class)) {
      $classstr = ' ' . $content->css_class;
    }
    $output = "<div class=\"panel-pane{$classstr}\"{$idstr}>\n";
    if (user_access('view pane admin links') && !empty($content->admin_links)) {
      $output .= "<div class=\"admin-links panel-hide\">" . theme('links', $content->admin_links) . "</div>\n";
    }
    if (!empty($content->title)) {
      $output .= "<h2 class=\"title\">{$content->title}</h2>\n";
    }
    if (!empty($content->feeds)) {
      $output .= "<div class=\"feed\">" . implode(' ', $content->feeds) . "</div>\n";
    }
    $output .= "<div class=\"content\">{$content->content}</div>\n";
    if (!empty($content->links)) {
      $output .= "<div class=\"links\">" . theme('links', $content->links) . "</div>\n";
    }
    if (!empty($content->more)) {
      if (empty($content->more['title'])) {
        $content->more['title'] = t('more');
      }
      $output .= "<div class=\"more-link\">" . l($content->more['title'], $content->more['href']) . "</div>\n";
    }
    $output .= "</div>\n";
    return $output;
  }
}