1 layout.module | layout_get_title_description(Layout $layout) |
Gets the title description for the current layout.
Parameters
Layout $layout: Full layout object.
Return value
$description: Description of title source.
File
- core/
modules/ layout/ layout.module, line 2338 - The Layout module creates pages and wraps existing pages in layouts.
Code
function layout_get_title_description(Layout $layout) {
$source = $layout->settings['title_display'];
switch ($source) {
case LAYOUT_TITLE_DEFAULT:
$description = t('Default page title');
break;
case LAYOUT_TITLE_CUSTOM:
$description = t('Custom page title: %title', array('%title' => $layout->settings['title']));
break;
case LAYOUT_TITLE_BLOCK:
$all_blocks = layout_get_block_info();
if (!empty($layout->settings['title_block'])) {
$uuid = $layout->settings['title_block'];
$title_block = $layout->content[$uuid];
$description = t('Title copied from the %block block', array('%block' => $all_blocks[$title_block->module][$title_block->delta]['info']));
}
break;
case LAYOUT_TITLE_NONE:
$description = t('No title');
break;
}
return $description;
}