Commit ab79429a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Pieforms: Allow custom elements to include file inputs

parent 39311e2e
......@@ -323,7 +323,7 @@ class Pieform {/*{{{*/
}
// Force the form method to post if there is a file to upload
if ($element['type'] == 'file') {
if (!empty($element['needsmultipart'])) {
$this->fileupload = true;
if ($this->data['method'] == 'get') {
$this->data['method'] = 'post';
......
......@@ -45,4 +45,9 @@ function pieform_element_file_get_value(Pieform $form, $element) {/*{{{*/
}
}/*}}}*/
function pieform_element_file_set_attributes($element) {/*{{{*/
$element['needsmultipart'] = true;
return $element;
}/*}}}*/
?>
Supports Markdown
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