1.1 --- a/public_html/usersettings.php Sat Sep 19 22:42:31 2009 +0200
1.2 +++ b/public_html/usersettings.php Sun Sep 20 11:00:03 2009 +0200
1.3 @@ -518,36 +518,15 @@
1.4 $preferences->set_var ('theme_selection', '');
1.5 }
1.6
1.7 - require_once ('Date/TimeZone.php');
1.8 // Timezone
1.9 - if (empty($_USER['tzid']) && isset($_CONF['timezone'])) {
1.10 - $timezone = $_CONF['timezone'];
1.11 - } else if (!empty($_USER['tzid'])) {
1.12 - $timezone = $_USER['tzid'];
1.13 - } else {
1.14 - $tz_obj = Date_TimeZone::getDefault();
1.15 - $timezone = $tz_obj->id;
1.16 - }
1.17 - $selection = '<select id="tzid" name="tzid">' . LB;
1.18 + require_once $_CONF['path_system'] . 'classes/timezoneconfig.class.php';
1.19
1.20 - $T = $GLOBALS['_DATE_TIMEZONE_DATA'];
1.21 + $timezone = TimeZoneConfig::getUserTimeZone();
1.22 + $selection = TimeZoneConfig::getTimeZoneDropDown($timezone,
1.23 + array('id' => 'tzid', 'name' => 'tzid'));
1.24
1.25 - foreach ($T as $tzid => $tDetails) {
1.26 - $tzcode = str_replace('_', ' ', $tzid);
1.27 - $tzcode = htmlspecialchars($tzcode);
1.28 - $selection .= '<option value="' . $tzcode . '"';
1.29 - if ($timezone == $tzcode) {
1.30 - $selection .= ' selected="selected"';
1.31 - }
1.32 - $hours = $tDetails['offset'] / (3600 * 1000);
1.33 - if ($hours > 0) {
1.34 - $hours = "+$hours";
1.35 - }
1.36 - $selection .= ">$hours, {$tDetails['shortname']} ($tzcode)</option>" . LB;
1.37 - }
1.38 - $selection .= '</select>';
1.39 - $preferences->set_var ('timezone_selector', $selection);
1.40 - $preferences->set_var ('lang_timezone', $LANG04[158]);
1.41 + $preferences->set_var('timezone_selector', $selection);
1.42 + $preferences->set_var('lang_timezone', $LANG04[158]);
1.43
1.44 if ($A['noicons'] == '1') {
1.45 $preferences->set_var ('noicons_checked', 'checked="checked"');