cvs: pear /HTML_QuickForm/QuickForm select.php
| From: | Jason Rust | Date: | Fri, 14 Jun 2002 19:20:26 +0000 |
| Subject: | cvs: pear /HTML_QuickForm/QuickForm select.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4623@lists.php.net to get a copy of this message | ||
jrust Fri Jun 14 15:20:26 2002 EDT
Modified files:
/pear/HTML_QuickForm/QuickForm select.php
Log:
Moved the check for multiple to toHtml() since it changes the name and thus breaks setDefault if
it is in the constructor.
Index: pear/HTML_QuickForm/QuickForm/select.php
diff -u pear/HTML_QuickForm/QuickForm/select.php:1.9 pear/HTML_QuickForm/QuickForm/select.php:1.10
--- pear/HTML_QuickForm/QuickForm/select.php:1.9 Fri Jun 14 09:16:20 2002
+++ pear/HTML_QuickForm/QuickForm/select.php Fri Jun 14 15:20:26 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: select.php,v 1.9 2002/06/14 13:16:20 mansion Exp $
+// $Id: select.php,v 1.10 2002/06/14 19:20:26 jrust Exp $
require_once('DB.php');
require_once('HTML/QuickForm/element.php');
@@ -73,9 +73,6 @@
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'select';
- if ($this->getAttribute('multiple')) {
- $this->setMultiple(true);
- }
if (isset($options)) {
$this->load($options);
}
@@ -461,6 +458,10 @@
if ($this->_flagFrozen) {
$strHtml = $this->getFrozenHtml();
} else {
+ // put this down here since it changes the name
+ if ($this->getAttribute('multiple')) {
+ $this->setMultiple(true);
+ }
$tabs = $this->_getTabs();
$name = isset($this->_attributes["name"]) ?
$this->_attributes["name"] : '' ;
$strHtml =
@@ -547,4 +548,4 @@
// }}}
} //end class HTML_QuickForm_select
-?>
\ No newline at end of file
+?>