Return an associative array of the custom menus names.
$all: If FALSE return only user-added menus, or if TRUE also include the menus defined by the system.
An array with the machine-readable names as the keys, and human-readable titles as the values.
function menu_get_menus($all = TRUE) {
if ($custom_menus = entity_load_multiple('menu')) {
if (!$all) {
$custom_menus = array_diff_key($custom_menus, menu_list_system_menus());
}
foreach ($custom_menus as $menu_name => $menu) {
$custom_menus[$menu_name] = $menu
->label();
}
asort($custom_menus);
}
return $custom_menus;
}