Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.330 diff -u -r1.330 system.module --- modules/system.module 5 Jul 2006 11:45:51 -0000 1.330 +++ modules/system.module 6 Jul 2006 10:59:41 -0000 @@ -103,16 +103,24 @@ $items[] = array('path' => 'admin', 'title' => t('administer'), 'access' => user_access('access administration pages'), - 'callback' => 'watchdog_overview', + 'callback' => 'system_main_admin_page', 'weight' => 9); // Themes: - $items[] = array('path' => 'admin/themes', 'title' => t('themes'), + $items[] = array( + 'path' => 'admin/themes', + 'title' => t('themes'), + 'description' => t('Change which theme your site uses or allows users to set.'), 'callback' => 'system_themes', 'access' => $access); - $items[] = array('path' => 'admin/themes/select', 'title' => t('list'), - 'callback' => 'system_themes', 'access' => $access, - 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1); + $items[] = array( + 'path' => 'admin/themes/select', + 'title' => t('list'), + 'description' => t('Select the default theme.'), + 'callback' => 'system_themes', + 'access' => $access, + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -1); $items[] = array('path' => 'admin/themes/settings', 'title' => t('configure'), 'callback' => 'system_theme_settings', 'access' => $access, @@ -132,15 +140,27 @@ } // Modules: - $items[] = array('path' => 'admin/settings', 'title' => t('settings'), - 'callback' => 'system_site_settings', 'access' => $access); + $items[] = array( + 'path' => 'admin/settings', + 'title' => t('settings'), + 'description' => t('Configure general system settings'), + 'callback' => 'system_site_settings', + 'access' => $access); + foreach (module_list() as $name) { if (module_hook($name, 'settings')) { - $items[] = array('path' => 'admin/settings/'. $name, 'title' => t($name)); + $items[] = array( + 'path' => 'admin/settings/'. $name, + 'title' => t($name), + 'description' => "Configuration settings for $name"); // TODO: fix me, prototype only! } } - $items[] = array('path' => 'admin/modules', 'title' => t('modules'), - 'callback' => 'system_modules', 'access' => $access); + $items[] = array( + 'path' => 'admin/modules', + 'title' => t('modules'), + 'description' => t('Configure system modules'), + 'callback' => 'system_modules', + 'access' => $access); } return $items; @@ -245,6 +265,47 @@ return $zones; } +function _system_main_admin_block($mid) { + $menu = menu_get_item($mid); + + if (is_array($menu['children'])) { + $output = "
\n"; + $output .= "
". check_plain($menu['title']) ."
\n"; + if ($menu['description']) { + $output .= "
". check_plain($menu['description']) ."
\n"; + } + $output .= "
\n"; + foreach ($menu['children'] as $mid) { + $item = menu_get_item($mid); + $output .= "
". menu_item_link($mid) ."
\n"; + if ($item['description']) { + $output .= "
". check_plain($item['description']) ."
\n"; + } + } + $output .= "
\n"; + $output .= "
\n"; + return $output; + } +} + +function system_main_admin_page() { + $menu = menu_get_item(NULL, 'admin'); + foreach ($menu['children'] as $mid) { + if ($block = _system_main_admin_block($mid)) { + $blocks[] = $block; + } + } + + + // TODO: use CSS for God's sake! This is just a quick prototype; didn't felt like messing around with the CSS for 20 minutes ... + $middle = count($blocks) / 2; + $output = ''; + $output .= ''; + $output .= '
'. implode(' ', array_splice($blocks, 0, $middle)) .''. implode($blocks) .'
'; + + return $output; +} + function system_view_general() { // General settings: $form['general'] = array( Index: misc/drupal.css =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.css,v retrieving revision 1.151 diff -u -r1.151 drupal.css --- misc/drupal.css 30 Jun 2006 00:13:32 -0000 1.151 +++ misc/drupal.css 6 Jul 2006 10:59:41 -0000 @@ -39,7 +39,6 @@ td.active { background-color: #ddd; } - /* ** Menu styles */ @@ -555,6 +554,13 @@ ul.secondary a.active { border-bottom: 4px solid #999; } +div.admin-block { + background-color: #ccc; + margin: 1em; +} +div.admin-block .title { + font-weight: bold; +} /* ** Help module