function jump_menu_block_view_alter in Better Jump Menus 7
Make use of block settings on display.
File
- ./
jump_menu.module, line 178 - Make use of the CTools jump menu and grabs from an existing menu. See: modules/ctools/includes/jump-menu.inc NOTE: Menu items must be checked as "expanded" for traversing to work.
Code
function jump_menu_block_view_alter(&$data, $block) {
// Only bother if the title is set.
if ($block->module == 'jump_menu' && $block->title) {
$options = array();
// Pass in the block settings.
if ($block->title != '<none>') {
$options['choose'] = $block->title != '<none>' ? $block->title : t(JUMP_MENU_DEFAULT_CHOOSE);
}
// Replace content with user set title as choice text.
// Would be nice to avoid rendering the menu twice in the stack.
$data_built = _jump_menu_render_block($block->delta, $options);
if (isset($data) && $data_built) {
$data['content'] = $data_built['content'];
}
}
}