You are here

function mmenu_menu_get_menus in Mobile sliding menu 8

Helper function for menu_get_menus().

Parameters

bool|TRUE $all: Indicate whether to include all menus.

Return value

array An array list with existing menus on the site.

1 call to mmenu_menu_get_menus()
template_preprocess_mmenu in ./mmenu.module
Processes variables for mmenu.tpl.php.

File

./mmenu.module, line 1080
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_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;
}