? help-blocks-1.patch
? help-blocks.patch
? includes/password.inc
? includes/passwordhash.inc
? sites/default/files
? sites/default/settings.php
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.418
diff -u -p -r1.418 theme.inc
--- includes/theme.inc	25 Mar 2008 14:10:01 -0000	1.418
+++ includes/theme.inc	1 Apr 2008 02:03:50 -0000
@@ -1172,17 +1172,6 @@ function theme_breadcrumb($breadcrumb) {
 }
 
 /**
- * Return a themed help message.
- *
- * @return a string containing the helptext for the current page.
- */
-function theme_help() {
-  if ($help = menu_get_active_help()) {
-    return '<div class="help">'. $help .'</div>';
-  }
-}
-
-/**
  * Return a themed submenu, typically displayed under the tabs.
  *
  * @param $links
@@ -1752,7 +1741,6 @@ function template_preprocess_page(&$vari
   $variables['feed_icons']        = drupal_get_feeds();
   $variables['footer_message']    = filter_xss_admin(variable_get('site_footer', FALSE));
   $variables['head']              = drupal_get_html_head();
-  $variables['help']              = theme('help');
   $variables['language']          = $GLOBALS['language'];
   $variables['language']->dir     = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
   $variables['logo']              = theme_get_setting('logo');
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.301
diff -u -p -r1.301 block.module
--- modules/block/block.module	21 Mar 2008 08:41:25 -0000	1.301
+++ modules/block/block.module	1 Apr 2008 02:03:51 -0000
@@ -68,7 +68,7 @@ function block_help($path, $arg) {
   switch ($path) {
     case 'admin/help#block':
       $output = '<p>'. t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) .'</p>';
-      $output .= '<p>'. t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@input-format">input format</a>.', array('@input-format' => url('admin/settings/filters'))) .'</p>';
+      $output .= '<p>'. t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block or <em>System help</em> blocks, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@input-format">input format</a>. Some modules may also use custom blocks containing help text and other content to display additional information on specific pages.', array('@input-format' => url('admin/settings/filters'))) .'</p>';
       $output .= '<p>'. t('When working with blocks, remember that:') .'</p>';
       $output .= '<ul><li>'. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .'</li>';
       $output .= '<li>'. t('disabled blocks, or blocks not in a region, are never shown.') .'</li>';
Index: modules/contact/contact.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v
retrieving revision 1.3
diff -u -p -r1.3 contact.admin.inc
--- modules/contact/contact.admin.inc	9 Nov 2007 07:55:13 -0000	1.3
+++ modules/contact/contact.admin.inc	1 Apr 2008 02:03:51 -0000
@@ -152,11 +152,6 @@ function contact_admin_delete_submit($fo
 }
 
 function contact_admin_settings() {
-  $form['contact_form_information'] = array('#type' => 'textarea',
-    '#title' => t('Additional information'),
-    '#default_value' => variable_get('contact_form_information', t('You can leave a message using the contact form below.')),
-    '#description' => t('Information to show on the <a href="@form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('@form' => url('contact'))),
-  );
   $form['contact_hourly_threshold'] = array('#type' => 'select',
     '#title' => t('Hourly threshold'),
     '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.104
diff -u -p -r1.104 contact.module
--- modules/contact/contact.module	20 Feb 2008 13:46:39 -0000	1.104
+++ modules/contact/contact.module	1 Apr 2008 02:03:51 -0000
@@ -15,12 +15,12 @@ function contact_help($path, $arg) {
       $output = '<p>'. t('The contact module facilitates communication via e-mail, by allowing your site\'s visitors to contact one another (personal contact forms), and by providing a simple way to direct messages to a set of administrator-defined recipients (the <a href="@contact">contact page</a>). With either form, users specify a subject, write their message, and (optionally) have a copy of their message sent to their own e-mail address.', array('@contact' => url('contact'))) .'</p>';
       $output .= '<p>'. t("Personal contact forms allow users to be contacted via e-mail, while keeping recipient e-mail addresses private. Users may enable or disable their personal contact forms by editing their <em>My account</em> page. If enabled, a <em>Contact</em> tab leading to their personal contact form is available on their user profile. Site administrators have access to all personal contact forms (even if they have been disabled). The <em>Contact</em> tab is only visible when viewing another user's profile (users do not see their own <em>Contact</em> tab).") .'</p>';
       $output .= '<p>'. t('The <a href="@contact">contact page</a> provides a simple form for visitors to leave comments, feedback, or other requests. Messages are routed by selecting a category from a list of administrator-defined options; each category has its own set of e-mail recipients. Common categories for a business site include, for example, "Website feedback" (messages are forwarded to web site administrators) and "Product information" (messages are forwarded to members of the sales department). The actual e-mail addresses defined within a category are not displayed. Only users in roles with the <em>access site-wide contact form</em> permission may access the <a href="@contact">contact page</a>.', array('@contact' => url('contact'))) .'</p>';
-      $output .= '<p>'. t('A link to your site\'s <a href="@contact">contact page</a> from the main <em>Navigation</em> menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact"', array('@contact' => url('contact'))) .'</p>';
-      $output .= '<p>'. t('Customize the <a href="@contact">contact page</a> with additional information (like physical location, mailing address, and telephone number) using the <a href="@contact-settings">contact form settings page</a>. The <a href="@contact-settings">settings page</a> also provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'), '@contact' => url('contact'))) .'</p>';
+      $output .= '<p>'. t('A link to your site\'s <a href="@contact">contact page</a> from the main <em>Navigation</em> menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact". Provide additional information, like physical location, mailing address, and telephone number, on the <a href="@contact">contact page</a> by editing the block <em>Contact page help</em> via the <a href="@blocks-administration">blocks administration page</a>. By default, the <em>Contact page help</em> block is only displayed on the <a href="@contact">contact page</a>.', array('@contact' => url('contact'), '@blocks-administration' => url('admin/build/block'))) .'</p>';
+      $output .= '<p>'. t('The <a href="@contact-settings">contact form settings page</a> provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'))) .'</p>';
       $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) .'</p>';
       return $output;
     case 'admin/build/contact':
-      $output = '<p>'. t('This page lets you set up <a href="@form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="@settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) .'</p>';
+      $output = '<p>'. t('This page lets you set up <a href="@form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="@settings">settings page</a>, you can customize your site\'s e-mail threshold limits and determine the default state of user\'s personal contact forms. Additional contact information such as your postal address and telephone number may be provided by editing the <em>Contact page help</em> block via the <a href="@blocks-administration">blocks administration page</a>.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'), '@blocks-administration' => url('admin/build/block'))) .'</p>';
       if (!module_exists('menu')) {
         $menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="@modules-page">enabled</a>.', array('@modules-page' => url('admin/settings/modules')));
       }
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.8
diff -u -p -r1.8 contact.pages.inc
--- modules/contact/contact.pages.inc	25 Mar 2008 14:07:34 -0000	1.8
+++ modules/contact/contact.pages.inc	1 Apr 2008 02:03:51 -0000
@@ -38,7 +38,6 @@ function contact_mail_page() {
 
   if (count($categories) > 0) {
     $form['#token'] = $user->uid ? $user->name . $user->mail : '';
-    $form['contact_information'] = array('#value' => filter_xss_admin(variable_get('contact_form_information', t('You can leave a message using the contact form below.'))));
     $form['name'] = array('#type' => 'textfield',
       '#title' => t('Your name'),
       '#maxlength' => 255,
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.244
diff -u -p -r1.244 system.install
--- modules/system/system.install	21 Mar 2008 08:52:25 -0000	1.244
+++ modules/system/system.install	1 Apr 2008 02:03:53 -0000
@@ -376,6 +376,7 @@ function system_install() {
   db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 1, 'theme', 'garland');
   db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '0', 'garland', 1, 0, 'left', '', -1);
   db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', '1', 'garland', 1, 0, 'left', '', -1);
+  db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'help', 'garland', 1, 0, 'help', '', 1);
   db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', '0', 'garland', 1, 10, 'footer', '', -1);
 
   db_query("INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'all', 1, 0, 0);
@@ -2668,10 +2669,33 @@ function system_update_7001() {
   return $ret;
 }
 
+/**
+ * Add help block to the help region, migrate custom variables to blocks.
+ */
+function system_update_7002() {
+  $ret = array();
+  
+  // Migrate contact form information and user register help to blocks.
+  $bid_max = db_query("SELECT MAX(bid) FROM boxes");
+  if ($contact_help = variable_get('contact_form_information', '')) {
+    db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $contact_help, 'Contact page help', FILTER_FORMAT_DEFAULT);
+  }
+  if ($user_help = variable_get('user_registration_help', '')) {
+    db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $user_help, 'User registration help', FILTER_FORMAT_DEFAULT);
+  }
+
+  foreach (list_themes() as $theme) {
+    // Add new system generated help block.
+    $ret[] = update_sql("INSERT INTO {blocks} (module, delta, theme, status, weight, region, pages, cache) VALUES ('system', 'help', '". $theme->name ."', 1, 0, 'help', '', 1)");
+    // Add contact help block.
+    $ret[] = update_sql("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '". ($bid_max + 1) ."', '". $theme->name ."', 1, 5, 'help', 1, 'contact', -1)");
+    // Add user registration help block.
+    $ret[] = update_sql("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '". ($bid_max + 2) ."', '". $theme->name ."', 1, 10, 'help', 1, 'user/register', -1)");
+  }
+  return $ret;
+}
 
 /**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
-
-
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.593
diff -u -p -r1.593 system.module
--- modules/system/system.module	11 Mar 2008 08:13:14 -0000	1.593
+++ modules/system/system.module	1 Apr 2008 02:03:55 -0000
@@ -575,42 +575,65 @@ function system_user($type, $edit, &$use
 /**
  * Implementation of hook_block().
  *
- * Generate a block with a promotional link to Drupal.org.
+ * Generate a block with a promotional link to Drupal.org and a block with page-specific system help.
  */
 function system_block($op = 'list', $delta = 0, $edit = NULL) {
-  switch ($op) {
-    case 'list':
-      $blocks[0] = array(
+  if ($op == 'list') {
+    return array(
+      0 => array(
         'info' => t('Powered by Drupal'),
         'weight' => '10',
          // Not worth caching.
         'cache' => BLOCK_NO_CACHE,
-      );
-      return $blocks;
-    case 'configure':
-      // Compile a list of fields to show
-      $form['wrapper']['color'] = array(
-        '#type' => 'select',
-        '#title' => t('Badge color'),
-        '#default_value' => variable_get('drupal_badge_color', 'powered-blue'),
-        '#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')),
-      );
-      $form['wrapper']['size'] = array(
-        '#type' => 'select',
-        '#title' => t('Badge size'),
-        '#default_value' => variable_get('drupal_badge_size', '80x15'),
-        '#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')),
-      );
-      return $form;
-    case 'save':
-      variable_set('drupal_badge_color', $edit['color']);
-      variable_set('drupal_badge_size', $edit['size']);
+      ),
+      'help' => array(
+        'info' => t('Page-specific system help'),
+        'weight' => '5',
+      ),
+    );
+  }
+  
+  switch ($delta) {
+    case 'help':
+      if ($op == 'view') {
+        return array(
+          'subject' => NULL, // Don't display a title.
+          'content' => menu_get_active_help(),
+        );
+      }
+      break;
+
+    case 0:
+      switch ($op) {
+        case 'configure':
+          // Compile a list of fields to show.
+          $form['wrapper']['color'] = array(
+            '#type' => 'select',
+            '#title' => t('Badge color'),
+            '#default_value' => variable_get('drupal_badge_color', 'powered-blue'),
+            '#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')),
+          );
+          $form['wrapper']['size'] = array(
+            '#type' => 'select',
+            '#title' => t('Badge size'),
+            '#default_value' => variable_get('drupal_badge_size', '80x15'),
+            '#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')),
+          );
+          return $form;
+          break;
+        case 'save':
+          variable_set('drupal_badge_color', $edit['color']);
+          variable_set('drupal_badge_size', $edit['size']);
+          break;
+        case 'view':
+          $image_path = 'misc/'. variable_get('drupal_badge_color', 'powered-blue') .'-'. variable_get('drupal_badge_size', '80x15') .'.png';
+          return array(
+            'subject' => NULL, // Don't display a title.
+            'content' => theme('system_powered_by', $image_path),
+          );
+      }
       break;
