You are here

function simplified_menu_admin_menu_alter in Simplified Menu Administration 7

Implements hook_menu_alter().

File

./simplified_menu_admin.module, line 11
Simplifies the Menu and Shortcut modules by merging "List links" and "Edit menu" into a single administration page.

Code

function simplified_menu_admin_menu_alter(&$items) {

  // Remove the Menu module's "list links" local task, and make the page for
  // editing the menu become the default local task.
  unset($items['admin/structure/menu/manage/%menu/list']);
  if (isset($items['admin/structure/menu/manage/%menu/edit'])) {
    $items['admin/structure/menu/manage/%menu/edit'] = array(
      'title' => $items['admin/structure/menu/manage/%menu/edit']['title'],
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    );
  }

  // Remove the Shortcut module's "list links" local task, and make the page
  // for editing the shortcut set become the default local task.
  unset($items['admin/config/user-interface/shortcut/%shortcut_set/links']);
  if (isset($items['admin/config/user-interface/shortcut/%shortcut_set/edit'])) {
    $items['admin/config/user-interface/shortcut/%shortcut_set/edit'] = array(
      'title' => 'Edit shortcut set',
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
  }
}