? admin-page.patch
? admin_0.patch
? admin_page.patch
? modules/devel
? 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 04:23:38 -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 04:23:40 -0000
@@ -28,19 +28,19 @@ function system_help($section) {
 ', array('%file-cron' => 'cron.php', '%external-http-drupal-org-cron' => 'http://drupal.org/cron', '%admin-settings' => url('admin/settings/caching')));
       $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%system">System page</a>.', array('%system' => 'http://drupal.org/handbook/modules/system/')) .'</p>';
       return $output;
-    case 'admin/modules#description':
+    case 'admin/settings/modules#description':
       return t('Handles general site configuration for administrators.');
     case 'admin':
-      return t('<p>Welcome to the administration section. Below are the most recent system events.</p>');
-    case 'admin/themes':
+      return t('<p>Welcome to the administration section. Here you may control how your site functions.</p>');
+    case 'admin/build/themes':
       return t('<p>Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternately, to override these settings in a specific theme, click the "configure" link for the corresponding theme. Note that different themes may have different regions available for rendering content like blocks. If you want consistency in what your users see, you may wish to enable only one theme.</p>');
-    case 'admin/themes/settings':
+    case 'admin/build/themes/settings':
       return t('<p>These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.</p>');
-    case 'admin/themes/settings/'. arg(3):
+    case 'admin/build/themes/settings/'. arg(3):
       $reference = explode('.', arg(3), 2);
       $theme = array_pop($reference);
-      return t('<p>These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="%global">global settings</a> for this theme.</p>', array('%template' => $theme, '%global' => url('admin/themes/settings')));
-    case 'admin/modules':
+      return t('<p>These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="%global">global settings</a> for this theme.</p>', array('%template' => $theme, '%global' => url('admin/build/themes/settings')));
+    case 'admin/settings/modules':
       return t('<p>Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new <a href="%permissions">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and checking throttle. The auto-throttle functionality must be enabled on the <a href="%throttle">throttle configuration page</a> after having enabled the throttle module.</p>
 <p>It is important that <a href="%update-php">update.php</a> is run every time a module is updated to a newer version.</p>', array('%permissions' => url('admin/access/permissions'), '%throttle' => url('admin/settings/throttle'), '%update-php' => $base_url .'/update.php'));
   }
@@ -101,87 +101,134 @@ 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);
+    
+    // menu items that are basically just menu blocks
+    $items[] = array(
+      'path' => 'admin/settings', 
+      'title' => t('site configuration'),
+      'description' => t('These tools allow you to adjust basic site configuration options'),
+      'position' => 'right',
+      'weight' => -10,
+      'callback' => 'system_settings_overview',
+      'access' => $access);
+    
+    $items[] = array('path' => 'admin/build', 
+      'title' => t('site building'),
+      'description' => t('Tools to help you build your site'),
+      'position' => 'right',
+      'weight' => -5,
+      'callback' => 'system_admin_menu_block_page',
+      'access' => $access);
+
+    $items[] = array(
+      'path' => 'admin/configure',
+      'title' => t('administration settings'),
+      'description' => t('This block contains settings for how your administrative pages should look'),
+      'position' => 'left',
+      'callback' => 'system_admin_page_settings',
+      'block callback' => 'system_admin_page_settings',
+      'access' => $access);
 
     // Themes:
