Added a select component to choose a timezone

This commit is contained in:
Alejandro Gallardo Escobar 2018-04-30 15:34:18 +02:00
parent 3855e4c378
commit 01997ff479
1 changed files with 126 additions and 0 deletions

View File

@ -2336,4 +2336,130 @@ function html_print_autocomplete_modules($name = 'module',
echo $output;
}
}
/**
* @param string Select form name
* @param string Current selected value
*
* @return string HTML code
*/
function html_print_timezone_select ($name, $selected = "") {
$timezones = array(
"Pacific/Midway" => "(GMT-11:00) " . __("Midway Island"),
"US/Samoa" => "(GMT-11:00) " . __("Samoa"),
"US/Hawaii" => "(GMT-10:00) " . __("Hawaii"),
"US/Alaska" => "(GMT-09:00) " . __("Alaska"),
"US/Pacific" => "(GMT-08:00) " . __("Pacific Time (US & Canada)"),
"America/Tijuana" => "(GMT-08:00) " . __("Tijuana"),
"US/Arizona" => "(GMT-07:00) " . __("Arizona"),
"US/Mountain" => "(GMT-07:00) " . __("Mountain Time (US & Canada)"),
"America/Chihuahua" => "(GMT-07:00) " . __("Chihuahua"),
"America/Mazatlan" => "(GMT-07:00) " . __("Mazatlan"),
"America/Mexico_City" => "(GMT-06:00) " . __("Mexico City"),
"America/Monterrey" => "(GMT-06:00) " . __("Monterrey"),
"Canada/Saskatchewan" => "(GMT-06:00) " . __("Saskatchewan"),
"US/Central" => "(GMT-06:00) " . __("Central Time (US & Canada)"),
"US/Eastern" => "(GMT-05:00) " . __("Eastern Time (US & Canada)"),
"US/East-Indiana" => "(GMT-05:00) " . __("Indiana (East)"),
"America/Bogota" => "(GMT-05:00) " . __("Bogota"),
"America/Lima" => "(GMT-05:00) " . __("Lima"),
"America/Caracas" => "(GMT-04:30) " . __("Caracas"),
"Canada/Atlantic" => "(GMT-04:00) " . __("Atlantic Time (Canada)"),
"America/La_Paz" => "(GMT-04:00) " . __("La Paz"),
"America/Santiago" => "(GMT-04:00) " . __("Santiago"),
"Canada/Newfoundland" => "(GMT-03:30) " . __("Newfoundland"),
"America/Buenos_Aires" => "(GMT-03:00) " . __("Buenos Aires"),
"Greenland'" => "(GMT-03:00) " . __("Greenland"),
"Atlantic/Stanley" => "(GMT-02:00) " . __("Stanley"),
"Atlantic/Azores" => "(GMT-01:00) " . __("Azores"),
"Atlantic/Cape_Verde" => "(GMT-01:00) " . __("Cape Verde Is."),
"Africa/Casablanca" => "(GMT+00:00) " . __("Casablanca"),
"Europe/Dublin" => "(GMT+00:00) " . __("Dublin"),
"Europe/Lisbon" => "(GMT+00:00) " . __("Lisbon"),
"Europe/London" => "(GMT+00:00) " . __("London"),
"Africa/Monrovia" => "(GMT+00:00) " . __("Monrovia"),
"Europe/Amsterdam" => "(GMT+01:00) " . __("Amsterdam"),
"Europe/Belgrade" => "(GMT+01:00) " . __("Belgrade"),
"Europe/Berlin" => "(GMT+01:00) " . __("Berlin"),
"Europe/Bratislava" => "(GMT+01:00) " . __("Bratislava"),
"Europe/Brussels" => "(GMT+01:00) " . __("Brussels"),
"Europe/Budapest" => "(GMT+01:00) " . __("Budapest"),
"Europe/Copenhagen" => "(GMT+01:00) " . __("Copenhagen"),
"Europe/Ljubljana" => "(GMT+01:00) " . __("Ljubljana"),
"Europe/Madrid" => "(GMT+01:00) " . __("Madrid"),
"Europe/Paris" => "(GMT+01:00) " . __("Paris"),
"Europe/Prague" => "(GMT+01:00) " . __("Prague"),
"Europe/Rome" => "(GMT+01:00) " . __("Rome"),
"Europe/Sarajevo" => "(GMT+01:00) " . __("Sarajevo"),
"Europe/Skopje" => "(GMT+01:00) " . __("Skopje"),
"Europe/Stockholm" => "(GMT+01:00) " . __("Stockholm"),
"Europe/Vienna" => "(GMT+01:00) " . __("Vienna"),
"Europe/Warsaw" => "(GMT+01:00) " . __("Warsaw"),
"Europe/Zagreb" => "(GMT+01:00) " . __("Zagreb"),
"Europe/Athens" => "(GMT+02:00) " . __("Athens"),
"Europe/Bucharest" => "(GMT+02:00) " . __("Bucharest"),
"Africa/Cairo" => "(GMT+02:00) " . __("Cairo"),
"Africa/Harare" => "(GMT+02:00) " . __("Harare"),
"Europe/Helsinki" => "(GMT+02:00) " . __("Helsinki"),
"Europe/Istanbul" => "(GMT+02:00) " . __("Istanbul"),
"Asia/Jerusalem" => "(GMT+02:00) " . __("Jerusalem"),
"Europe/Kiev" => "(GMT+02:00) " . __("Kyiv"),
"Europe/Minsk" => "(GMT+02:00) " . __("Minsk"),
"Europe/Riga" => "(GMT+02:00) " . __("Riga"),
"Europe/Sofia" => "(GMT+02:00) " . __("Sofia"),
"Europe/Tallinn" => "(GMT+02:00) " . __("Tallinn"),
"Europe/Vilnius" => "(GMT+02:00) " . __("Vilnius"),
"Asia/Baghdad" => "(GMT+03:00) " . __("Baghdad"),
"Asia/Kuwait" => "(GMT+03:00) " . __("Kuwait"),
"Africa/Nairobi" => "(GMT+03:00) " . __("Nairobi"),
"Asia/Riyadh" => "(GMT+03:00) " . __("Riyadh"),
"Europe/Moscow" => "(GMT+03:00) " . __("Moscow"),
"Asia/Tehran" => "(GMT+03:30) " . __("Tehran"),
"Asia/Baku" => "(GMT+04:00) " . __("Baku"),
"Europe/Volgograd" => "(GMT+04:00) " . __("Volgograd"),
"Asia/Muscat" => "(GMT+04:00) " . __("Muscat"),
"Asia/Tbilisi" => "(GMT+04:00) " . __("Tbilisi"),
"Asia/Yerevan" => "(GMT+04:00) " . __("Yerevan"),
"Asia/Kabul" => "(GMT+04:30) " . __("Kabul"),
"Asia/Karachi" => "(GMT+05:00) " . __("Karachi"),
"Asia/Tashkent" => "(GMT+05:00) " . __("Tashkent"),
"Asia/Kolkata" => "(GMT+05:30) " . __("Kolkata"),
"Asia/Kathmandu" => "(GMT+05:45) " . __("Kathmandu"),
"Asia/Yekaterinburg" => "(GMT+06:00) " . __("Ekaterinburg"),
"Asia/Almaty" => "(GMT+06:00) " . __("Almaty"),
"Asia/Dhaka" => "(GMT+06:00) " . __("Dhaka"),
"Asia/Novosibirsk" => "(GMT+07:00) " . __("Novosibirsk"),
"Asia/Bangkok" => "(GMT+07:00) " . __("Bangkok"),
"Asia/Jakarta" => "(GMT+07:00) " . __("Jakarta"),
"Asia/Krasnoyarsk" => "(GMT+08:00) " . __("Krasnoyarsk"),
"Asia/Chongqing" => "(GMT+08:00) " . __("Chongqing"),
"Asia/Hong_Kong" => "(GMT+08:00) " . __("Hong Kong"),
"Asia/Kuala_Lumpur" => "(GMT+08:00) " . __("Kuala Lumpur"),
"Australia/Perth" => "(GMT+08:00) " . __("Perth"),
"Asia/Singapore" => "(GMT+08:00) " . __("Singapore"),
"Asia/Taipei" => "(GMT+08:00) " . __("Taipei"),
"Asia/Ulaanbaatar" => "(GMT+08:00) " . __("Ulaan Bataar"),
"Asia/Urumqi" => "(GMT+08:00) " . __("Urumqi"),
"Asia/Irkutsk" => "(GMT+09:00) " . __("Irkutsk"),
"Asia/Seoul" => "(GMT+09:00) " . __("Seoul"),
"Asia/Tokyo" => "(GMT+09:00) " . __("Tokyo"),
"Australia/Adelaide" => "(GMT+09:30) " . __("Adelaide"),
"Australia/Darwin" => "(GMT+09:30) " . __("Darwin"),
"Asia/Yakutsk" => "(GMT+10:00) " . __("Yakutsk"),
"Australia/Brisbane" => "(GMT+10:00) " . __("Brisbane"),
"Australia/Canberra" => "(GMT+10:00) " . __("Canberra"),
"Pacific/Guam" => "(GMT+10:00) " . __("Guam"),
"Australia/Hobart" => "(GMT+10:00) " . __("Hobart"),
"Australia/Melbourne" => "(GMT+10:00) " . __("Melbourne"),
"Pacific/Port_Moresby" => "(GMT+10:00) " . __("Port Moresby"),
"Australia/Sydney" => "(GMT+10:00) " . __("Sydney"),
"Asia/Vladivostok" => "(GMT+11:00) " . __("Vladivostok"),
"Asia/Magadan" => "(GMT+12:00) " . __("Magadan"),
"Pacific/Auckland" => "(GMT+12:00) " . __("Auckland"),
"Pacific/Fiji" => "(GMT+12:00) " . __("Fiji"),
);
return html_print_select($timezones, $name, $selected, "", __("None"), "", true, false, false);
}
?>