-    case 'view':
-      $image_path = 'misc/'. variable_get('drupal_badge_color', 'powered-blue') .'-'. variable_get('drupal_badge_size', '80x15') .'.png';
-      $block['subject'] = NULL; // Don't display a title
-      $block['content'] = theme('system_powered_by', $image_path);
-      return $block;
+
   }
 }
 
@@ -775,6 +798,7 @@ function system_theme_default() {
       'content' => 'Content',
       'header' => 'Header',
       'footer' => 'Footer',
+      'help' => 'Help',
     ),
     'description' => '',
     'features' => array(
Index: modules/user/user.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v
retrieving revision 1.19
diff -u -p -r1.19 user.admin.inc
--- modules/user/user.admin.inc	20 Feb 2008 13:46:43 -0000	1.19
+++ modules/user/user.admin.inc	1 Apr 2008 02:03:56 -0000
@@ -230,10 +230,13 @@ function user_admin_account_validate($fo
  */
 function user_admin_settings() {
   // User registration settings.
-  $form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings'));
+  $form['registration'] = array(
+    '#type' => 'fieldset', 
+    '#title' => t('User registration settings'),
+    '#description' => t('The following options determine if, and how, new users can register at your site. If your site allows user registrations, you may wish to provide additional information specific to your site to prospective members. The block <em>User registration help</em> is provided for this purpose, and may be edited via the <a href="@blocks-administration">blocks administration page</a>. By default, the <em>User registration help</em> block is only displayed on the <a href="@user-registration">user registration page</a>.', array('@blocks-administration' => url('admin/build/block'), '@user-registration' => url('user/register'))),
+  );
   $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.')));
   $form['registration']['user_email_verification'] = array('#type' => 'checkbox', '#title' => t('Require e-mail verification when a visitor creates an account'), '#default_value' => variable_get('user_email_verification', TRUE), '#description' => t('If this box is checked, new users will be required to validate their e-mail address prior to logging into the site, and will be assigned a system-generated password. With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration.'));
-  $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form and is useful for helping or instructing your users.'));
 
   // User e-mail settings.
   $form['email'] = array(
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.898
diff -u -p -r1.898 user.module
--- modules/user/user.module	31 Mar 2008 20:50:05 -0000	1.898
+++ modules/user/user.module	1 Apr 2008 02:03:57 -0000
@@ -1846,6 +1846,7 @@ function user_help($path, $arg) {
       $output = '<p>'. t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles <em>anonymous</em> - a user who has not logged in, and <em>authenticated</em> a user who has signed up and who has been authorized.') .'</p>';
       $output .= '<p>'. t("Users can use their own name or handle and can specify personal configuration settings through their individual <em>My account</em> page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") .'</p>';
       $output .= '<p>'. t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') .'</p>';
+      $output .= '<p>'. t('If your site allows user registrations, you may wish to provide additional information specific to your site to prospective members. The block <em>User registration help</em> is provided for this purpose, and may be edited via the <a href="@blocks-administration">blocks administration page</a>. By default, the <em>User registration help</em> block is only displayed on the <a href="@user-registration">user registration page</a>.', array('@blocks-administration' => url('admin/build/block'), '@user-registration' => url('user/register'))) .'</p>';
       $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) .'</p>';
       return $output;
     case 'admin/user/user':
@@ -2344,11 +2345,6 @@ function user_register() {
 
   $form = array();
 
-  // Display the registration form.
-  if (!$admin) {
-    $form['user_registration_help'] = array('#value' => filter_xss_admin(variable_get('user_registration_help', '')));
-  }
-
   // Merge in the default user edit fields.
   $form = array_merge($form, user_edit_form($form_state, NULL, NULL, TRUE));
   if ($admin) {
