1 menu.admin.inc menu_overview_page()

Menu callback which shows an overview page of all the custom menus and their descriptions.

File

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

Code

function menu_overview_page() {
  $menus = menu_load_all();
  backdrop_sort($menus, array('title' => SORT_STRING));
  $header = array(t('Title'), t('Operations'));
  $rows = array();
  foreach ($menus as $menu) {
    $row = array();
    $row[] = theme('menu_admin_overview', array('title' => $menu['title'], 'name' => $menu['menu_name'], 'description' => $menu['description']));
    $links = array();
    $links['list'] = array(
      'title' => t('Edit links'),
      'href' => 'admin/structure/menu/manage/' . $menu['menu_name'],
    );
    $links['add'] = array(
      'title' => t('Add link'),
      'href' => 'admin/structure/menu/manage/' . $menu['menu_name'] . '/add',
    );
    $links['configure'] = array(
      'title' => t('Configure'),
      'href' => 'admin/structure/menu/manage/' . $menu['menu_name'] . '/configure',
    );
    $system_menus = menu_list_system_menus();
    if (!isset($system_menus[$menu['menu_name']])) {
      $links['delete'] = array(
        'title' => t('Delete'),
        'href' => 'admin/structure/menu/manage/' . $menu['menu_name'] . '/delete',
      );
    }
    if (user_access('synchronize configuration')) {
      $links['export'] = array(
        'title' => t('Export'),
        'href' => 'admin/config/development/configuration/single/export',
        'query' => array(
          'group' => 'Menus',
          'name' => 'menu.menu.' . $menu['menu_name'],
        ),
      );
    }
    $row[] = array(
      'data' => array(
        '#type' => 'operations',
        '#links' => $links,
      ),
    );
    $rows[] = $row;
  }

  return theme('table', array('header' => $header, 'rows' => $rows));
}