cvs: pear /HTML_QuickForm/QuickForm select.php

From: Date: Wed, 05 Jun 2002 18:40:15 +0000
Subject: cvs: pear /HTML_QuickForm/QuickForm select.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4429@lists.php.net to get a copy of this message
jrust Wed Jun 5 14:40:15 2002 EDT Modified files: /pear/HTML_QuickForm/QuickForm select.php Log: setSelected() was not working for numeric values and arrays because it was adding the value onto the end of array. Index: pear/HTML_QuickForm/QuickForm/select.php diff -u pear/HTML_QuickForm/QuickForm/select.php:1.6 pear/HTML_QuickForm/QuickForm/select.php:1.7 --- pear/HTML_QuickForm/QuickForm/select.php:1.6 Mon May 13 10:37:09 2002 +++ pear/HTML_QuickForm/QuickForm/select.php Wed Jun 5 14:40:14 2002 @@ -17,10 +17,10 @@ // | Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // -// $Id: select.php,v 1.6 2002/05/13 14:37:09 mansion Exp $ +// $Id: select.php,v 1.7 2002/06/05 18:40:14 jrust Exp $ -require_once("DB.php"); -require_once("HTML/QuickForm/element.php"); +require_once('DB.php'); +require_once('HTML/QuickForm/element.php'); /** * Class to dynamically create an HTML SELECT @@ -114,9 +114,14 @@ if (is_string($values)) { $values = split("[ ]?,[ ]?", $values); $this->_values = $values; - } else { - $this->_values[] = $values; - } + } + + if (is_array($values)) { + $this->_values = $values; + } + else { + $this->_values = array($values); + } } //end func setSelected // }}} @@ -543,4 +548,4 @@ // }}} } //end class HTML_QuickForm_select -?> \ No newline at end of file +?>

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