menu_get_root_menus

  1. drupal
    1. 4.7
    2. 5
Versions
4.7 – 5 menu_get_root_menus()

Retrieves the menu ID and title of all root menus.

Return value

Array containing all menus (but not menu items), in the form mid => title.

Related topics

▾ 3 functions call menu_get_root_menus()

menu_block in modules/menu.module
Implementation of hook_block().
menu_configure in modules/menu.module
Menu callback; presents menu configuration options.
menu_overview_tree in modules/menu.module
Present the menu tree, rendered along with links to edit menu items.

Code

includes/menu.inc, line 296

<?php
function menu_get_root_menus() {
  $menu = menu_get_menu();
  $root_menus = array();

  foreach ($menu['items'][0]['children'] as $mid) {
    $root_menus[$mid] = $menu['items'][$mid]['title'];
  }

  return $root_menus;
}
?>