function panels_show_pane in Panels 5.2
Same name and namespace in other branches
- 6.2 includes/display-edit.inc \panels_show_pane()
2 calls to panels_show_pane()
- panels_content_config_add_form_submit in includes/
display_edit.inc - theme_panels_edit_display in includes/
display_edit.inc - Theme the form for editing display content.
File
- includes/
display_edit.inc, line 627
Code
function panels_show_pane($display, $pane, $left_buttons, $buttons, $skin = TRUE) {
$content_type = panels_get_content_type($pane->type);
$block = new stdClass();
if (empty($content_type)) {
$block->title = '<em>' . t('Missing content type') . '</em>';
$block->content = t('This pane\'s content type is either missing or has been deleted. This pane will not render.');
}
elseif (function_exists($content_type['editor render callback'])) {
$block = $content_type['editor render callback']($display, $pane);
}
else {
$block = _panels_render_preview_pane_disabled($pane, $display->context);
}
// This is just used for the title bar of the pane, not the content itself.
// If we know the content type, use the appropriate title for that type,
// otherwise, set the title using the content itself.
$title = !empty($content_type) ? panels_get_pane_title($pane, $display->context) : $block->title;
$output = theme('panels_pane_dnd', $block, $pane->pid, $title, $left_buttons, $buttons);
if ($skin) {
$class = 'panel-pane' . ($pane->shown ? '' : ' hidden-pane');
$output = '<div class="' . $class . '" id="panel-pane-' . $pane->pid . '">' . $output . '</div>';
}
return $output;
}