Commit 65633829 authored by Kjartan's avatar Kjartan

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

  not have any impact, and makes things look nicer imo.
parent 691d8ba5
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment