? admin-page.patch ? admin_0.patch ? admin_page.patch ? sites/test2.logrus.com Index: misc/drupal.css =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.css,v retrieving revision 1.151 diff -u -p -r1.151 drupal.css --- misc/drupal.css 30 Jun 2006 00:13:32 -0000 1.151 +++ misc/drupal.css 13 Jul 2006 01:03:02 -0000 @@ -39,7 +39,6 @@ tr.even, tr.odd { td.active { background-color: #ddd; } - /* ** Menu styles */ @@ -555,6 +554,13 @@ ul.secondary a { 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 @@ -674,3 +680,54 @@ html.js fieldset.collapsed legend a { display: block; padding: 1.5em 0 .5em; } + + +/* +** formatting for administration page -- this should probably be its own file +*/ +div.admin-panel { + margin: 0px 0px 0px 0px; + padding: 5px 5px 15px 5px; +} + +div.admin-panel .desc { + margin: 0px 0px 3px; + padding: 2px 0 3px 0; + font-size: 10px; + line-height: 10px; + font-weight: normal; + text-align: left; + color: #999; + border-bottom: 1px solid #777777; +} + +div.admin-panel .body { + padding: 0 4px 2px 8px; + background-color: #f4f4f4; + line-height: 1.2em; +} + +div.admin-panel .head { + background-color: #6699CC; + color: #FFFFFF; + font-weight: bold; + font-size: 14px; + margin: 0px 0px 0px 0px; + padding: 4px 4px 4px 8px; +} + +div.admin { + padding-top: 15px; +} + +div.admin .left { + float: left; + width: 47%; + margin-left: 1em; +} +div.admin .right { + float: right; + width: 47%; + margin-right: 1em; +} + Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.332 diff -u -p -r1.332 system.module --- modules/system/system.module 10 Jul 2006 21:12:09 -0000 1.332 +++ modules/system/system.module 13 Jul 2006 01:03:04 -0000 @@ -101,16 +101,24 @@ function system_menu($may_cache) { $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,27 @@ function system_user($type, $edit, &$use } } +function system_main_admin_page() { + $menu = menu_get_item(NULL, 'admin'); + foreach ($menu['children'] as $mid) { + $block = menu_get_item($mid); + if (is_array($block['children'])) { + $content = array(); + foreach ($block['children'] as $mid) { + $item = menu_get_item($mid); + if ($item['type'] & MENU_VISIBLE_IN_TREE) { + $content[] = $item; + } + } + $block['content'] .= theme('admin_block_content', $content); + $blocks[] = $block; + } + } + + return theme('admin_page', $blocks); +} + + /* * Returns a fieldset containing the theme select form. * @@ -1376,3 +1405,92 @@ function confirm_form($form_id, $form, $ $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path)); return drupal_get_form($form_id, $form, 'confirm_form'); } + +/** + * This function formats an administrative block for display. + * + * @param $block + * An array containing information about the block. It should + * include a 'title', a 'description' and a formatted 'content'. + * @themeable + */ +function theme_admin_block($block) { + // Don't display the block if it has no content to display. + if (!$block['content']) { + return; + } + + $output = <<< EOT +