HTML_OOH_FORMS: date

From: Date: Wed, 20 Feb 2002 10:11:14 +0000
Subject: HTML_OOH_FORMS: date
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4823@lists.php.net to get a copy of this message
hello list, ive made some changes on HTML_OOH_FORMS/elements/form_element_date. here are the diffs: Index: form_element_date.php =================================================================== RCS file: /repository/pear/HTML_OOH_Form/elements/form_element_date.php,v retrieving revision 1.6 diff -r1.6 form_element_date.php 53c53,56 < 'max_year_short' => 'integer' --- > 'max_year_short' => 'integer', > > 'check' => 'boolean', > 'check_e' => 'string' 121a125,130 > /** > * @var boolean > */ > var $_now = false; > var $check = false; > var $check_e = ''; 146d154 < 151c159 < --- > 155c163 < --- > 158,163c166,171 < $sign = $regs[1]; < $value[$sign] = $data[$this->name . '_' . $sign]; < } < < } < --- > $sign = $regs[0]; > $this->value[$sign] = $data[$this->name . '_' . $sign]; > } > } > if($data[$this->name.'_button']) > $this->_now = true; 168c176 < --- > $this->getValue(); 296,299c304,307 < for ($j = 0; $j <= 365; $j++) < $options[] = $j; < $html['z'] = $this->generateSelect('z', $options); < break; --- > for ($j = 0; $j <= 365; $j++) > $options[] = $j; > $html['z'] = $this->generateSelect('z', $options); > break; 302,305c310,312 < $html[] = $sign; < break; < } < --- > $html[] = $sign; > break; > } 339d345 < 345,346c351,352 < ); < --- > ); > 351,353c357,359 < < foreach ($options as $k => $option) < $html .= sprintf('<option value="%s"%s>%s</option>%s', --- > > foreach ($options as $k => $option) { > $html .= sprintf('<option value="%s"%s>%s</option>%s', 355c361 < ((isset($this->value[$name]) && $option == $this->value[$name]) || (!$selected && $this->preload && $option == $this->getPreloadValue($name))) ? " selected" : "", --- > ((isset($this->value[$name]) && $option == $this->value[$name] && !$this->_now) || ((!isset($this->value[$name])||$this->_now) && $this->preload && $option == $this->getPreloadValue($name))) ? " selected" : "", 359c365 < --- > } 465a472,487 > > > function validateDate() { > // FIXME date > > if ($GLOBALS[$this->name . '_d'] && $GLOBALS[$this->name . > '_m'] && $GLOBALS[$this->name . '_Y'] && $this->check) { > if(!checkdate($GLOBALS[$this->name . '_m'], $GLOBALS[$this->name . '_d'],$GLOBALS[$this->name . '_Y'])) { > return ('' == $this->check_e) ? false : $this->check_e; > } > } > > } > > function validate() { > return $this->validateDate(); > } // Tobias.

« previous php.pear.dev (#4823) next »