function dhtml_menu_preprocess_block in DHTML Menu 6
Same name and namespace in other branches
- 6.2 dhtml_menu.module \dhtml_menu_preprocess_block()
Implementation of hook_preprocess(). Change the normal behaviour ('theming') of hook_block().
File
- ./
dhtml_menu.module, line 63 - dhtml_menu.modle Allow click expansion of the menu tree via javascript, with graceful degradation.
Code
function dhtml_menu_preprocess_block(&$variables) {
$delta = $variables['block']->delta;
if ($delta == 1 and $variables['block']->module == 'user') {
$delta = 'navigation';
}
// Get the dhtml_menus_menus variable
$dhtml_menus = variable_get('dhtml_menus_menus', array());
// If the menu has the DHTML menu option enabled,
// replace the entire block content to its DHTML equivalent
if (!empty($dhtml_menus[$delta])) {
include_once drupal_get_path('module', 'dhtml_menu') . '/dhtml_menu.inc';
$variables['block']->content = _dhtml_menu_build_menu($delta);
}
}