summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-04-27 18:08:04 +0000
committerDries Buytaert <dries@buytaert.net>2004-04-27 18:08:04 +0000
commita2da46a10ae2eaaddedf4fdf71461bfec4d24d25 (patch)
tree5fe5d7a44bca9195e70711ca3e243f3b7752cb41
parent278c2d52e971687c578246de68120ac2fbe90266 (diff)
downloadbrdo-a2da46a10ae2eaaddedf4fdf71461bfec4d24d25.tar.gz
brdo-a2da46a10ae2eaaddedf4fdf71461bfec4d24d25.tar.bz2
- Patch #7416 by Stefan: added sitewide timezone support.
-rw-r--r--modules/system.module17
-rw-r--r--modules/system/system.module17
2 files changed, 20 insertions, 14 deletions
diff --git a/modules/system.module b/modules/system.module
index a76242a59..9d1736dbc 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -88,14 +88,16 @@ function system_user($type, $edit, &$user) {
$data[t('Theme settings')] = form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
}
- $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);
+ if (variable_get("sitewide_timezone", 0)) {
+ $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);
+ }
+ $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
+ return $data;
}
- $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
- return $data;
}
else if ($type == 'view') {
// do nothing
@@ -171,6 +173,7 @@ function system_view_general() {
}
$group = form_select(t("Time zone"), "date_default_timezone", variable_get('date_default_timezone', 0), $zones, t("Select the default site timezone."));
+ $group .= form_radios(t("Use sitewide timezone"), "sitewide timezone", variable_get("sitewide_timezone", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the sidewide timezone feature. Disabled means that users could choose their own timezone."));
$group .= form_select(t("Date format (short)"), "date_format_short", variable_get("date_format_short", $dateshort[0]), $dateshortchoices, t("The short format of date display."));
$group .= form_select(t("Date format (medium)"), "date_format_medium", variable_get("date_format_medium", $datemedium[0]), $datemediumchoices, t("The medium sized date display."));
$group .= form_select(t("Date format (long)"), "date_format_long", variable_get("date_format_long", $datelong[0]), $datelongchoices, t("Longer date format used for detailed display."));
diff --git a/modules/system/system.module b/modules/system/system.module
index a76242a59..9d1736dbc 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -88,14 +88,16 @@ function system_user($type, $edit, &$user) {
$data[t('Theme settings')] = form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
}
- $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);
+ if (variable_get("sitewide_timezone", 0)) {
+ $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);
+ }
+ $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
+ return $data;
}
- $data[t('Locale settings')] = form_select(t("Time zone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your time zone settings will be set appropriate."));
- return $data;
}
else if ($type == 'view') {
// do nothing
@@ -171,6 +173,7 @@ function system_view_general() {
}
$group = form_select(t("Time zone"), "date_default_timezone", variable_get('date_default_timezone', 0), $zones, t("Select the default site timezone."));
+ $group .= form_radios(t("Use sitewide timezone"), "sitewide timezone", variable_get("sitewide_timezone", 0), array(t("Disabled"), t("Enabled")), t("Enable or disable the sidewide timezone feature. Disabled means that users could choose their own timezone."));
$group .= form_select(t("Date format (short)"), "date_format_short", variable_get("date_format_short", $dateshort[0]), $dateshortchoices, t("The short format of date display."));
$group .= form_select(t("Date format (medium)"), "date_format_medium", variable_get("date_format_medium", $datemedium[0]), $datemediumchoices, t("The medium sized date display."));
$group .= form_select(t("Date format (long)"), "date_format_long", variable_get("date_format_long", $datelong[0]), $datelongchoices, t("Longer date format used for detailed display."));