Index: system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.489 diff -u -u -p -r1.489 system.module --- system.module 5 Jun 2007 09:15:02 -0000 1.489 +++ system.module 5 Jun 2007 11:57:06 -0000 @@ -2562,7 +2562,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) { @@ -2591,23 +2590,25 @@ 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. if (module_hook($module, 'perm') && $admin_access) { - $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/access', array('fragment' => 'module-'. $module)); + $admin_tasks[] = l(t('Configure permissions'), 'admin/user/access', array('fragment' => 'module-'. $module)); } // 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[] = l($item['title'], $path); + } } } } @@ -2619,9 +2620,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) { @@ -2635,9 +2636,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; }