You are here

function theme_nice_menu in Nice Menus 6

Same name and namespace in other branches
  1. 5 nice_menus.module \theme_nice_menu()

General theming function to allow any menu tree to be themed as a nice menu.

Parameters

$id: The nice menu ID.

$menu_name: The top parent menu name from which to build the full menu.

$mlid: The menu ID from which to build the displayed menu.

$direction: Optional. The direction the menu expands. Default is 'right'.

$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

An HTML string of nice menu links.

2 theme calls to theme_nice_menu()
nice_menus_block in ./nice_menus.module
Implementation of hook_block().
theme_nice_menu_primary_links in ./nice_menus.module
Theme primary links as nice menus

File

./nice_menus.module, line 323
Module to enable CSS dropdown and flyout menus.

Code

function theme_nice_menu($id, $menu_name, $mlid, $direction = 'right', $menu = NULL) {
  $output = array();
  if ($menu_tree = theme('nice_menu_tree', $menu_name, $mlid, $menu)) {
    if ($menu_tree['content']) {
      $output['content'] = '<ul class="nice-menu nice-menu-' . $direction . '" id="nice-menu-' . $id . '">' . $menu_tree['content'] . '</ul>' . "\n";
      $output['subject'] = $menu_tree['subject'];
    }
  }
  return $output;
}