<?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('groupedlist');
/**
* Form Field class for the Joomla Platform.
*
* @package Joomla.Platform
* @subpackage Form
* @since 11.1
*/
class JFormFieldTimezone extends JFormFieldGroupedList
{
/**
* The form field type.
*
* @var string
* @since 11.1
*/
protected $type = 'Timezone';
/**
* The list of available timezone groups to use.
*
* @var array
*
* @since 11.1
*/
protected static $zones = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
/**
* Method to get the time zone field option groups.
*
* @return array The field option objects as a nested array in groups.
*
* @since 11.1
*/
protected function getGroups()
{
// Initialize variables.
$groups = array();
$keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'id';
$keyValue = $this->form->getValue($keyField);
// If the timezone is not set use the server setting.
if (strlen($this->value) == 0 && empty($keyValue))
{
$this->value = JFactory::getConfig()->get('offset');
}
// Get the list of time zones from the server.
$zones = DateTimeZone::listIdentifiers();
// Build the group lists.
foreach ($zones as $zone)
{
// Time zones not in a group we will ignore.
if (strpos($zone, '/') === false)
{
continue;
}
// Get the group/locale from the timezone.
list ($group, $locale) = explode('/', $zone, 2);
// Only use known groups.
if (in_array($group, self::$zones))
{
// Initialize the group if necessary.
if (!isset($groups[$group]))
{
$groups[$group] = array();
}
// Only add options where a locale exists.
if (!empty($locale))
{
$groups[$group][$zone] = JHtml::_('select.option', $zone, str_replace('_', ' ', $locale), 'value', 'text', false);
}
}
}
// Sort the group lists.
ksort($groups);
foreach ($groups as $zone => & $location)
{
sort($location);
}
// Merge any additional groups in the XML definition.
$groups = array_merge(parent::getGroups(), $groups);
return $groups;
}
}
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| accesslevel.php | 2013-03-01 19:55 | 1.57 KB | 76129f60960:kunden | -xw-x----- | |
| cachehandler.php | 2013-03-01 19:55 | 1.13 KB | 76129f60960:kunden | -xw-x----- | |
| calendar.php | 2013-03-01 19:55 | 2.83 KB | 76129f60960:kunden | -xw-x----- | |
| category.php | 2013-03-01 19:55 | 3.69 KB | 76129f60960:kunden | -xw-x----- | |
| checkbox.php | 2013-03-01 19:55 | 1.66 KB | 76129f60960:kunden | -xw-x----- | |
| checkboxes.php | 2013-03-01 19:55 | 3.2 KB | 76129f60960:kunden | -xw-x----- | |
| color.php | 2013-03-01 19:55 | 1.77 KB | 76129f60960:kunden | -xw-x----- | |
| combo.php | 2013-03-01 19:55 | 1.99 KB | 76129f60960:kunden | -xw-x----- | |
| componentlayout.php | 2013-03-01 19:55 | 7.74 KB | 76129f60960:kunden | -xw-x----- | |
| contentlanguage.php | 2013-03-01 19:55 | 1.02 KB | 76129f60960:kunden | -xw-x----- | |
| databaseconnection.php | 2013-03-01 19:55 | 2.03 KB | 76129f60960:kunden | -xw-x----- | |
| editor.php | 2013-03-01 19:55 | 3.84 KB | 76129f60960:kunden | -xw-x----- | |
| editors.php | 2013-03-01 19:55 | 2.29 KB | 76129f60960:kunden | -xw-x----- | |
| email.php | 2013-03-01 19:55 | 1.76 KB | 76129f60960:kunden | -xw-x----- | |
| file.php | 2013-03-01 19:55 | 1.72 KB | 76129f60960:kunden | -xw-x----- | |
| filelist.php | 2013-03-01 19:55 | 2.64 KB | 76129f60960:kunden | -xw-x----- | |
| folderlist.php | 2013-03-01 19:55 | 2.22 KB | 76129f60960:kunden | -xw-x----- | |
| groupedlist.php | 2013-03-01 19:55 | 4.74 KB | 76129f60960:kunden | -xw-x----- | |
| hidden.php | 2013-03-01 19:55 | 1.37 KB | 76129f60960:kunden | -xw-x----- | |
| imagelist.php | 2013-03-01 19:55 | 1.1 KB | 76129f60960:kunden | -xw-x----- | |
| index.html | 2013-03-01 19:55 | 31 B | 76129f60960:kunden | -xw-x----- | |
| integer.php | 2013-03-01 19:55 | 1.63 KB | 76129f60960:kunden | -xw-x----- | |
| language.php | 2013-03-01 19:55 | 1.27 KB | 76129f60960:kunden | -xw-x----- | |
| list.php | 2013-03-01 19:55 | 3.03 KB | 76129f60960:kunden | -xw-x----- | |
| media.php | 2013-03-01 19:55 | 7.12 KB | 76129f60960:kunden | -xw-x----- | |
| menuitem.php | 2013-03-01 19:55 | 2.34 KB | 76129f60960:kunden | -xw-x----- | |
| modulelayout.php | 2013-03-01 19:55 | 6.28 KB | 76129f60960:kunden | -xw-x----- | |
| password.php | 2013-03-01 19:55 | 2.26 KB | 76129f60960:kunden | -xw-x----- | |
| plugins.php | 2013-03-01 19:55 | 2.15 KB | 76129f60960:kunden | -xw-x----- | |
| radio.php | 2013-03-01 19:55 | 3 KB | 76129f60960:kunden | -xw-x----- | |
| rules.php | 2013-03-01 19:55 | 10.6 KB | 76129f60960:kunden | -xw-x----- | |
| sessionhandler.php | 2013-03-01 19:55 | 1.2 KB | 76129f60960:kunden | -xw-x----- | |
| spacer.php | 2013-03-01 19:55 | 2.68 KB | 76129f60960:kunden | -xw-x----- | |
| sql.php | 2013-03-01 19:55 | 1.94 KB | 76129f60960:kunden | -xw-x----- | |
| tel.php | 2013-03-01 19:55 | 815 B | 76129f60960:kunden | -xw-x----- | |
| text.php | 2013-03-01 19:55 | 1.68 KB | 76129f60960:kunden | -xw-x----- | |
| textarea.php | 2013-03-01 19:55 | 1.65 KB | 76129f60960:kunden | -xw-x----- | |
| timezone.php | 2013-03-01 19:55 | 2.38 KB | 76129f60960:kunden | -xw-x----- | |
| url.php | 2013-03-01 19:55 | 746 B | 76129f60960:kunden | -xw-x----- | |
| usergroup.php | 2013-03-01 19:55 | 2.15 KB | 76129f60960:kunden | -xw-x----- | |