You are here

function menu_parent_options_js in Drupal 7

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 modules/menu/menu.module
Implements hook_menu().

File

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

Code

function menu_parent_options_js() {
  $available_menus = array();
  if (isset($_POST['menus']) && count($_POST['menus'])) {
    foreach ($_POST['menus'] as $menu) {
      $available_menus[$menu] = $menu;
    }
  }
  $options = _menu_get_options(menu_get_menus(), $available_menus, array(
    'mlid' => 0,
  ));
  drupal_json_output($options);
}