Ajout parametre dans select_array
This commit is contained in:
parent
9b86524638
commit
41e0e846ff
@ -244,7 +244,7 @@ class Form {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function select_array($name, $array, $id='')
|
Function select_array($name, $array, $id='', $empty=0)
|
||||||
{
|
{
|
||||||
print '<select name="'.$name.'">';
|
print '<select name="'.$name.'">';
|
||||||
|
|
||||||
@ -252,7 +252,11 @@ class Form {
|
|||||||
|
|
||||||
if (strlen($id))
|
if (strlen($id))
|
||||||
{
|
{
|
||||||
reset ($array);
|
if ($empty == 1)
|
||||||
|
{
|
||||||
|
$array[0] = "-";
|
||||||
|
}
|
||||||
|
sort ($array);
|
||||||
while (list($key, $value) = each ($array))
|
while (list($key, $value) = each ($array))
|
||||||
{
|
{
|
||||||
print "<option value=\"$key\" ";
|
print "<option value=\"$key\" ";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user