You are here

function menu_overview_form in Drupal 6

Same name and namespace in other branches
  1. 7 modules/menu/menu.admin.inc \menu_overview_form()

Form for editing an entire menu tree at once.

Shows for one menu the menu items accessible to the current user and relevant operations.

1 string reference to 'menu_overview_form'
menu_menu in modules/menu/menu.module
Implementation of hook_menu().

File

modules/menu/menu.admin.inc, line 29
Administrative page callbacks for menu module.

Code

function menu_overview_form(&$form_state, $menu) {
  global $menu_admin;
  $sql = "\n    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*\n    FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path\n    WHERE ml.menu_name = '%s'\n    ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC";
  $result = db_query($sql, $menu['menu_name']);
  $tree = menu_tree_data($result);
  $node_links = array();
  menu_tree_collect_node_links($tree, $node_links);

  // We indicate that a menu administrator is running the menu access check.
  $menu_admin = TRUE;
  menu_tree_check_access($tree, $node_links);
  $menu_admin = FALSE;
  $form = _menu_overview_tree_form($tree);
  $form['#menu'] = $menu;
  if (element_children($form)) {
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Save configuration'),
    );
  }
  else {
    $form['empty_menu'] = array(
      '#value' => t('There are no menu items yet.'),
    );
  }
  return $form;
}