cvs: pear /HTML_QuickForm QuickForm.php

From: Date: Sat, 11 Jan 2003 19:25:09 +0000
Subject: cvs: pear /HTML_QuickForm QuickForm.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8190@lists.php.net to get a copy of this message
mansion Sat Jan 11 14:25:09 2003 EDT Modified files: /pear/HTML_QuickForm QuickForm.php Log: I have added the date element and made addElement return a reference to the created element. This will make code lighter if you used getElement() before. I hope it won't break anybody's code, normally it shouldn't... Index: pear/HTML_QuickForm/QuickForm.php diff -u pear/HTML_QuickForm/QuickForm.php:1.49 pear/HTML_QuickForm/QuickForm.php:1.50 --- pear/HTML_QuickForm/QuickForm.php:1.49 Sun Dec 15 06:44:32 2002 +++ pear/HTML_QuickForm/QuickForm.php Sat Jan 11 14:25:08 2003 @@ -17,7 +17,7 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: QuickForm.php,v 1.49 2002/12/15 11:44:32 mansion Exp $ +// $Id: QuickForm.php,v 1.50 2003/01/11 19:25:08 mansion Exp $ require_once('PEAR.php'); require_once('HTML/Common.php'); @@ -39,7 +39,8 @@ 'text' =>array('HTML/QuickForm/text.php','HTML_QuickForm_text'), 'textarea' =>array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'), 'link' =>array('HTML/QuickForm/link.php','HTML_QuickForm_link'), - 'advcheckbox' =>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox') + 'advcheckbox' =>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'), + 'date' =>array('HTML/QuickForm/date.php','HTML_QuickForm_date') ); // {{{ error codes @@ -553,7 +554,7 @@ * @return index of element * @access public */ - function addElement($element) + function &addElement($element) { if (is_object($element) && is_subclass_of($element, 'html_quickform_element')) { $elementObject = &$element; @@ -575,12 +576,12 @@ if (isset($this->_constantValues[$elementName])) { $elementObject->onQuickFormEvent('setConstant', $this->_constantValues[$elementName], $this); } - $this->_elements[] = $elementObject; + $this->_elements[] =& $elementObject; end($this->_elements); $index = key($this->_elements); $this->_elementIndex[$elementName] = $index; - return $index; + return $elementObject; } // end func addElement // }}} @@ -2139,5 +2140,5 @@ } // }}} -} +} // end class HTML_QuickForm_Error ?>

« previous php.pear.cvs (#8190) next »