function menu_get_menus

menu_get_menus($all = TRUE)

Return an associative array of the custom menus names.

Parameters

$all: If FALSE return only user-added menus, or if TRUE also include the menus defined by the system.

Return value

An array with the machine-readable names as the keys, and human-readable titles as the values.

File

modules/menu/menu.module, line 784
Allows administrators to customize the site's navigation menus.

Code

function menu_get_menus($all = TRUE) {
  if ($custom_menus = menu_load_all()) {
    if (!$all) {
      $custom_menus = array_diff_key($custom_menus, menu_list_system_menus());
    }
    foreach ($custom_menus as $menu_name => $menu) {
      $custom_menus[$menu_name] = t($menu['title']);
    }
    asort($custom_menus);
  }
  return $custom_menus;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!menu!menu.module/function/menu_get_menus/7.x