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 31 Mar 2008 15:13:31 -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 '
'. $help .'
';
- }
-}
-
-/**
* 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/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 31 Mar 2008 15:13:31 -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 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.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 31 Mar 2008 15:13:31 -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 31 Mar 2008 15:13:46 -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 31 Mar 2008 15:13:46 -0000
@@ -578,39 +578,62 @@ function system_user($type, $edit, &$use
* Generate a block with a promotional link to Drupal.org.
*/
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('System generated help for page'),
+ '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 31 Mar 2008 15:13:47 -0000
@@ -233,7 +233,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.'));
// 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.897
diff -u -p -r1.897 user.module
--- modules/user/user.module 19 Mar 2008 07:35:15 -0000 1.897
+++ modules/user/user.module 31 Mar 2008 15:13:49 -0000
@@ -2324,11 +2324,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) {