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 11
Admin page callbacks for the Menu module.

Code

function menu_overview_page() {
  $menus = menu_load_all();
  backdrop_sort($menus, array('title' => SORT_STRING));
  $header = array(t('Title'), t('Description'), t('Operations'));
  $rows = array();
  foreach ($menus as $menu) {
    $row = array();
    $row[] = theme('label_machine_name__menu', array(
      'label' => $menu['title'],
      'machine_name' => $menu['menu_name'],
    ));
    $row[] = filter_xss_admin($menu['description']);
    $links = array();
    $links['list'] = array(
      'title' => t('Manage 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 (module_exists('config') && 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));
}