function _panels_page_get_title in Panels 6.2
Same name and namespace in other branches
- 5.2 panels_page/panels_page.module \_panels_page_get_title()
1 call to _panels_page_get_title()
- panels_page_get_title in panels_page/
panels_page.read.inc - Get the title for a panel page, given a context.
File
- panels_page/
panels_page.read.inc, line 325 - panels_page.write.inc
Code
function _panels_page_get_title($panel_page, $op, $default_title) {
if ($op == 'menu-parent' && $panel_page->menu_parent_title) {
return $panel_page->menu_parent_title;
}
if (in_array($op, array(
'menu',
'menu-parent',
)) && $panel_page->menu_title) {
return $panel_page->menu_title;
}
// Context has the highest priority
if (!empty($panel_page->context)) {
$title = NULL;
foreach ($panel_page->context as $context) {
if (empty($context->data)) {
// Empty contexts can't provide titles
continue;
}
if ($page_title = $context
->get_page_title()) {
$title = $page_title;
}
}
if ($title) {
return $title;
}
}
// If no context returned a title use the display title configured in layout
// settings
if (!empty($panel_page->display->title)) {
return $panel_page->display->title;
}
// Fall back on the panel default title
if (!empty($panel_page->title)) {
return $panel_page->title;
}
if (is_null($default_title)) {
return t('No title');
}
else {
return $default_title;
}
}