Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.407
diff -u -p -r1.407 menu.inc
--- includes/menu.inc	23 Aug 2010 23:38:06 -0000	1.407
+++ includes/menu.inc	25 Aug 2010 14:07:22 -0000
@@ -2140,7 +2140,7 @@ function menu_set_active_trail($new_trai
       // The title of a local task is used for the tab, never the page title.
       // Thus, replace it with the item corresponding to the root path to get
       // the relevant href and title. For example, the menu item corresponding
-      // to 'admin' is used when on the 'By module' tab at 'admin/by-module'.
+      // to 'admin' is used when on the 'Index' tab at 'admin/index'.
       $parts = explode('/', $item['tab_root']);
       $args = arg();
       // Replace wildcards in the root path using the current path.
Index: modules/dashboard/dashboard.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.module,v
retrieving revision 1.33
diff -u -p -r1.33 dashboard.module
--- modules/dashboard/dashboard.module	20 Aug 2010 01:42:52 -0000	1.33
+++ modules/dashboard/dashboard.module	25 Aug 2010 14:07:22 -0000
@@ -30,9 +30,8 @@ function dashboard_menu() {
     'description' => 'View and customize your dashboard',
     'page callback' => 'dashboard_admin',
     'access arguments' => array('access dashboard'),
-    'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
     // Make this appear first, so for example, in admin menus, it shows up on
-    // the top corner of the window as a convinient "home link".
+    // the top corner of the window as a convenient "home link".
     'weight' => -15,
   );
   $items['admin/dashboard/customize'] = array(
@@ -202,14 +201,6 @@ function dashboard_theme() {
  *   Whether to launch in customization mode right away. TRUE or FALSE.
  */
 function dashboard_admin($launch_customize = FALSE) {
-  // Only continue if provided arguments are expected. This function serves
-  // as the callback for the top-level admin/ page, so any unexpected arguments
-  // are likely the result of someone typing in the URL of an administrative
-  // page that doesn't actually exist; for example, admin/some/random/page.
-  if (!is_bool($launch_customize)) {
-    return MENU_NOT_FOUND;
-  }
-
   $js_settings = array(
     'dashboard' => array(
       'drawer' => url('admin/dashboard/drawer'),
Index: modules/help/help.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.admin.inc,v
retrieving revision 1.12
diff -u -p -r1.12 help.admin.inc
--- modules/help/help.admin.inc	30 Jul 2010 02:47:28 -0000	1.12
+++ modules/help/help.admin.inc	25 Aug 2010 15:46:15 -0000
@@ -22,12 +22,12 @@ function help_main() {
 function help_page($name) {
   $output = '';
   if (module_hook($name, 'help')) {
-    $module = drupal_parse_info_file(drupal_get_path('module', $name) . '/' . $name . '.info');
-    drupal_set_title($module['name']);
+    $info = system_get_info('module');
+    drupal_set_title($info[$name]['name']);
 
     $temp = module_invoke($name, 'help', "admin/help#$name", drupal_help_arg());
     if (empty($temp)) {
-      $output .= t("No help is available for module %module.", array('%module' => $module['name']));
+      $output .= t("No help is available for module %module.", array('%module' => $info[$name]['name']));
     }
     else {
       $output .= $temp;
@@ -35,12 +35,15 @@ function help_page($name) {
 
     // Only print list of administration pages if the module in question has
     // any such pages associated to it.
-    $admin_tasks = system_get_module_admin_tasks($name);
+    module_load_include('inc', 'system', 'system.admin');
+    $admin_tasks = system_admin_get_module_tasks($name, $info[$name]);
     if (!empty($admin_tasks)) {
-      ksort($admin_tasks);
-      $output .= theme('item_list', array('items' => $admin_tasks, 'title' => t('@module administration pages', array('@module' => $module['name']))));
+      $links = array();
+      foreach ($admin_tasks as $task) {
+        $links[] = l($task['title'], $task['link_path'], $task['localized_options']);
+      }
+      $output .= theme('item_list', array('items' => $links, 'title' => t('@module administration pages', array('@module' => $info[$name]['name']))));
     }
-
   }
   return $output;
 }
Index: modules/node/node.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v
retrieving revision 1.130
diff -u -p -r1.130 node.pages.inc
--- modules/node/node.pages.inc	20 Aug 2010 01:23:43 -0000	1.130
+++ modules/node/node.pages.inc	25 Aug 2010 14:16:34 -0000
@@ -18,6 +18,7 @@ function node_page_edit($node) {
 
 function node_add_page() {
   $item = menu_get_item();
+  module_load_include('inc', 'system', 'system.admin');
   $content = system_admin_menu_block($item);
   // Bypass the node/add listing if only one content type is available.
   if (count($content) == 1) {
Index: modules/simpletest/tests/menu_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu_test.module,v
retrieving revision 1.15
diff -u -p -r1.15 menu_test.module
--- modules/simpletest/tests/menu_test.module	7 Jul 2010 08:05:01 -0000	1.15
+++ modules/simpletest/tests/menu_test.module	25 Aug 2010 14:07:22 -0000
@@ -186,7 +186,6 @@ function menu_test_menu() {
     'description' => 'File inheritance test description',
     'page callback' => 'menu_test_callback',
     'access arguments' => array('access content'),
-    'type' => MENU_LOCAL_TASK,
   );
 
   $items['menu_login_callback'] = array(
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.298
diff -u -p -r1.298 system.admin.inc
--- modules/system/system.admin.inc	22 Aug 2010 12:55:04 -0000	1.298
+++ modules/system/system.admin.inc	25 Aug 2010 15:49:37 -0000
@@ -9,70 +9,6 @@
 /**
  * Menu callback; Provide the administration overview page.
  */
-function system_main_admin_page($arg = NULL) {
-  // Only continue if provided arguments are expected. This function serves
-  // as the callback for the top-level admin/ page, so any unexpected arguments
-  // are likely the result of someone typing in the URL of an administrative
-  // page that doesn't actually exist; for example, admin/some/random/page.
-  if (isset($arg) && substr($arg, 0, 3) != 'by-') {
-    return MENU_NOT_FOUND;
-  }
-
-  // Check for status report errors.
-  if (system_status(TRUE) && user_access('administer site configuration')) {
-    drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the <a href="@status">status report</a> for more information.', array('@status' => url('admin/reports/status'))), 'error');
-  }
-  $blocks = array();
-  if ($admin = db_query("SELECT menu_name, mlid FROM {menu_links} WHERE link_path = 'admin' AND module = 'system'")->fetchAssoc()) {
-    $result = db_query("
-      SELECT m.*, ml.*
-      FROM {menu_links} ml
-      INNER JOIN {menu_router} m ON ml.router_path = m.path
-      WHERE ml.link_path != 'admin/help' AND menu_name = :menu_name AND ml.plid = :mlid AND hidden = 0", $admin, array('fetch' => PDO::FETCH_ASSOC));
-    foreach ($result as $item) {
-      _menu_link_translate($item);
-      if (!$item['access']) {
-        continue;
-      }
-      // The link 'description' either derived from the hook_menu 'description'
-      // or entered by the user via menu module is saved as the title attribute.
-      if (!empty($item['localized_options']['attributes']['title'])) {
-        $item['description'] = $item['localized_options']['attributes']['title'];
-      }
-      $block = $item;
-      $block['content'] = '';
-      $block['show'] = FALSE;
-      if ($item['block_callback'] && function_exists($item['block_callback'])) {
-        $function = $item['block_callback'];
-        $block['content'] .= $function();
-      }
-      $content = system_admin_menu_block($item);
-      if ((isset($item['page_callback']) && !in_array($item['page_callback'], array('system_admin_menu_block_page', 'system_admin_config_page', 'system_settings_overview'))) || count($content)) {
-        // Only show blocks for items which are not containers, or those which
-        // are containers and do have items we can show.
-        $block['show'] = TRUE;
-        $block['title'] = l($item['title'], $item['href'], $item['localized_options']);
-        if (!empty($content)) {
-          $block['content'] .= theme('admin_block_content', array('content' => $content));
-        }
-      }
-      // Prepare for sorting as in function _menu_tree_check_access().
-      // The weight is offset so it is always positive, with a uniform 5-digits.
-      $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block;
-    }
-  }
-  if ($blocks) {
-    ksort($blocks);
-    return theme('admin_page', array('blocks' => $blocks));
-  }
-  else {
-    return t('You do not have any administrative items.');
-  }
-}
-
-/**
- * Menu callback; Provide the administration overview page.
- */
 function system_admin_config_page() {
   // Check for status report errors.
   if (system_status(TRUE) && user_access('administer site configuration')) {
@@ -90,10 +26,11 @@ function system_admin_config_page() {
       if (!$item['access']) {
         continue;
       }
-      // The link 'description' either derived from the hook_menu 'description'
-      // or entered by the user via menu module is saved as the title attribute.
+      // The link description, either derived from 'description' in hook_menu()
+      // or customized via menu module is used as title attribute.
       if (!empty($item['localized_options']['attributes']['title'])) {
         $item['description'] = $item['localized_options']['attributes']['title'];
+        unset($item['localized_options']['attributes']['title']);
       }
       $block = $item;
       $block['content'] = '';
@@ -142,40 +79,156 @@ function system_admin_menu_block_page() 
 }
 
 /**
+ * Provide a single block on the administration overview page.
+ *
+ * @param $item
+ *   The menu item to be displayed.
+ */
+function system_admin_menu_block($item) {
+  $cache = &drupal_static(__FUNCTION__, array());
+  // If we are calling this function for a menu item that corresponds to a
+  // local task (for example, admin/tasks), then we want to retrieve the
+  // parent item's child links, not this item's (since this item won't have
+  // any).
+  // @todo Use tab_root_href instead, when made available.
+  if ($item['tab_root'] != $item['path']) {
+    $item = menu_get_item($item['tab_root']);
+  }
+
+  if (!isset($item['mlid'])) {
+    $item += db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = :path AND module = 'system'", array(':path' => $item['path']))->fetchAssoc();
+  }
+
+  if (isset($cache[$item['mlid']])) {
+    return $cache[$item['mlid']];
+  }
+
+  $content = array();
+  $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
+  $query->join('menu_router', 'm', 'm.path = ml.router_path');
+  $query
+    ->fields('ml')
+    // Weight should be taken from {menu_links}, not {menu_router}.
+    ->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight')))
+    ->condition('ml.plid', $item['mlid'])
+    ->condition('ml.menu_name', $item['menu_name'])
+    ->condition('ml.hidden', 0);
+
+  foreach ($query->execute() as $link) {
+    _menu_link_translate($link);
+    if ($link['access']) {
+      // The link description, either derived from 'description' in
+      // hook_menu() or customized via menu module is used as title attribute.
+      if (!empty($link['localized_options']['attributes']['title'])) {
+        $link['description'] = $link['localized_options']['attributes']['title'];
+        unset($link['localized_options']['attributes']['title']);
+      }
+      // Prepare for sorting as in function _menu_tree_check_access().
+      // The weight is offset so it is always positive, with a uniform 5-digits.
+      $key = (50000 + $link['weight']) . ' ' . drupal_strtolower($link['title']) . ' ' . $link['mlid'];
+      $content[$key] = $link;
+    }
+  }
+  ksort($content);
+  $cache[$item['mlid']] = $content;
+  return $content;
+}
+
+/**
  * Menu callback; prints a listing of admin tasks for each installed module.
  */
-function system_admin_by_module() {
+function system_admin_index() {
   $module_info = system_get_info('module');
   foreach ($module_info as $module => $info) {
     $module_info[$module] = new stdClass();
     $module_info[$module]->info = $info;
   }
-  uasort($module_info, 'system_sort_modules_by_info_name');
+  uasort($module_info, 'system_sort_by_info_name');
   $menu_items = array();
-  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
 
   foreach ($module_info as $module => $info) {
-    if ($module == 'help') {
-      continue;
-    }
+    // Only display a section if there are any available tasks.
+    if ($admin_tasks = system_admin_get_module_tasks($module, $info->info)) {
+      // Sort links by title.
+      uasort($admin_tasks, 'system_sort_by_title');
+      // Move 'Configure permissions' links to the bottom of each section.
+      if (isset($admin_tasks[-1])) {
+        $admin_tasks[] = $admin_tasks[-1];
+        unset($admin_tasks[-1]);
+      }
 
-    $admin_tasks = system_get_module_admin_tasks($module);
+      $menu_items[$info->info['name']] = array($info->info['description'], $admin_tasks);
+    }
+  }
+  return theme('system_admin_index', array('menu_items' => $menu_items));
+}
 
-    // Only display a section if there are any available tasks.
-    if (count($admin_tasks)) {
+/**
+ * Generate a list of tasks offered by a specified module.
+ *
+ * @param $module
+ *   Module name.
+ * @param $info
+ *   The module's information, as provided by system_get_info().
+ *
+ * @return
+ *   An array of task links.
+ */
+function system_admin_get_module_tasks($module, $info) {
+  $cache = &drupal_static(__FUNCTION__);
 
-      // Check for help links.
-      if ($help_arg && module_invoke($module, 'help', "admin/help#$module", $help_arg)) {
-        $admin_tasks[100] = l(t('Get help'), "admin/help/$module");
+  if (!isset($cache)) {
+    $cache = array(
+      'links' => array(),
+      'link_permissions' => array('access' => FALSE),
+    );
+    $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
+    $query->join('menu_router', 'm', 'm.path = ml.router_path');
+    $query
+      ->fields('ml')
+      // Weight should be taken from {menu_links}, not {menu_router}.
+      ->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight')))
+      ->condition('ml.link_path', 'admin/%', 'LIKE')
+      ->condition('ml.hidden', 0, '>=')
+      ->condition('ml.module', 'system')
+      ->condition('m.number_parts', 1, '>')
+      ->condition('m.page_callback', 'system_admin_menu_block_page', '!=');
+    foreach ($query->execute() as $link) {
+      _menu_link_translate($link);
+      if ($link['access']) {
+        $cache['links'][$link['router_path']] = $link;
       }
+    }
 
-      // Sort.
-      ksort($admin_tasks);
-
-      $menu_items[$info->info['name']] = array($info->info['description'], $admin_tasks);
+    $cache['link_permissions'] = menu_get_item('admin/people/permissions');
+    unset($cache['link_permissions']['description']);
+  }
+
+  $admin_tasks = array();
+  if ($menu = module_invoke($module, 'menu')) {
+    foreach ($menu as $path => $item) {
+      if (isset($cache['links'][$path])) {
+        $task = $cache['links'][$path];
+        // The link description, either derived from 'description' in
+        // hook_menu() or customized via menu module is used as title attribute.
+        if (!empty($task['localized_options']['attributes']['title'])) {
+          $task['description'] = $task['localized_options']['attributes']['title'];
+          unset($task['localized_options']['attributes']['title']);
+        }
+        $admin_tasks[$path] = $task;
+      }
     }
   }
-  return theme('system_admin_by_module', array('menu_items' => $menu_items));
+
+  // Append link for permissions.
+  if ($cache['link_permissions']['access'] && module_hook($module, 'permission')) {
+    $task = $cache['link_permissions'];
+    $task['title'] = t('Configure @module permissions', array('@module' => $info['name']));
+    $task['localized_options']['fragment'] = 'module-' . $module;
+    $admin_tasks[-1] = $task;
+  }
+
+  return $admin_tasks;
 }
 
 /**
@@ -201,7 +254,7 @@ function system_settings_overview() {
 function system_themes_page() {
   // Get current list of themes.
   $themes = system_rebuild_theme_data();
-  uasort($themes, 'system_sort_modules_by_info_name');
+  uasort($themes, 'system_sort_by_info_name');
 
   $theme_default = variable_get('theme_default', 'bartik');
   $theme_groups  = array();
@@ -837,7 +890,7 @@ function system_modules($form, $form_sta
     }
   }
 
-  uasort($visible_files, 'system_sort_modules_by_info_name');
+  uasort($visible_files, 'system_sort_by_info_name');
 
   // If the modules form was submitted, then system_modules_submit() runs first
   // and if there are unfilled required modules, then $form_state['storage'] is
@@ -971,9 +1024,22 @@ function system_modules($form, $form_sta
 }
 
 /**
+ * Array sorting callback; sorts elements by 'title' key.
+ */
+function system_sort_by_title($a, $b) {
+  if (!isset($b['title'])) {
+    return -1;
+  }
+  if (!isset($a['title'])) {
+    return 1;
+  }
+  return strcasecmp($a['title'], $b['title']);
+}
+
+/**
  * Array sorting callback; sorts modules or themes by their name.
  */
-function system_sort_modules_by_info_name($a, $b) {
+function system_sort_by_info_name($a, $b) {
   return strcasecmp($a->info['name'], $b->info['name']);
 }
 
@@ -2375,43 +2441,36 @@ function system_batch_page() {
  *
  * @param $variables
  *   An associative array containing:
- *   - block: An array containing information about the block. It should include
- *     a 'title', a 'description' and a formatted 'content'.
+ *   - block: An array containing information about the block:
+ *     - show: A Boolean whether to output the block. Defaults to FALSE.
+ *     - title: The block's title.
+ *     - content: (optional) Formatted content for the block.
+ *     - description: (optional) Description of the block. Only output if
+ *       'content' is not set.
  *
  * @ingroup themeable
  */
 function theme_admin_block($variables) {
   $block = $variables['block'];
+  $output = '';
 
   // Don't display the block if it has no content to display.
   if (empty($block['show'])) {
-    return '';
+    return $output;
   }
 
-  if (empty($block['content'])) {
-    $output = <<< EOT
-    <div class="admin-panel">
-      <h3>
-        $block[title]
-      </h3>
-      <div class="description">
-        $block[description]
-      </div>
-    </div>
-EOT;
+  $output .= '<div class="admin-panel">';
+  if (!empty($block['title'])) {
+    $output .= '<h3>' . $block['title'] . '</h3>';
+  }
+  if (!empty($block['content'])) {
+    $output .= '<div class="body">' . $block['content'] . '</div>';
   }
   else {
-    $output = <<< EOT
-    <div class="admin-panel">
-      <h3>
-        $block[title]
-      </h3>
-     <div class="body">
-       $block[content]
-      </div>
-    </div>
-EOT;
+    $output .= '<div class="description">' . $block['description'] . '</div>';
   }
+  $output .= '</div>';
+
   return $output;
 }
 
@@ -2427,23 +2486,19 @@ EOT;
  */
 function theme_admin_block_content($variables) {
   $content = $variables['content'];
+  $output = '';
 
-  if (!$content) {
-    return '';
-  }
-
-  if (system_admin_compact_mode()) {
-    $output = '<ul class="menu">';
-    foreach ($content as $item) {
-      $output .= '<li class="leaf">' . l($item['title'], $item['href'], $item['localized_options']) . '</li>';
+  if (!empty($content)) {
+    $class = 'admin-list';
+    if ($compact = system_admin_compact_mode()) {
+      $class .= ' compact';
     }
-    $output .= '</ul>';
-  }
-  else {
-    $output = '<dl class="admin-list">';
+    $output .= '<dl class="' . $class . '">';
     foreach ($content as $item) {
       $output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';
-      $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';
+      if (!$compact && isset($item['description'])) {
+        $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';
+      }
     }
     $output .= '</dl>';
   }
@@ -2502,11 +2557,10 @@ function theme_admin_page($variables) {
  *
  * @ingroup themeable
  */
-function theme_system_admin_by_module($variables) {
+function theme_system_admin_index($variables) {
   $menu_items = $variables['menu_items'];
 
   $stripe = 0;
-  $output = '';
   $container = array('left' => '', 'right' => '');
   $flip = array('left' => 'right', 'right' => 'left');
   $position = 'left';
@@ -2519,7 +2573,7 @@ function theme_system_admin_by_module($v
     if (count($items)) {
       $block = array();
       $block['title'] = $module;
-      $block['content'] = theme('item_list', array('items' => $items));
+      $block['content'] = theme('admin_block_content', array('content' => $items));
       $block['description'] = t($description);
       $block['show'] = TRUE;
 
@@ -2535,6 +2589,7 @@ function theme_system_admin_by_module($v
   }
 
   $output = '<div class="admin clearfix">';
+  $output .= theme('system_compact_link');
   foreach ($container as $id => $data) {
     $output .= '<div class="' . $id . ' clearfix">';
     $output .= $data;
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.957
diff -u -p -r1.957 system.module
--- modules/system/system.module	22 Aug 2010 13:52:58 -0000	1.957
+++ modules/system/system.module	25 Aug 2010 14:20:39 -0000
@@ -87,7 +87,7 @@ function system_help($path, $arg) {
       $output .= '<dd>' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the <a href="@trigger-help">Trigger module</a>, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions. Visit the <a href="@actions">Actions page</a> to configure actions.', array('@trigger-help' => url('admin/help/trigger'), '@actions' => url('admin/config/system/actions'))) . '</dd>';
       $output .= '</dl>';
       return $output;
-    case 'admin/by-module':
+    case 'admin/index':
       return '<p>' . t('This page shows you all available administration tasks for each module.') . '</p>';
     case 'admin/appearance':
       $output = '<p>' . t('Set and configure the default theme for your website.  Alternative <a href="@themes">themes</a> are available.', array('@themes' => 'http://drupal.org/project/themes')) . '</p>';
@@ -184,7 +184,7 @@ function system_theme() {
       'variables' => array('content' => NULL),
       'file' => 'system.admin.inc',
     ),
-    'system_admin_by_module' => array(
+    'system_admin_index' => array(
       'variables' => array('menu_items' => NULL),
       'file' => 'system.admin.inc',
     ),
@@ -521,9 +521,9 @@ function system_menu() {
     'file' => 'system.admin.inc',
   );
   $items['admin'] = array(
-    'title' => 'Administer',
+    'title' => 'Administration',
     'access arguments' => array('access administration pages'),
-    'page callback' => 'system_main_admin_page',
+    'page callback' => 'system_admin_menu_block_page',
     'weight' => 9,
     'menu_name' => 'management',
     'theme callback' => 'variable_get',
@@ -537,17 +537,14 @@ function system_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'system.admin.inc',
   );
-  $items['admin/by-task'] = array(
-    'title' => 'By task',
-    'page callback' => 'system_main_admin_page',
-    'access arguments' => array('access administration pages'),
+  $items['admin/tasks'] = array(
+    'title' => 'Tasks',
     'type' => MENU_DEFAULT_LOCAL_TASK,
-    'file' => 'system.admin.inc',
     'weight' => -20,
   );
-  $items['admin/by-module'] = array(
-    'title' => 'By module',
-    'page callback' => 'system_admin_by_module',
+  $items['admin/index'] = array(
+    'title' => 'Index',
+    'page callback' => 'system_admin_index',
     'access arguments' => array('access administration pages'),
     'type' => MENU_LOCAL_TASK,
     'weight' => -18,
@@ -2001,75 +1998,6 @@ function system_preprocess_block(&$varia
 }
 
 /**
- * Provide a single block on the administration overview page.
- *
- * @param $item
- *   The menu item to be displayed.
- */
-function system_admin_menu_block($item) {
-  $cache = &drupal_static(__FUNCTION__, array());
-  if (!isset($item['mlid'])) {
-    $item += db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = :path AND module = 'system'", array(':path' => $item['path']))->fetchAssoc();
-  }
-
-  if (isset($cache[$item['mlid']])) {
-    return $cache[$item['mlid']];
-  }
-
-  $content = array();
-  $default_task = NULL;
-  $has_subitems = FALSE;
-  $result = db_query("
-    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, ml.*
-    FROM {menu_router} m
-    LEFT JOIN {menu_links} ml ON m.path = ml.router_path
-    WHERE (ml.plid = :plid AND ml.menu_name = :name AND hidden = 0) OR (m.tab_parent = :path AND m.type IN (:local_task, :default_task))", array(':plid' => $item['mlid'], ':name' => $item['menu_name'], ':path' => $item['path'], ':local_task' => MENU_LOCAL_TASK, ':default_task' => MENU_DEFAULT_LOCAL_TASK), array('fetch' => PDO::FETCH_ASSOC));
-  foreach ($result as $link) {
-    if (!isset($link['link_path'])) {
-      // If this was not an actual link, fake the tab as a menu link, so we
-      // don't need to special case it beyond this point.
-      $link['link_title'] = $link['title'];
-      $link['link_path'] = $link['path'];
-      $link['options'] = 'a:0:{}';
-      $link['weight'] = $link['router_weight'];
-    }
-    else {
-      // We found a non-tab subitem, remember that.
-      $has_subitems = TRUE;
-    }
-    _menu_link_translate($link);
-    if (!$link['access']) {
-      continue;
-    }
-
-    // The link 'description' — either derived from the hook_menu 'description' or
-    // entered by the user via menu module — is saved as the title attribute.
-    // The title attribute is then unset to reduce redundancy in admin pages
-    // for screen readers.
-    if (!empty($link['localized_options']['attributes']['title'])) {
-      $link['description'] = $link['localized_options']['attributes']['title'];
-      unset($link['localized_options']['attributes']['title']);
-    }
-
-    // Prepare for sorting as in function _menu_tree_check_access().
-    // The weight is offset so it is always positive, with a uniform 5-digits.
-    $key = (50000 + $link['weight']) . ' ' . drupal_strtolower($link['title']) . ' ' . $link['mlid'];
-    $content[$key] = $link;
-    if ($link['type'] == MENU_DEFAULT_LOCAL_TASK) {
-      $default_task = $key;
-    }
-  }
-  if ($has_subitems) {
-    // If we've had at least one non-tab subitem, remove the link for the
-    // default task, since that is already broken down to subitems.
-    unset($content[$default_task]);
-  }
-  ksort($content);
-  $cache[$item['mlid']] = $content;
-  return $content;
-}
-
-/**
  * Checks the existence of the directory specified in $form_element. This
  * function is called from the system_settings form to check both core file
  * directories (file_public_path, file_private_path, file_temporary_path).
@@ -2757,49 +2685,6 @@ function system_admin_compact_page($mode
 }
 
 /**
- * Generate a list of tasks offered by a specified module.
- *
- * @param $module
- *   Module name.
- * @return
- *   An array of task links.
- */
-function system_get_module_admin_tasks($module) {
-  $items = &drupal_static(__FUNCTION__, array());
-
-  if (empty($items)) {
-    $result = db_query("
-       SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.delivery_callback, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, ml.*
-       FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path WHERE ml.link_path LIKE 'admin/%' AND hidden >= 0 AND module = 'system' AND m.number_parts > 2", array(), array('fetch' => PDO::FETCH_ASSOC));
-    foreach ($result as $item) {
-      _menu_link_translate($item);
-      if ($item['access']) {
-        $items[$item['router_path']] = $item;
-      }
-    }
-  }
-
-  $admin_access = user_access('administer permissions');
-  $admin_tasks = array();
-  $admin_task_count = 0;
-  // Check for permissions.
-  if (in_array($module, module_implements('permission')) && $admin_access) {
-    $admin_tasks[-1] = l(t('Configure permissions'), 'admin/people/permissions', array('fragment' => 'module-' . $module));
-  }
-
-  // Check for menu items that are admin links.
-  if (in_array($module, module_implements('menu')) && $menu = module_invoke($module, 'menu')) {
-    foreach (array_keys($menu) as $path) {
-      if (isset($items[$path])) {
-        $admin_tasks[$items[$path]['title'] . $admin_task_count ++] = l($items[$path]['title'], $path);
-      }
-    }
-  }
-
-  return $admin_tasks;
-}
-
-/**
  * Implements hook_cron().
  *
  * Remove older rows from flood and batch table. Remove old temporary files.
Index: themes/seven/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/template.php,v
retrieving revision 1.20
diff -u -p -r1.20 template.php
--- themes/seven/template.php	14 Aug 2010 00:43:24 -0000	1.20
+++ themes/seven/template.php	25 Aug 2010 15:27:44 -0000
@@ -51,7 +51,7 @@ function seven_node_add_list($variables)
 }
 
 /**
- * Override of theme_admin_block_content().
+ * Overrides theme_admin_block_content().
  *
  * Use unordered list markup in both compact and extended mode.
  */
@@ -63,7 +63,7 @@ function seven_admin_block_content($vari
     foreach ($content as $item) {
       $output .= '<li class="leaf">';
       $output .= l($item['title'], $item['href'], $item['localized_options']);
-      if (!system_admin_compact_mode()) {
+      if (isset($item['description']) && !system_admin_compact_mode()) {
         $output .= '<div class="description">' . filter_xss_admin($item['description']) . '</div>';
       }
       $output .= '</li>';
