Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.474 diff -u -p -r1.474 theme.inc --- includes/theme.inc 15 Apr 2009 23:49:06 -0000 1.474 +++ includes/theme.inc 17 Apr 2009 11:44:40 -0000 @@ -1237,17 +1237,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 '
' . $help . '
'; - } -} - -/** * Return a themed submenu, typically displayed under the tabs. * * @param $links @@ -1869,7 +1858,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 17 Apr 2009 11:44:40 -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 contact page. 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.16 diff -u -p -r1.16 contact.pages.inc --- modules/contact/contact.pages.inc 8 Mar 2009 05:08:22 -0000 1.16 +++ modules/contact/contact.pages.inc 17 Apr 2009 11:44:40 -0000 @@ -43,7 +43,6 @@ function contact_mail_page() { if (count($categories) > 0) { $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'), '#maxlength' => 255, Index: modules/contact/contact.test =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v retrieving revision 1.17 diff -u -p -r1.17 contact.test --- modules/contact/contact.test 5 Apr 2009 12:10:56 -0000 1.17 +++ modules/contact/contact.test 17 Apr 2009 11:44:40 -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')); @@ -76,7 +74,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); @@ -107,9 +105,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.314 diff -u -p -r1.314 system.install --- modules/system/system.install 3 Apr 2009 17:50:21 -0000 1.314 +++ modules/system/system.install 17 Apr 2009 11:44:40 -0000 @@ -3263,6 +3263,32 @@ function system_update_7020() { } /** + * Add help block to the help region, migrate custom variables to blocks. + */ +function system_update_7021() { + $ret = array(); + + // Migrate contact form information and user register help to blocks. + $bid_max = db_query("SELECT MAX(bid) FROM {box}"); + if ($contact_help = variable_get('contact_form_information', '')) { + db_query("INSERT INTO {box} (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 {box} (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 {block} (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 {block} (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 {block} (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.679 diff -u -p -r1.679 system.module --- modules/system/system.module 15 Apr 2009 23:49:08 -0000 1.679 +++ modules/system/system.module 17 Apr 2009 11:44:40 -0000 @@ -895,6 +895,10 @@ function system_block_list() { // Not worth caching. 'cache' => BLOCK_NO_CACHE, ); + $blocks['help'] = array( + 'info' => t('System generated help for page'), + 'weight' => '5', + ); // System-defined menu blocks. foreach (menu_list_system_menus() as $menu_name => $title) { $blocks[$menu_name]['info'] = t($title); @@ -960,6 +964,12 @@ function system_block_view($delta = '') $block['subject'] = NULL; $block['content'] = theme('system_powered_by', $image_path); return $block; + case 'help': + return array( + 'subject' => NULL, // Don't display a title + 'content' => menu_get_active_help(), + ); + break; default: // All system menu blocks. $system_menus = menu_list_system_menus(); @@ -1121,6 +1131,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.41 diff -u -p -r1.41 user.admin.inc --- modules/user/user.admin.inc 13 Apr 2009 12:14:57 -0000 1.41 +++ modules/user/user.admin.inc 17 Apr 2009 11:44:40 -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.974 diff -u -p -r1.974 user.module --- modules/user/user.module 13 Apr 2009 12:14:57 -0000 1.974 +++ modules/user/user.module 17 Apr 2009 11:44:40 -0000 @@ -2846,11 +2846,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 17 Apr 2009 11:44:40 -0000 @@ -91,11 +91,12 @@ function default_profile_task_list() { */ function default_profile_tasks(&$task, $url) { - // Enable 4 standard blocks. + // Enable 5 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); + db_query("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', '%s', %d)", 'system', 'help', 'garland', 1, 0, 'help', '', -1); // 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 17 Apr 2009 11:44:40 -0000 @@ -42,10 +42,11 @@ function expert_profile_task_list() { * Perform any final installation tasks for this profile. */ function expert_profile_tasks(&$task, $url) { - // Enable 3 standard blocks. + // 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', 'help', 'garland', 1, 0, 'help', '', -1); } /**