Fix: Corrige mauvaise syntaxt html

This commit is contained in:
Laurent Destailleur 2006-02-25 00:15:58 +00:00
parent 9676eab7cf
commit f42a2eab77

View File

@ -809,7 +809,11 @@ class Form
{ {
global $langs; global $langs;
print '<select class="flat" name="'.$htmlname.'">'; print '<select class="flat" name="'.$htmlname.'">';
$options = array(0=>"non",1=>"oui"); $options = array(
'-1'=>'&nbsp;',
'0'=>$langs->trans("No"),
'1'=>$langs->trans("Yes")
);
foreach($options as $id => $value) foreach($options as $id => $value)
{ {
if ($selected == $id) if ($selected == $id)
@ -1821,15 +1825,11 @@ class Form
while (list($key, $value) = each ($array)) while (list($key, $value) = each ($array))
{ {
print '<option value="'; print '<option value="'.($value_as_key?$value:$key).'"';
if ($value_as_key) print $value;
else print $key;
print '" ';
// Si il faut présélectionner une valeur // Si il faut présélectionner une valeur
if ($id && $id == $key) if ($id && $id == $key)
{ {
print 'selected="true"'; print ' selected="true"';
} }
if ($key_in_label) if ($key_in_label)
@ -1838,7 +1838,7 @@ class Form
} }
else else
{ {
if ($value == '-') { $value='&nbsp;'; } if ($value == '' || $value == '-') { $value='&nbsp;'; }
print ">".$value."</option>\n"; print ">".$value."</option>\n";
} }
} }