function menu_parent_options_js

Page callback. Get all the available menus and menu items as a JavaScript array.

1 string reference to 'menu_parent_options_js'
menu_menu in drupal/core/modules/menu/menu.module
Implements hook_menu().

File

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

Code

function menu_parent_options_js() {
  $available_menus = array();
  $menus = Drupal::request()->request
    ->get('menus');
  if (count($menus)) {
    foreach ($menus as $menu) {
      $available_menus[$menu] = $menu;
    }
  }
  $options = _menu_get_options(menu_get_menus(), $available_menus, array(
    'mlid' => 0,
  ));
  return new JsonResponse($options);
}