function _menu_block_format_title in Menu Block 5
Same name and namespace in other branches
- 5.2 menu_block.admin.inc \_menu_block_format_title()
- 6.2 menu_block.admin.inc \_menu_block_format_title()
- 7.3 menu_block.admin.inc \_menu_block_format_title()
- 7.2 menu_block.admin.inc \_menu_block_format_title()
Return the title of the block.
Parameters
$delta: int The delta of the menu block
Return value
string The title of the block
2 calls to _menu_block_format_title()
- _menu_block_block_list in ./
menu_block.admin.inc - Returns the 'list' $op info for hook_block().
- _menu_block_settings in ./
menu_block.admin.inc - Display the settings form for Menu block.
File
- ./
menu_block.admin.inc, line 69
Code
function _menu_block_format_title($delta) {
$mid = variable_get("menu_block_{$delta}_mid", NULL);
if (is_null($mid)) {
$title = t('Unconfigured menu block');
}
else {
$level = variable_get("menu_block_{$delta}_level", 1);
$depth = variable_get("menu_block_{$delta}_depth", 0);
$menus = menu_get_root_menus();
// Show the configured levels in the block info
$replacements = array(
'@menu_name' => $menus[$mid],
'@level1' => $level,
'@level2' => $level + $depth - 1,
);
if ($depth == 1) {
$title = t('@menu_name (level @level1)', $replacements);
}
elseif ($depth) {
$title = t('@menu_name (levels @level1-@level2)', $replacements);
}
else {
$title = t('@menu_name (levels @level1+)', $replacements);
}
}
return $title;
}