function theme_nice_menus in Nice Menus 6.2
Same name and namespace in other branches
- 7.3 nice_menus.module \theme_nice_menus()
- 7.2 nice_menus.module \theme_nice_menus()
Theme function to allow any menu tree to be themed as a Nice menu.
Parameters
int $id: The Nice menu ID.
string $menu_name: The top parent menu name from which to build the full menu.
int $mlid: The menu ID from which to build the displayed menu.
string $direction: Optional. The direction the menu expands. Default is 'right'.
int $depth: The number of children levels to display. Use -1 to display all children and use 0 to display no children.
array $menu: Optional. A custom menu array to use for theming -- it should have the same structure as that returned by menu_tree_all_data(). Default is the standard menu tree.
Return value
string An HTML string of Nice menu links.
3 theme calls to theme_nice_menus()
- nice_menus_block in ./
nice_menus.module - Implements hook_block().
- theme_nice_menus_primary_links in ./
nice_menus.module - Theme primary links as Nice menus.
- theme_nice_menus_secondary_links in ./
nice_menus.module - Theme secondary links as nice menus.
File
- ./
nice_menus.module, line 458 - Module to enable CSS dropdown and flyout menus.
Code
function theme_nice_menus($id, $menu_name, $mlid, $direction = 'right', $depth = -1, $menu = NULL) {
$output = array();
if ($menu_tree = theme('nice_menus_tree', $menu_name, $mlid, $depth, $menu)) {
if ($menu_tree['content']) {
$output['content'] = '<ul class="nice-menu nice-menu-' . $direction . ' nice-menu-' . $menu_name . '" id="nice-menu-' . $id . '">' . $menu_tree['content'] . '</ul>' . "\n";
$output['subject'] = $menu_tree['subject'];
}
}
return $output;
}