/** * @param string $culture_code Code of current <CultureInfo> * @param mixed $date_format Chosen date format * @param mixed $time_format Chosen time format * @param string $timezone Currently chosen timezone * @param bool $append_timezone If true timezome will be appended */ function __initialize($culture_code, $date_format, $time_format, $timezone = false, $append_timezone = false) { parent::__initialize(); $this->script("Locale_Settings_Init();"); store_object($this); if (!$timezone) { $timezone = Localization::getTimeZone(); } $this->timezone = $timezone; $this->culture_code = $culture_code; $txt = $this->_sample(false, $date_format, $time_format); if ($append_timezone) { $txt .= " {$timezone}"; } $sample = new Control('span'); $sample->append("({$txt})")->css('color', 'gray'); $cb = new CheckBox(); $cb->setData('role', 'timeformatex')->setData('controller', buildQuery($this->id)); $cb->value = 1; if ($append_timezone) { $cb->checked = "checked"; } $lab = $cb->CreateLabel(tds("TXT_APPEND_TIMEZONE", "Append timezone") . " "); $lab->content($sample); $this->append($cb)->append($lab); }
/** * @param string $current_timezone Currently selected timezone */ function __initialize($current_timezone = false) { parent::__initialize(); $this->script("Locale_Settings_Init();"); $this->setData('role', 'timezone'); if (!$current_timezone) { $current_timezone = Localization::getTimeZone(); } $this->SetCurrentValue($current_timezone); foreach (Localization::GetAllTimeZones() as $tz) { $this->AddOption($tz, str_replace("_", " ", $tz)); } }