- Changed form_select() to return NULL if called without $options. This should

not have any impact, and makes things look nicer imo.
3-00
Kjartan Mannes 2001-06-04 15:06:47 +00:00
parent 691d8ba54f
commit 6563382974
1 changed files with 4 additions and 2 deletions

View File

@ -178,8 +178,10 @@ function form_textarea($title, $name, $value, $cols, $rows, $description = 0) {
}
function form_select($title, $name, $value, $options, $description = 0) {
foreach ($options as $key=>$choice) $select .= "<option value=\"$key\"". ($key == $value ? " selected" : "") .">". check_form($choice) ."</option>";
return form_item($title, "<select name=\"edit[$name]\">$select</select>", $description);
if (count($options) > 0) {
foreach ($options as $key=>$choice) $select .= "<option value=\"$key\"". ($key == $value ? " selected" : "") .">". check_form($choice) ."</option>";
return form_item($title, "<select name=\"edit[$name]\">$select</select>", $description);
}
}
function form_file($title, $name, $size, $description = 0) {