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 12 Jul 2006 15:15:05 -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 Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.332 diff -u -r1.332 system.module --- modules/system/system.module 10 Jul 2006 21:12:09 -0000 1.332 +++ modules/system/system.module 12 Jul 2006 15:15:07 -0000 @@ -101,16 +101,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, @@ -210,6 +218,50 @@ } } +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); + //print "
"; print_r($item); print "
"; + if (!($item['type'] & MENU_NORMAL_ITEM)) { + $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; +} + + /* * Returns a fieldset containing the theme select form. *