You are here

function menu_overview_tree in Drupal 4

Same name and namespace in other branches
  1. 5 modules/menu/menu.module \menu_overview_tree()

Present the menu tree, rendered along with links to edit menu items.

1 call to menu_overview_tree()
menu_overview in modules/menu.module
Menu callback; present the main menu management page.

File

modules/menu.module, line 604
Allows administrators to customize the site navigation menu.

Code

function menu_overview_tree() {
  $menu = menu_get_menu();
  $root_menus = menu_get_root_menus();
  $header = array(
    t('Menu item'),
    t('Expanded'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  $output = '';
  foreach ($root_menus as $mid => $title) {
    $operations = array();
    if ($menu['items'][$mid]['type'] & MENU_MODIFIABLE_BY_ADMIN) {
      $operations[] = l(t('edit'), 'admin/menu/menu/edit/' . $mid);
    }
    if ($menu['items'][$mid]['type'] & MENU_CREATED_BY_ADMIN) {
      $operations[] = l(t('delete'), 'admin/menu/menu/delete/' . $mid);
    }
    $operations[] = l(t('add item'), 'admin/menu/item/add/' . $mid);
    $table = theme('item_list', $operations);
    $table .= theme('table', $header, menu_overview_tree_rows($mid));
    $output .= theme('box', check_plain($title), $table);
  }
  return $output;
}