function menu_get_menus
7.x menu.module | menu_get_menus($all = TRUE) |
6.x menu.module | 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.
9 calls to menu_get_menus()
- menu_block_info in drupal-7.x/
modules/ menu/ menu.module - Implements hook_block_info().
- menu_block_view in drupal-7.x/
modules/ menu/ menu.module - Implements hook_block_view().
- menu_configure in drupal-7.x/
modules/ menu/ menu.admin.inc - Menu callback; Build the form presenting menu configuration options.
- menu_delete in drupal-7.x/
modules/ menu/ menu.module - Delete a custom menu and all contained links.
- menu_edit_item in drupal-7.x/
modules/ menu/ menu.admin.inc - Menu callback; Build the menu link editing form.
File
- drupal-7.x/
modules/ menu/ menu.module, line 783 - 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;
}