using array internaly instead of commasep. string

This commit is contained in:
Ralf Becker 2004-06-12 09:45:33 +00:00
parent d834017cff
commit 1b5427cb5a

View File

@ -150,7 +150,7 @@ class html
}
if ((int)$multiple > 0)
{
$options .= ' multiple size="'.(int)$multiple.'"';
$options .= ' multiple="1" size="'.(int)$multiple.'"';
if (substr($name,-2) != '[]')
{
$name .= '[]';
@ -158,15 +158,15 @@ class html
}
$out = "<select name=\"$name\" $options>\n";
if (is_array($key))
if (!is_array($key))
{
$key = implode(',',$key);
$key = explode(',',$key);
}
foreach($arr as $k => $text)
{
$out .= '<option value="'.$this->htmlspecialchars($k).'"';
if("$k" == "$key" || strstr(",$key,",",$k,"))
if(in_array($k,$key))
{
$out .= ' selected="1"';
}