Example #1
0
 /**
  * Constructor
  *
  * @param string|array $caption Caption or array of all attributes
  * @param string       $name    name
  * @param mixed        $value   Pre-selected value (or array of them).
  *                               Must be \DateTimeZone supported timezone names, or a DateTimeZone object
  * @param integer      $size    Number of rows. "1" makes a drop-down-box.
  */
 public function __construct($caption, $name, $value = null, $size = 1)
 {
     if (is_array($caption)) {
         parent::__construct($caption);
     } else {
         parent::__construct($caption, $name, $value, $size);
     }
     if (is_a($this->get('value'), '\\DateTimeZone')) {
         $this->set('value', $this->get('value')->getName());
     }
     \Xoops\Core\Lists\TimeZone::setOptionsArray($this);
 }
Example #2
0
 /**
  * get list of timezones
  *
  * @return array
  */
 public static function getTimeZoneList()
 {
     return \Xoops\Core\Lists\TimeZone::getList();
 }