/** * This is the class constructor for the YDFormElement_Timezone class. * * @param $form The name of the form to which this element is connected. * @param $name The name of the form element. * @param $label (optional) The label for the form element. * @param $attributes (optional) The attributes for the form element. * @param $options (optional) Format string: 'simple' or 'full' */ function YDFormElement_Timezone($form, $name, $label = '', $attributes = array(), $options = 'full') { // initialize parent $this->YDFormElement_Select($form, $name, $label, $attributes, YDArrayUtil::getGMT($options)); // set type $this->_type = 'timezone'; // set default $this->setDefault(0); }
/** * This function returns true if the variable matches a valid gmt value * * @param $val The value to test. * @param $opts (not required) */ function timezone($val, $opts = '') { YDInclude('YDUtil.php'); $arr = YDArrayUtil::getGMT(); return isset($arr[$val]); }