'+ Drupal.settings.cleanURL.testing +"
");
$("#clean-url.install").css("display", "block");
+ // Submit a synchronous request to avoid database errors associated with
+ // concurrent requests during install.
$.ajax({
+ async: false,
url: url,
dataType: 'json',
success: function () {
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.638
diff -u -p -r1.638 system.module
--- modules/system/system.module 15 Nov 2008 08:23:07 -0000 1.638
+++ modules/system/system.module 17 Nov 2008 00:09:27 -0000
@@ -42,6 +42,21 @@ define('DRUPAL_MINIMUM_PGSQL', '8.1');
define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600);
/**
+ * New users will be set to the default time zone at registration.
+ */
+define('DRUPAL_USER_TIMEZONE_DEFAULT', 0);
+
+/**
+ * New users will get an empty time zone at registration.
+ */
+define('DRUPAL_USER_TIMEZONE_EMPTY', 1);
+
+/**
+ * New users will select their own timezone at registration.
+ */
+define('DRUPAL_USER_TIMEZONE_SELECT', 2);
+
+/**
* Implementation of hook_help().
*/
function system_help($path, $arg) {
@@ -356,6 +371,12 @@ function system_menu() {
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
+ $items['system/timezone'] = array(
+ 'title' => 'Time zone',
+ 'page callback' => 'system_timezone',
+ 'access callback' => TRUE,
+ 'type' => MENU_CALLBACK,
+ );
$items['admin'] = array(
'title' => 'Administer',
'access arguments' => array('access administration pages'),
@@ -591,7 +612,7 @@ function system_menu() {
);
$items['admin/settings/date-time'] = array(
'title' => 'Date and time',
- 'description' => "Settings for how Drupal displays date and time, as well as the system's default timezone.",
+ 'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.",
'page callback' => 'drupal_get_form',
'page arguments' => array('system_date_time_settings'),
'access arguments' => array('administer site configuration'),
@@ -736,29 +757,68 @@ function system_preprocess_page(&$variab
function system_user_form(&$edit, &$user, $category = NULL) {
if ($category == 'account') {
$form['theme_select'] = system_theme_select_form(t('Selecting a different theme will change the look and feel of the site.'), isset($edit['theme']) ? $edit['theme'] : NULL, 2);
-
if (variable_get('configurable_timezones', 1)) {
- $zones = _system_zonelist();
+ system_user_timezone($edit, $form);
+ }
+ return $form;
+ }
+}
+
+/**
+ * Implementation of hook_user_register().
+ */
+function system_user_register(&$edit, &$user, $category = NULL) {
+ if (variable_get('configurable_timezones', 1)) {
+ $form = array();
+ if (variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT) == DRUPAL_USER_TIMEZONE_SELECT) {
+ system_user_timezone($edit, $form);
+ }
+ else {
$form['timezone'] = array(
- '#type' => 'fieldset',
- '#title' => t('Locale settings'),
- '#weight' => 6,
- '#collapsible' => TRUE,
- );
- $form['timezone']['timezone'] = array(
- '#type' => 'select',
- '#title' => t('Time zone'),
- '#default_value' => strlen($edit['timezone']) ? $edit['timezone'] : variable_get('date_default_timezone', 0),
- '#options' => $zones,
- '#description' => t('Select your current local time. Dates and times throughout this site will be displayed using this time zone.'),
+ '#type' => 'hidden',
+ '#value' => variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT) ? '' : variable_get('date_default_timezone', ''),
);
}
-
return $form;
}
}
/**
+ * Implementation of hook_user_login().
+ */
+function system_user_login(&$edit, &$user, $category = NULL) {
+ // If the user has a NULL time zone, notify them to set a time zone.
+ if (!$user->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
+ drupal_set_message(t('Please configure your