Commit 30c236f2 authored by Kjartan's avatar Kjartan
Browse files

- Extended form() to take an optional forth parameter which is appended to

  the <FORM> tag.
- Added form_file($name) for file uploads. (requires form() to be called with
  $options='ENCRYPT="multipart/form-data"'.)
parent 6f02738c
......@@ -170,8 +170,8 @@ function format_text($text) {
return preg_replace($src, $dst, $text);
}
function form($action, $form, $method = "post") {
return "<FORM ACTION=\"$action\" METHOD=\"$method\">\n$form</FORM>\n";
function form($action, $form, $method = "post", $options="") {
return "<FORM ACTION=\"$action\" METHOD=\"$method\"". (!empty($options) ? " $options" : "") .">\n$form</FORM>\n";
}
function form_item($title, $value, $description = 0) {
......@@ -195,6 +195,10 @@ function form_hidden($name, $value) {
return "<INPUT TYPE=\"hidden\" NAME=\"edit[$name]\" VALUE=\"". check_textfield($value) ."\">\n";
}
function form_file($name) {
return "<INPUT TYPE=\"file\" NAME=\"edit[$name]\">\n";
}
function form_submit($value) {
return "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". check_textfield($value) ."\">\n";
}
......
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