summaryrefslogtreecommitdiff
path: root/modules/system.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system.module')
-rw-r--r--modules/system.module27
1 files changed, 15 insertions, 12 deletions
diff --git a/modules/system.module b/modules/system.module
index 9d8bec987..265ae2b85 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -105,18 +105,24 @@ function system_user($type, $edit, &$user, $category = NULL) {
}
if (variable_get('configurable_timezones', 1)) {
- $timestamp = time();
- $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
- foreach ($zonelist as $offset) {
- $zone = $offset * 3600;
- $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
- }
+ $zones = _system_zonelist();
$data[] = array('title' => t('Locale settings'), 'data' => form_select(t('Time zone'), 'timezone', $edit['timezone'], $zones, t('Select what time you currently have and your time zone settings will be set appropriately.')), 'weight' => 2);
}
return $data;
}
}
+function _system_zonelist() {
+ $timestamp = time();
+ $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
+ $zones = array();
+ foreach ($zonelist as $offset) {
+ $zone = $offset * 3600;
+ $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
+ }
+ return $zones;
+}
+
function system_view_general() {
global $conf;
@@ -161,12 +167,7 @@ function system_view_general() {
$output .= form_group(t('File system settings'), $group);
// date settings:
- $timestamp = time();
- $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
- foreach ($zonelist as $offset) {
- $zone = $offset * 3600;
- $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') . ' O', $zone);
- }
+ $zones = _system_zonelist();
// date settings: possible date formats
$dateshort = array('m/d/Y - H:i', 'd/m/Y - H:i', 'Y/m/d - H:i',
@@ -304,6 +305,7 @@ function system_listing_save($edit = array()) {
cache_clear_all();
drupal_set_message(t('the configuration options have been saved.'));
+ drupal_goto($_GET['q']);
}
}
@@ -335,6 +337,7 @@ function system_settings_save() {
}
cache_clear_all();
+ drupal_goto($_GET['q']);
}
/**