You are here

function admin_menu_adjust_items in Administration menu 5

Same name and namespace in other branches
  1. 5.3 admin_menu.inc \admin_menu_adjust_items()
  2. 5.2 admin_menu.inc \admin_menu_adjust_items()
  3. 6 admin_menu.inc \admin_menu_adjust_items()
1 call to admin_menu_adjust_items()
admin_menu_get_menu in ./admin_menu.inc
Retrieves, sclices and returns the menu tree below /admin.

File

./admin_menu.inc, line 90

Code

function admin_menu_adjust_items(&$admin_items) {
  global $_menu;

  // move 'By module' into Site configuration or remove it
  if (user_access('administer site configuration')) {
    admin_menu_move_item($admin_items, 'admin/by-module', 'admin/settings');
  }
  else {
    admin_menu_remove_item($admin_items, 'admin/by-module');
  }

  // remove 'By task' menu item
  admin_menu_remove_item($admin_items, 'admin/by-task');

  // add logout item
  $mid_logout = $_menu['path index']['logout'];
  $admin_items[$mid_logout] = $_menu['items'][$mid_logout];
  $admin_items[$mid_logout]['class'] = 'admin_menu-action';
  $mid_admin = $_menu['path index']['admin'];
  $admin_items[$mid_logout]['pid'] = $mid_admin;
  array_unshift($admin_items[$mid_admin]['children'], $mid_logout);

  // add create content_type items to Content management > Content
  $mid_node_add = $_menu['path index']['node/add'];
  $mid_content = $_menu['path index']['admin/content/node'];
  admin_menu_copy_items($admin_items, $mid_node_add, $mid_content, t('Add !title'));
}