cvs: pear /HTML_QuickForm/QuickForm select.php
| From: | Bertrand Mansion | Date: | Mon, 13 May 2002 14:37:10 +0000 |
| Subject: | cvs: pear /HTML_QuickForm/QuickForm select.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3801@lists.php.net to get a copy of this message | ||
mansion Mon May 13 10:37:10 2002 EDT
Modified files:
/pear/HTML_QuickForm/QuickForm select.php
Log:
The setSelected() method was not selecting numeric values when passed in using setDefaults. Now
fixed thanks to Jason Rust.
Index: pear/HTML_QuickForm/QuickForm/select.php
diff -u pear/HTML_QuickForm/QuickForm/select.php:1.5 pear/HTML_QuickForm/QuickForm/select.php:1.6
--- pear/HTML_QuickForm/QuickForm/select.php:1.5 Tue Apr 16 04:51:15 2002
+++ pear/HTML_QuickForm/QuickForm/select.php Mon May 13 10:37:09 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: select.php,v 1.5 2002/04/16 08:51:15 mansion Exp $
+// $Id: select.php,v 1.6 2002/05/13 14:37:09 mansion Exp $
require_once("DB.php");
require_once("HTML/QuickForm/element.php");
@@ -113,8 +113,10 @@
{
if (is_string($values)) {
$values = split("[ ]?,[ ]?", $values);
- }
- $this->_values = $values;
+ $this->_values = $values;
+ } else {
+ $this->_values[] = $values;
+ }
} //end func setSelected
// }}}
@@ -494,7 +496,7 @@
*/
function getFrozenHtml()
{
- // Fix me : doesn't work for multiple.
+ // Fix me : doesn't work for multiple.
$value = '';
if (is_array($this->_values)) {
while (list($key,$val) = each($this->_values)) {
@@ -511,7 +513,7 @@
$optionTxt = $this->_options[$i]["text"];
$optionVal = $this->_options[$i]["attr"]["value"];
if ($this->_values == $optionVal) {
- $value = $optionTxt;
+ $value = $optionTxt;
}
}
}