-    $items[] = array('path' => 'admin/themes', 'title' => t('themes'),
+    $items[] = array(
+      'path' => 'admin/build/themes',
+      'title' => t('site 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/settings', 'title' => t('configure'),
-      'callback' => 'system_theme_settings', 'access' => $access,
+    $items[] = array(
+      'path' => 'admin/build/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/build/themes/settings', 
+      'title' => t('configure'),
+      'callback' => 'system_theme_settings', 
+      'access' => $access,
       'type' => MENU_LOCAL_TASK);
 
     // Theme configuration subtabs
-    $items[] = array('path' => 'admin/themes/settings/global', 'title' => t('global settings'),
+    $items[] = array('path' => 'admin/build/themes/settings/global', 'title' => t('global settings'),
       'callback' => 'system_theme_settings', 'access' => $access,
       'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1);
 
     foreach (list_themes() as $theme) {
       if ($theme->status) {
-        $items[] = array('path' => 'admin/themes/settings/'. $theme->name, 'title' => $theme->name,
+        $items[] = array('path' => 'admin/build/themes/settings/'. $theme->name, 'title' => $theme->name,
         'callback' => 'system_theme_settings', 'callback arguments' => array($theme->name), 'access' => $access,
         'type' => MENU_LOCAL_TASK);
       }
     }
 
     // Modules:
-    $items[] = array('path' => 'admin/modules', 'title' => t('modules'),
-      'callback' => 'system_modules', 'access' => $access);
+    $items[] = array('path' => 'admin/settings/modules', 
+      'title' => t('modules'),
+      'description' => t('Enable or disable add-on modules for your site.'),
+      'weight' => -10,
+      'callback' => 'system_modules', 
+      'access' => $access);
 
     // Settings:
     $items[] = array(
-      'path' => 'admin/settings',
-      'title' => t('settings'),
-      'callback' => 'system_settings_overview',
-      'access' => $access);
-    $items[] = array(
       'path' => 'admin/settings/site-information',
       'title' => t('site information'),
+      'description' => t('Change basic site information, such as the site name, slogan, email address, mission, front page and more.'),
       'callback' => 'system_site_information_settings');
     $items[] = array(
       'path' => 'admin/settings/error-reporting',
       'title' => t('error reporting'),
+      'description' => t('Control how Drupal deals with errors including 403/404 erros as well as PHP error reporting.'),
       'callback' => 'system_error_reporting_settings');
     $items[] = array(
       'path' => 'admin/settings/page-caching',
       'title' => t('page caching'),
+      'description' => t('Enable or disable page caching for anonymous users.'),
       'callback' => 'system_page_caching_settings');
     $items[] = array(
       'path' => 'admin/settings/file-system',
       'title' => t('file system'),
+      'description' => t('Tell Drupal where to store uploaded files and how they are accessed.'),
       'callback' => 'system_file_system_settings');
     $items[] = array(
       'path' => 'admin/settings/image-toolkit',
       'title' => t('image toolkit'),
+      'description' => t('Choose which image toolkit to use if you have installed optional toolkits.'),
       'callback' => 'system_image_toolkit_settings');
     $items[] = array(
       'path' => 'admin/settings/rss-feed',
       'title' => t('RSS feeds'),
+      'description' => t('Settings for to affect RSS feeds Drupal provides.'),
       'callback' => 'system_rss_feeds_settings');
     $items[] = array(
       'path' => 'admin/settings/date-time',
       'title' => t('date and time'),
+      'description' => t('Settings for how Drupal displays date and time, as well as the system\'s default timezone.'),
       'callback' => 'system_date_time_settings');
     $items[] = array(
       'path' => 'admin/settings/site-status',
       'title' => t('site status'),
+      'description' => t('Take the site off-line for maintenance or bring it back online.'),
       'callback' => 'system_site_status_settings');
     $items[] = array(
       'path' => 'admin/settings/unicode',
       'title' => t('unicode'),
+      'description' => t('Unicode string handling settings.'),
       'callback' => 'system_unicode_settings');
     $items[] = array(
       'path' => 'admin/settings/cron-status',
       'title' => t('cron status'),
+      'description' => t('View whether or not cron is running on your site.'),
       'callback' => 'system_cron_status');
     $items[] = array(
       'path' => 'admin/settings/clean-urls',
       'title' => t('clean URLs'),
+      'description' => t('Enable or disable clean URLs for your site.'),
       'callback' => 'system_clean_url_settings');
   }
 
@@ -210,6 +257,89 @@ function system_user($type, $edit, &$use
   }
 }
 
+function system_main_admin_page() {
+  $menu = menu_get_item(NULL, 'admin');
+  usort($menu['children'], '_menu_sort');
+  foreach ($menu['children'] as $mid) {
+    $block = menu_get_item($mid);
+    if ($block['block callback'] && function_exists($block['block callback'])) {
+      $arguments = isset($block['block arguments']) ? $block['block arguments'] : array();
+      $block['content'] .= call_user_func_array($block['block callback'], $arguments);
+    }
+    $block['content'] .= theme('admin_block_content', system_admin_menu_block($block));
+    $blocks[] = $block;
+  }
+
+  return theme('admin_page', $blocks);
+}
+
+function system_admin_menu_block($block) {
+  $content = array();
+  if (is_array($block['children'])) {
+    usort($block['children'], '_menu_sort'); 
+    foreach ($block['children'] as $mid) {
+      $item = menu_get_item($mid);
+      if ($item['type'] & MENU_VISIBLE_IN_TREE) {
+        $content[] = $item;
+      }
+    }
+  }
+  return $content;
+}
+
+function system_admin_menu_block_page() {
+  $menu = menu_get_item(NULL, $_GET['q']);
+  $content = system_admin_menu_block($menu);
+
+  $output = theme('admin_block_content', $content);
+}
+
+/**
+ * This function provides a form to control the settings of the 
+ * administration page.
+ */
+function system_admin_page_settings() {
+  $themes = system_theme_data();
+  ksort($themes);
+  $options[0] = t('System Default');
+  foreach ($themes as $theme) {
+    $options[$theme->name] = $theme->name;
+  }
+
+  $form['admin_theme'] = array(
+    '#type' => 'select',
+    '#options' => $options,
+    '#title' => t('Admin theme'),
+    '#description' => t('Choose which theme the administration pages should display in. If you choose "System Default" the administration pages theme will not be overridden.'),
+    '#default_value' => variable_get('admin_theme', 'bluemarine'),
+  );
+
+  $form['admin_expert_mode'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Expert mode'),
+    '#description' => t('Enable "expert mode" to compact the information on this page.'),
+    '#default_value' => variable_get('admin_expert_mode', FALSE),
+  );
+
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Submit'),
+  );
+  return system_settings_form('system_admin_page_form', $form);
+}
+
+/**
+ * Implementation of hook_init. This hook will set the theme to the
+ * administrative theme if the user is looking at a page in the
+ * admin/* tree.
+ */
+function system_init() {
+  if (arg(0) == 'admin') {
+    global $custom_theme;
+    $custom_theme = variable_get('admin_theme', 'bluemarine');
+  }
+}
+
 /*
  * Returns a fieldset containing the theme select form.
  *
@@ -916,7 +1046,7 @@ function system_themes() {
       $status[] = $info->name;
     }
     if ($info->status && (function_exists($info->prefix . '_settings') || function_exists($info->prefix . '_features'))) {
-      $form[$info->name]['operations'] = array('#type' => 'markup', '#value' => l(t('configure'), 'admin/themes/settings/' . $info->name) );
+      $form[$info->name]['operations'] = array('#type' => 'markup', '#value' => l(t('configure'), 'admin/build/themes/settings/' . $info->name) );
     }
     else {
       // Dummy element for form_render. Cleaner than adding a check in the theme function.
@@ -980,7 +1110,7 @@ function system_themes_submit($form_id, 
 
   menu_rebuild();
   drupal_set_message(t('The configuration options have been saved.'));
-  return 'admin/themes';
+  return 'admin/build/themes';
 }
 
 /**
@@ -999,7 +1129,7 @@ function system_modules() {
     drupal_get_filename('module', $file->name, $file->filename);
     drupal_load('module', $file->name);
 
-    $file->description = module_invoke($file->name, 'help', 'admin/modules#description');
+    $file->description = module_invoke($file->name, 'help', 'admin/settings/modules#description');
 
     $form['name'][$file->name] = array('#value' => $file->name);
     $form['description'][$file->name] = array('#value' => $file->description);
@@ -1115,7 +1245,7 @@ function system_modules_submit($form_id,
   menu_rebuild();
 
   drupal_set_message(t('The configuration options have been saved.'));
-  return 'admin/modules';
+  return 'admin/settings/modules';
 }
 
 
@@ -1124,25 +1254,21 @@ function system_modules_submit($form_id,
  */
 function system_settings_overview() {
 
-    // Check database setup if necessary
-    if (function_exists('db_check_setup') && empty($_POST)) {
-      db_check_setup();
-    }
-
-    $output = '<ul>';
-    $menu = menu_get_item(NULL, 'admin/settings');
-    usort($menu['children'], '_menu_sort');
-    foreach ($menu['children'] as $mid) {
-      $output .= ' <li>'. menu_item_link($mid) .'</li>';
-    }
-    $output .= '</ul>';
-
-    // TODO: remove this:
-    foreach (module_implements('settings') as $module) {
-      drupal_set_message("$module settings inaccessible: module needs updating because the _settings hook has been deprecated.");
-    }
+  // Check database setup if necessary
+  if (function_exists('db_check_setup') && empty($_POST)) {
+    db_check_setup();
+  }
+  
+  $menu = menu_get_item(NULL, 'admin/settings');
+  $content = system_admin_menu_block($menu);
+
+  $output = theme('admin_block_content', $content);
+  // TODO: remove this:
+  foreach (module_implements('settings') as $module) {
+    drupal_set_message("$module settings inaccessible: module needs updating because the _settings hook has been deprecated.");
+  }
 
-    return $output;
+  return $output;
 }
 
 /**
@@ -1376,3 +1502,96 @@ 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 page for viewing.
+ * 
+ * @param $blocks
+ *   An array of blocks to display. Each array should include a
+ *   'title', a 'description', a formatted 'content' and a
+ *   'position' which will control which container it will be
+ *   in. This is usually 'left' or 'right'.
+ * @themeable
+ */
+function theme_admin_page($blocks) {
+  foreach ($blocks as $block) {
+    if ($block_output = theme('admin_block', $block)) {
+      if (!$block['position']) {
+        // perform automatic striping.
+        $block['position'] = $stripe++ % 2 ? 'left' : 'right';
+      }
+      $container[$block['position']] .= $block_output;
+    }
+  }
+  
+  // sort the container
+  $output = '<div class="admin">';
+  foreach ($container as $id => $data) {
+    $output .= '<div class="'. $id .'">';
+    $output .= $data;
+    $output .= '</div>';
+  }
+  $output .= '</div>';
+  return $output;
+}
+
+/**
+ * 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
+  <div class="admin-panel collapsible">
+    <div class="head">
+      $block[title]
+    </div>
+    <div class="body">
+      <div class="desc">
+        $block[description]
+      </div>
+      $block[content]
+    </div>
+  </div>
+EOT;
+  return $output;
+}
+
+/**
+ * This function formats the content of an administrative block.
+ *
+ * @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_content($content) {
+  if (!$content) { 
+    return '';
+  }
+
+  if (variable_get('admin_expert_mode', FALSE)) {
+    $output = '<ul class="menu">';
+    foreach ($content as $item) {
+      $output .= '<li class="leaf">'. l($item['title'], $item['path']) .'</li>';
+    }
+    $output .= '</ul>';
+  }
+  else {
+    $output = '<dl class="admin-list">';
+    foreach ($content as $item) {
+      $output .= '<dt>'. l($item['title'], $item['path']) .'</dt>';
+      $output .= '<dd>'. $item['description'] .'</dd>';
+    }
+    $output .= '</dl>';
+  }
+  return $output;
+}
\ No newline at end of file
