Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.479
diff -u -p -r1.479 theme.inc
--- includes/theme.inc	26 Apr 2009 09:14:31 -0000	1.479
+++ includes/theme.inc	28 Apr 2009 12:12:14 -0000
@@ -1238,17 +1238,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
@@ -1859,7 +1848,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/contact/contact.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v
retrieving revision 1.9
diff -u -p -r1.9 contact.admin.inc
--- modules/contact/contact.admin.inc	25 Mar 2009 13:45:00 -0000	1.9
+++ modules/contact/contact.admin.inc	28 Apr 2009 12:12:14 -0000
@@ -164,11 +164,6 @@ function contact_admin_delete_submit($fo
 }
 
 function contact_admin_settings() {
-  $form['contact_form_information'] = array('#type' => 'textarea',
-    '#title' => t('Additional information'),
-    '#default_value' => 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.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.18
diff -u -p -r1.18 contact.pages.inc
--- modules/contact/contact.pages.inc	26 Apr 2009 20:09:12 -0000	1.18
+++ modules/contact/contact.pages.inc	28 Apr 2009 12:12:14 -0000
@@ -47,9 +47,6 @@ function contact_mail_page() {
   }
 
   $form['#token'] = $user->uid ? $user->name . $user->mail : '';
-  $form['contact_information'] = array(
-    '#markup' => 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'),
Index: modules/contact/contact.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v
retrieving revision 1.19
diff -u -p -r1.19 contact.test
--- modules/contact/contact.test	21 Apr 2009 09:27:52 -0000	1.19
+++ modules/contact/contact.test	28 Apr 2009 12:12:14 -0000
@@ -27,8 +27,6 @@ class ContactSitewideTestCase extends Dr
 
     // Set settings.
     $edit = array();
-    $contact_form_information = $this->randomName(100);
-    $edit['contact_form_information'] = $contact_form_information;
     $edit['contact_hourly_threshold'] = 3;
     $edit['contact_default_status'] = TRUE;
     $this->drupalPost('admin/build/contact/settings', $edit, t('Save configuration'));
@@ -82,7 +80,7 @@ class ContactSitewideTestCase extends Dr
     $this->setPermission('anonymous user', array('access site-wide contact form' => TRUE));
     $this->drupalLogout();
     $this->drupalGet('contact');
-    $this->assertText($contact_form_information, t('Contact form is shown when there is one category.'));
+    $this->assertText(t('Contact'), t('Contact form is shown when there is one category.'));
     $this->assertNoText(t('Category'), t('When there is only one category, the category selection element is hidden.'));
     $this->drupalLogin($admin_user);
 
@@ -113,9 +111,6 @@ class ContactSitewideTestCase extends Dr
     $this->drupalGet('contact');
     $this->assertResponse(200, t('Access granted to anonymous user with permission.'));
 
-    // Check that "Additional information" is displayed on the page.
-    $this->assertText($edit['contact_form_information'], t('Contact information displayed.'));
-
     // Submit contact form with invalid values.
     $this->submitContact('', $recipients[0], $this->randomName(16), $categories[0], $this->randomName(64));
     $this->assertText(t('Your name field is required.'), t('Name required.'));
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.317
diff -u -p -r1.317 system.install
--- modules/system/system.install	26 Apr 2009 14:57:36 -0000	1.317
+++ modules/system/system.install	28 Apr 2009 12:12:14 -0000
@@ -3255,6 +3255,50 @@ function system_update_7020() {
 }
 
 /**
+ * Add help block to the help region, migrate custom variables to blocks.
+ */
+function system_update_7021() {
+  $ret = array();
+  
+  // Collect a list of themes with blocks.
+  $themes_with_blocks = array();
+  $result = db_query("SELECT s.name FROM {system} s INNER JOIN {block} b ON s.name = b.theme WHERE s.type = 'theme' GROUP by s.name");
+  foreach ($result as $theme) {
+    $themes_with_blocks[] = $theme->name;
+    // Add new system generated help block.
+    $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('system', 'help', '". $theme->name ."', 1, 0, 'help', '', 1)");
+  }
+
+  // Migrate contact form information and user register help to blocks.
+  $bid_max = db_query("SELECT MAX(bid) FROM {box}")->fetchField();
+  if ($contact_help = variable_get('contact_form_information', '')) {
+    db_insert('box')->fields(array('body' => $contact_help, 'info' => 'Contact page help', 'format' => FILTER_FORMAT_DEFAULT))->execute();
+    foreach ($themes_with_blocks as $theme) {
+      // Add contact help block for themes, which had blocks.
+      $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '". ($bid_max + 1) ."', '". $theme ."', 1, 5, 'help', 1, 'contact', -1)");
+    }
+    drupal_set_message('The contact form information setting was migrated to <a href="'. url('admin/build/block/configure/block/' . ($bid_max + 1)) . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
+  }
+  if ($user_help = variable_get('user_registration_help', '')) {
+    db_insert('box')->fields(array('body' => $user_help, 'info' => 'User registration guidelines', 'format' => FILTER_FORMAT_DEFAULT))->execute();
+    foreach ($themes_with_blocks as $theme) {
+      // Add user registration help block for themes, which had blocks.
+      $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, visibility, pages, cache) VALUES ('block', '". ($bid_max + 2) ."', '". $theme ."', 1, 5, 'help', 1, 'user/register', -1)");
+    }
+    drupal_set_message('The user registration guidelines were migrated to <a href="'. url('admin/build/block/configure/block/' . ($bid_max + 2)) . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Please check the block and ensure that the output is right.');
+  }
+  // Remove the two variables (even if they were saved empty on the admin interface),
+  // to avoid keeping clutter in the variables table.
+  variable_del('contact_form_information');
+  variable_del('user_registration_help');
+  
+  // Rebuild theme data, so the new 'help' region is identified.
+  system_theme_data();
+
+  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.687
diff -u -p -r1.687 system.module
--- modules/system/system.module	26 Apr 2009 19:44:39 -0000	1.687
+++ modules/system/system.module	28 Apr 2009 12:12:14 -0000
@@ -895,6 +895,10 @@ function system_block_list() {
      // Not worth caching.
     'cache' => BLOCK_NO_CACHE,
   );
+  $blocks['help'] = array(
+   'info' => t('System help'),
+   'weight' => '5',
+  );
   // System-defined menu blocks.
   foreach (menu_list_system_menus() as $menu_name => $title) {
     $blocks[$menu_name]['info'] = t($title);
@@ -960,6 +964,13 @@ function system_block_view($delta = '') 
       $block['subject'] = NULL;
       $block['content'] = theme('system_powered_by', $image_path);
       return $block;
+    case 'help':
+      return array(
+        // Don't display a title.
+        'subject' => NULL, 
+        'content' => menu_get_active_help(),
+      );
+      break;
     default:
       // All system menu blocks.
       $system_menus = menu_list_system_menus();
@@ -1121,6 +1132,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.43
diff -u -p -r1.43 user.admin.inc
--- modules/user/user.admin.inc	26 Apr 2009 19:44:40 -0000	1.43
+++ modules/user/user.admin.inc	28 Apr 2009 12:12:14 -0000
@@ -242,7 +242,6 @@ function user_admin_settings() {
   $form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings'));
   $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.'));
 
   // Account cancellation settings.
   module_load_include('inc', 'user', 'user.pages');
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.980
diff -u -p -r1.980 user.module
--- modules/user/user.module	26 Apr 2009 09:53:50 -0000	1.980
+++ modules/user/user.module	28 Apr 2009 12:12:14 -0000
@@ -2850,11 +2850,6 @@ function user_register() {
 
   $form = array();
 
-  // Display the registration form.
-  if (!$admin) {
-    $form['user_registration_help'] = array('#markup' => 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) {
Index: profiles/default/default.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/default/default.profile,v
retrieving revision 1.39
diff -u -p -r1.39 default.profile
--- profiles/default/default.profile	20 Mar 2009 19:18:11 -0000	1.39
+++ profiles/default/default.profile	28 Apr 2009 12:12:14 -0000
@@ -91,11 +91,64 @@ function default_profile_task_list() {
  */
 function default_profile_tasks(&$task, $url) {
   
-  // Enable 4 standard blocks.
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1);
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'navigation', 'garland', 1, 0, 'left', '', -1);
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'management', 'garland', 1, 1, 'left', '', -1);
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'powered-by', 'garland', 1, 10, 'footer', '', -1);
+  // Enable 5 standard blocks.
+  $values = array(
+    array(
+      'module' => 'user',
+      'delta' => 'login',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'navigation',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'management',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 1,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'powered-by',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 10,
+      'region' => 'footer',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'help',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'help',
+      'pages' => '',
+      'cache' => -1
+    ),
+  );
+  $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
+  foreach ($values as $record) {
+    $query->values($record);
+  }
+  $query->execute();  
 
   // Insert default user-defined node types into the database. For a complete
   // list of available node type attributes, refer to the node type API
Index: profiles/expert/expert.profile
===================================================================
RCS file: /cvs/drupal/drupal/profiles/expert/expert.profile,v
retrieving revision 1.5
diff -u -p -r1.5 expert.profile
--- profiles/expert/expert.profile	20 Mar 2009 19:18:11 -0000	1.5
+++ profiles/expert/expert.profile	28 Apr 2009 12:12:14 -0000
@@ -42,10 +42,54 @@ function expert_profile_task_list() {
  * Perform any final installation tasks for this profile.
  */
 function expert_profile_tasks(&$task, $url) {
-  // Enable 3 standard blocks.
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'user', 'login', 'garland', 1, 0, 'left', '', -1);
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'navigation', 'garland', 1, 0, 'left', '', -1);
-  db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'management', 'garland', 1, 1, 'left', '', -1);
+  // Enable 4 standard blocks.
+  $values = array(
+    array(
+      'module' => 'user',
+      'delta' => 'login',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'navigation',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'management',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 1,
+      'region' => 'left',
+      'pages' => '',
+      'cache' => -1
+    ),
+    array(
+      'module' => 'system',
+      'delta' => 'help',
+      'theme' => 'garland',
+      'status' => 1,
+      'weight' => 0,
+      'region' => 'help',
+      'pages' => '',
+      'cache' => -1
+    ),
+  );
+  $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
+  foreach ($values as $record) {
+    $query->values($record);
+  }
+  $query->execute();  
 }
 
 /**
