Index: modules/toolbar/toolbar.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.install,v
retrieving revision 1.1
diff -u -p -r1.1 toolbar.install
--- modules/toolbar/toolbar.install	4 Jul 2009 05:37:30 -0000	1.1
+++ modules/toolbar/toolbar.install	15 Jul 2009 21:57:36 -0000
@@ -14,6 +14,15 @@
  */
 function toolbar_install() {
   $t = get_t();
+
+  $query = db_insert('menu_custom')
+    ->fields(array(
+      'menu_name' => 'toolbar_links',
+      'title' => $t('Toolbar links'),
+      'description' => $t('The <em>Toolbar links</em> menu contains the primary entry points to administrative pages from the admin header.')
+    ))
+    ->execute();
+
   $query = db_insert('menu_custom')
     ->fields(array(
       'menu_name' => 'admin_shortcuts',
@@ -26,8 +35,6 @@ function toolbar_install() {
   menu_rebuild();
   $items = array(
     'node/add' => 'Add',
-    'admin/content/node' => 'Find content',
-    'admin' => 'Dashboard',
   );
   $weight = -20;
   foreach ($items as $path => $title) {
@@ -39,6 +46,41 @@ function toolbar_install() {
       'menu_name' => 'admin_shortcuts',
       'module' => 'menu',
       'weight' => $weight,
+      'plid' => 0,
+    );
+
+    // Check for an existing menu item before attempting to create a new one.
+    $menu_link = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name", array(
+      ':path' => $link['link_path'],
+      ':menu_name' => $link['menu_name']
+    ))
+    ->fetchField();
+    if (!$menu_link) {
+      menu_link_save($link);
+    }
+    // Increment weight so items can be displayed in desired order.
+    $weight++;
+  }
+  // Save the main toolbar links.
+  $items = array(
+    'admin/content/content' => 'Content',
+    'admin/build' => 'Structure',
+    'admin/user/user' => 'People',
+    'admin/build/themes' => 'Appearance',
+    'admin/settings' => 'Configuration and modules',
+    'admin/help' => 'Help',
+  );
+  $weight = -20;
+  foreach ($items as $path => $title) {
+    $link = array(
+      'mlid' => 0,
+      'link_title' => $title,
+      'link_path' => $path,
+      'router_path' => $path,
+      'menu_name' => 'toolbar_links',
+      'module' => 'menu',
+      'weight' => $weight,
+      'plid' => 0,
     );
 
     // Check for an existing menu item before attempting to create a new one.
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.3
diff -u -p -r1.3 toolbar.module
--- modules/toolbar/toolbar.module	7 Jul 2009 07:54:35 -0000	1.3
+++ modules/toolbar/toolbar.module	15 Jul 2009 21:57:36 -0000
@@ -71,7 +71,7 @@ function toolbar_build() {
   );
 
   // Retrieve the admin menu from the database.
-  $links = toolbar_menu_navigation_links(toolbar_get_menu_tree());
+  $links = toolbar_menu_navigation_links(menu_tree_all_data('toolbar_links'));
   $build['toolbar_menu'] = array(
     '#theme' => 'links',
     '#links' => $links,
@@ -108,26 +108,6 @@ function toolbar_build() {
 }
 
 /**
- * Get only the top level items below the 'admin' path.
- */
-function toolbar_get_menu_tree() {
-  $tree = menu_tree_all_data('management');
-  foreach ($tree as $item) {
-    if ($item['link']['link_path'] == 'admin' && !empty($item['below'])) {
-      // Only take items right below the 'admin' path. All other management 
-      // items are discarded.
-      $tree = $item['below'];
-      break;
-    }
-  }
-  foreach ($tree as $key => $item) {
-    // Get rid of subitems to have a leaner data structure.
-    unset($tree[$key]['below']);
-  }
-  return $tree;
-}
-
-/**
  * Generate a links array from a menu tree array.
  *
  * Based on menu_navigation_links(). Adds in path based IDs, icon placeholders
