Index: admin_menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.inc,v
retrieving revision 1.12
diff -u -p -r1.12 admin_menu.inc
--- admin_menu.inc	7 Jun 2008 16:33:58 -0000	1.12
+++ admin_menu.inc	7 Jun 2008 20:03:08 -0000
@@ -19,7 +19,7 @@ function _admin_menu_rebuild_links() {
       }
     }
   }
-  admin_menu_adjust_items($menu_links, $sort);
+  $deleted = admin_menu_adjust_items($menu_links, $sort);
   if ($menu_links) {
     // Make sure no child comes before its parent.
     array_multisort($sort, SORT_NUMERIC, $menu_links);
@@ -33,7 +33,7 @@ function _admin_menu_rebuild_links() {
   // Allow modules to add more links. If you want to alter links saved by
   // admin_menu, use hook_menu_link_alter() and look for
   // $item['module'] == 'admin_menu'
-  $links = module_invoke_all('admin_menu');
+  $links = module_invoke_all('admin_menu', $deleted);
   foreach ($links as $item) {
     admin_menu_link_save($item);
   }
@@ -77,10 +77,15 @@ function admin_menu_link_save($item) {
 
 /**
  * Implementation of hook_admin_menu().
+ *
+ * @param &$deleted
+ *   Array of links under admin/* that were removed by admin_menu_adjust_items().
+ *   If one of these links is added back, it should be removed from the array.
  */
-function admin_menu_admin_menu() {
+function admin_menu_admin_menu(&$deleted) {
   global $base_url;
 
+  $links = array();
   $icon_path = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
 
   // Add 'administer' item to the icon menu.
@@ -105,7 +110,27 @@ function admin_menu_admin_menu() {
     'parent_path' => $icon_path,
   );
 
-  // Add links to drupal.org.
+  // Move 'By module' item into Site configuration.
+  if (isset($deleted['admin/by-module'])) {
+    $deleted['admin/by-module']['parent_path'] = 'admin/settings';
+    $deleted['admin/by-module']['weight'] = -10;
+    $links[] = $deleted['admin/by-module'];
+    unset($deleted['admin/by-module']);
+  }
+
+  // Move content-type items below 'Content types' (including CCK items).
+  foreach ($deleted as $path => $item) {
+    if (strpos($path, '/content/node-type/')) {
+      $item['parent_path'] = str_replace('node-type/', 'types/', $item['tab_parent']);
+      if (strpos($item['path'], '/edit')) {
+        $item['parent_path'] = 'admin/content/types';
+      }
+      $links[] = $item;
+      unset($deleted[$path]);
+    }
+  }
+
+  // Add link to drupal.org.
   $links[] = array(
     'title' => 'Drupal.org',
     'path' => 'http://drupal.org',
@@ -131,6 +156,7 @@ function admin_menu_admin_menu() {
       'parent_path' => 'http://drupal.org',
     );
   }
+
   // Add 'Create <content-type>' items to Content management menu.
   $links[] = array(
     'title' => 'Create content',
@@ -195,21 +221,26 @@ function admin_menu_admin_menu() {
  * @param array $sort
  *   An array containing the # parts of each link - must be updated if a link
  *   is added.
+ * @return
+ *   An array of links that were removed from $menu_links.
  */
 function admin_menu_adjust_items(&$menu_links, &$sort) {
   global $user, $base_url;
   $links = array();
+  $deleted = array();
 
   // Change or remove items, or add new top-level items
-  $add_links['admin/by-module'] = $menu_links['admin/by-module'];
+  $deleted['admin/by-module'] = $menu_links['admin/by-module'];
   unset($menu_links['admin/by-module'], $sort['admin/by-module']);
+  $deleted['admin/by-task'] = $menu_links['admin/by-task'];
   unset($menu_links['admin/by-task'], $sort['admin/by-task']);
 
-  // Remove "edit" links
-  foreach (node_get_types('types', NULL, TRUE) as $type) {
-    $type_url_str = str_replace('_', '-', $type->type);
-    $path = 'admin/content/node-type/'. $type_url_str .'/edit';
-    unset($menu_links[$path], $sort[$path]);
+  // Remove links under admin/content/node-type/
+  foreach ($menu_links as $path => $link) {
+    if (strpos($path, '/content/node-type/')) {
+      $deleted[$path] = $link;
+      unset($menu_links[$path], $sort[$path]);
+    }
   }
 
   // Add the icon containing special links.
@@ -241,6 +272,6 @@ function admin_menu_adjust_items(&$menu_
     $sort[$path] = 1;
   }
 
-  return;
+  return $deleted;
 }
 
