? system-by-module.patch
Index: system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.467
diff -u -u -p -r1.467 system.module
--- system.module	13 Apr 2007 08:56:59 -0000	1.467
+++ system.module	15 Apr 2007 02:29:41 -0000
@@ -2345,7 +2345,6 @@ function theme_admin_block_content($cont
  * Menu callback; prints a listing of admin tasks for each installed module.
  */
 function system_admin_by_module() {
-  return 'This page awaits rewrite'; // TODO: this needs to be rewritten for the new menu system.
   $modules = module_rebuild_cache();
   $menu_items = array();
   foreach ($modules as $file) {
@@ -2374,9 +2373,7 @@ function system_admin_by_module() {
 }
 
 function system_get_module_admin_tasks($module) {
-  return array(); // TODO: this needs to be rewritten for the new menu system.
   $admin_access = user_access('administer access control');
-  $menu = menu_get_menu();
   $admin_tasks = array();
 
   // Check for permissions.
@@ -2386,11 +2383,15 @@ function system_get_module_admin_tasks($
 
   // Check for menu items that are admin links.
   if ($items = module_invoke($module, 'menu', TRUE)) {
-    foreach ($items as $item) {
-      $parts = explode('/', $item['path']);
+    foreach ($items as $path => $item) {
+      $parts = explode('/', $path);
       $n = count($parts);
-      if ((!isset($item['type']) || ($item['type'] & MENU_VISIBLE_IN_TREE)) && ($parts[0] == 'admin') && ($n >= 3) && _menu_item_is_accessible($menu['path index'][$item['path']])) {
-        $admin_tasks[$item['title']] = l($item['title'], $item['path']);
+      if ((!isset($item['type']) || ($item['type'] & MENU_VISIBLE_IN_TREE)) && $parts[0] == 'admin' && $n >= 3)
+      {
+        $menu = menu_get_item($path);
+        if (isset($menu) && $menu->access) {
+          $admin_tasks[$menu->mid] = l($item['title'], $path);
+        }
       }
     }
   }
@@ -2402,9 +2403,9 @@ function system_get_module_admin_tasks($
  * Theme output of the dashboard page.
  */
 function theme_system_admin_by_module($menu_items) {
-  $stripe = 0;
-  $output = '';
-  $container = array();
+  $container = array('left' => '', 'right' => '');
+  $flip = array('left' => 'right', 'right' => 'left');
+  $position = 'left';
 
   // Iterate over all modules
   foreach ($menu_items as $module => $block) {
@@ -2418,9 +2419,10 @@ function theme_system_admin_by_module($m
       $block['description'] = t($description);
 
       if ($block_output = theme('admin_block', $block)) {
-        if (!$block['position']) {
+        if (!isset($block['position'])) {
           // Perform automatic striping.
-          $block['position'] = ++$stripe % 2 ? 'left' : 'right';
+          $block['position'] = $position;
+          $position = $flip[$position];
         }
         $container[$block['position']] .= $block_output;
       }
