Index: admin_menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.inc,v
retrieving revision 1.60
diff -u -p -r1.60 admin_menu.inc
--- admin_menu.inc	28 Aug 2009 12:06:11 -0000	1.60
+++ admin_menu.inc	8 Sep 2009 15:01:40 -0000
@@ -26,6 +26,14 @@ function admin_menu_links_menu($tree) {
     if (isset($data['link']['type']) && $data['link']['type'] == MENU_CALLBACK) {
       continue;
     }
+    // Make child items of 'Administer' appear on the root level.
+    // @todo Make this configurable.
+    if ($data['link']['router_path'] == 'admin') {
+      if ($data['below']) {
+        $links = array_merge($links, admin_menu_links_menu($data['below']));
+      }
+      continue;
+    }
     // Omit alias lookups.
     $data['link']['localized_options']['alias'] = TRUE;
     // Remove description to prevent mouseover tooltip clashes.
Index: admin_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/admin_menu/admin_menu.module,v
retrieving revision 1.94
diff -u -p -r1.94 admin_menu.module
--- admin_menu.module	28 Aug 2009 12:06:11 -0000	1.94
+++ admin_menu.module	8 Sep 2009 15:06:04 -0000
@@ -97,74 +97,39 @@ function admin_menu_menu() {
  * Implementation of hook_menu_alter().
  */
 function admin_menu_menu_alter(&$items) {
-  // Move all items below admin/* into administration menu.
   foreach ($items as $path => $item) {
-    if (strpos($path, 'admin') === 0) {
-      if (!isset($item['type'])) {
-        $items[$path]['menu_name'] = 'management';
-      }
-      else {
-        // For any reason, content-type menu items are registered individually
-        // in Drupal core, but also by CCK. We a) have to copy and re-assign
-        // them the proper router path and b) turn their parent items from
-        // MENU_CALLBACK into something visible; otherwise, the menu system
-        // does not find the parents and relocates child items to the top-level.
-        if (strpos($path, 'admin/structure/node-type/') === 0) {
-          // Fix router path.
-          $newpath = strtr($path, array('/node-type/' => '/types/'));
-          $items[$newpath] = $items[$path];
-          // Alter item type and visibility.
-          $items[$newpath]['type'] &= ~MENU_CALLBACK;
-          if ($items[$newpath]['type'] === 0) {
-            $items[$newpath]['type'] |= MENU_NORMAL_ITEM;
-          }
-          // Use new item from here, but leave old intact to play nice with
-          // others.
-          $path = $newpath;
-          $item = $items[$newpath];
-        }
-        if ($item['type'] & MENU_IS_LOCAL_TASK) {
-          // Trick this item into the visible menu tree.
-          $items[$path]['_visible'] = TRUE;
+    if (!strncmp($path, 'admin/', 6) && isset($item['type'])) {
+      // To avoid namespace clashes, content-type menu items are registered
+      // on a separate path. Copy these items with the proper router path and
+      // make them visible.
+      // @todo Is there another possibility to re-assign these items to their
+      // true parent (admin/structure/types) during menu rebuild to avoid the
+      // (possibly) clashing copying?
+      if (strpos($path, 'admin/structure/node-type/') === 0) {
+        // Copy item with fixed router path.
+        $newpath = str_replace('/node-type/', '/types/', $path);
+        $items[$newpath] = $item;
+        $path = $newpath;
+        // Turn MENU_CALLBACK items into visible menu items.
+        if ($item['type'] == MENU_CALLBACK) {
+          $items[$path]['type'] = MENU_NORMAL_ITEM;
         }
-        // Skip invisible MENU_CALLBACKs, but make sure that it is not a
-        // MENU_NORMAL_ITEM, which shares the MENU_VISIBLE_IN_BREADCRUMB bit.
-        if ($item['type'] === MENU_CALLBACK) {
-          continue;
-        }
-        $items[$path]['menu_name'] = 'management';
       }
-    }
-    // Copy 'Add new content' into management menu.
-    elseif (strpos($path, 'node/add') === 0) {
-      $newpath = 'admin/' . $path;
-      $items[$newpath] = admin_menu_copy_item($item, $path, $newpath);
-      $items[$newpath]['menu_name'] = 'management';
-      if ($newpath == 'admin/node/add') {
-        $items[$newpath]['weight'] = -15;
+      if ($item['type'] & MENU_IS_LOCAL_TASK) {
+        // Trick this item into the visible menu tree.
+        $items[$path]['_visible'] = TRUE;
       }
     }
   }
 
-  // Remove 'admin', so children appear on the top-level.
-  $items['admin']['type'] = MENU_CALLBACK;
   // Remove local tasks on 'admin'.
   $items['admin/by-task']['_visible'] = FALSE;
   $items['admin/by-module']['_visible'] = FALSE;
-
-  // menu_link_save() looks up the parent's menu_name directly in the database
-  // instead of taking data in hook_menu() into account. When installing
-  // admin_menu, {menu_links} contains the default value of 'navigation', which
-  // is thereby applied to all items, even if this function altered them. There
-  // is no other way to override this behavior.
-  // Additionally, if links below admin/ were moved or customized in any way and
-  // those are moved back into the administration menu, then the menu system
-  // will not calculate/assign the proper menu link parents when the parent item
-  // (here: 'admin') is marked as customized.
-  db_query("UPDATE {menu_links} SET menu_name = 'management', customized = 0 WHERE router_path = 'admin'");
+  // Move 'Add new content' to the start of the menu.
+  $items['node/add']['weight'] = -15;
 
   // Flush client-side caches whenever the menu is rebuilt.
-  module_invoke('admin_menu', 'flush_caches');
+  admin_menu_flush_caches();
 }
 
 /**
