- Changed form_select() to return NULL if called without $options. This should
not have any impact, and makes things look nicer imo.3-00
parent
691d8ba54f
commit
6563382974
|
@ -178,8 +178,10 @@ function form_textarea($title, $name, $value, $cols, $rows, $description = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_select($title, $name, $value, $options, $description = 0) {
|
function form_select($title, $name, $value, $options, $description = 0) {
|
||||||
|
if (count($options) > 0) {
|
||||||
foreach ($options as $key=>$choice) $select .= "<option value=\"$key\"". ($key == $value ? " selected" : "") .">". check_form($choice) ."</option>";
|
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);
|
return form_item($title, "<select name=\"edit[$name]\">$select</select>", $description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function form_file($title, $name, $size, $description = 0) {
|
function form_file($title, $name, $size, $description = 0) {
|
||||||
|
|
Loading…
Reference in New Issue