? 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 '
'. 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 blocks administration page 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'))) .'
'; - $output .= ''. t('Although blocks are usually generated automatically by modules (like the User login 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 input format.', array('@input-format' => url('admin/settings/filters'))) .'
'; + $output .= ''. t('Although blocks are usually generated automatically by modules (like the User login block or System help 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 input format. 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'))) .'
'; $output .= ''. t('When working with blocks, remember that:') .'
'; $output .= ''. 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 contact page). 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'))) .'
'; $output .= ''. 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 My account page. If enabled, a Contact 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 Contact tab is only visible when viewing another user's profile (users do not see their own Contact tab).") .'
'; $output .= ''. t('The contact page 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 access site-wide contact form permission may access the contact page.', array('@contact' => url('contact'))) .'
'; - $output .= ''. t('A link to your site\'s contact page from the main Navigation 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'))) .'
'; - $output .= ''. t('Customize the contact page with additional information (like physical location, mailing address, and telephone number) using the contact form settings page. The settings page 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'))) .'
'; + $output .= ''. t('A link to your site\'s contact page from the main Navigation 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 contact page by editing the block Contact page help via the blocks administration page. By default, the Contact page help block is only displayed on the contact page.', array('@contact' => url('contact'), '@blocks-administration' => url('admin/build/block'))) .'
'; + $output .= ''. t('The contact form settings page 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'))) .'
'; $output .= ''. t('For more information, see the online handbook entry for Contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) .'
'; return $output; case 'admin/build/contact': - $output = ''. t('This page lets you set up your site-wide contact form. 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 settings page, 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'))) .'
'; + $output = ''. t('This page lets you set up your site-wide contact form. 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 settings page, 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 Contact page help block via the blocks administration page.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'), '@blocks-administration' => url('admin/build/block'))) .'
'; if (!module_exists('menu')) { $menu_note = t('The menu item can be customized and configured only once the menu module has been enabled.', 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 User registration help is provided for this purpose, and may be edited via the blocks administration page. By default, the User registration help block is only displayed on the user registration page.', 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 = ''. 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 anonymous - a user who has not logged in, and authenticated a user who has signed up and who has been authorized.') .'
'; $output .= ''. t("Users can use their own name or handle and can specify personal configuration settings through their individual My account 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.") .'
'; $output .= ''. 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.') .'
'; + $output .= ''. t('If your site allows user registrations, you may wish to provide additional information specific to your site to prospective members. The block User registration help is provided for this purpose, and may be edited via the blocks administration page. By default, the User registration help block is only displayed on the user registration page.', array('@blocks-administration' => url('admin/build/block'), '@user-registration' => url('user/register'))) .'
'; $output .= ''. t('For more information, see the online handbook entry for User module.', array('@user' => 'http://drupal.org/handbook/modules/user/')) .'
'; 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) {