1.20.x menu.module menu_parent_options_js()

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

File

modules/menu/menu.module, line 382
Allows administrators to customize the site's 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));

  // Displayed as JSON by delivery callback backdrop_json_deliver().
  return $options;
}