summaryrefslogtreecommitdiff
path: root/inc/form.php
diff options
context:
space:
mode:
authorMichael Klier <chi@chimeric.de>2007-10-29 14:43:59 +0100
committerMichael Klier <chi@chimeric.de>2007-10-29 14:43:59 +0100
commit639dd33fd4a9654b1f3491f836319a262662e91a (patch)
tree951bcd5b666fa041340293f919864b1b9eb76968 /inc/form.php
parent7aec69d1682617fca206712f1dfcd25f6531157a (diff)
downloadrpg-639dd33fd4a9654b1f3491f836319a262662e91a.tar.gz
rpg-639dd33fd4a9654b1f3491f836319a262662e91a.tar.bz2
allow enctype setting in form class
darcs-hash:20071029134359-23886-aec96a73329d48537e02927f40b08da9b879d4b9.gz
Diffstat (limited to 'inc/form.php')
-rw-r--r--inc/form.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/form.php b/inc/form.php
index ac58906c8..77b76dd15 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -35,6 +35,9 @@ class Doku_Form {
// Most likely no need to change this
var $method = 'post';
+ // Change for special forms only
+ var $enctype = '';
+
// Form id attribute
var $id = '';
@@ -58,10 +61,11 @@ class Doku_Form {
* @param string $method (optional) 'POST' or 'GET', default is post
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function Doku_Form($id, $action=false, $method=false) {
+ function Doku_Form($id, $action=false, $method=false, $enctype=false) {
$this->id = $id;
$this->action = ($action) ? $action : script();
if ($method) $this->method = $method;
+ if ($enctype) $this->enctype = $enctype;
$this->addHidden('sectok', getSecurityToken());
}
@@ -238,6 +242,7 @@ class Doku_Form {
global $lang;
print '<form action="'.$this->action.'" method="'.$this->method.'" accept-charset="'.$lang['encoding'].'"';
if (!empty($this->id)) print ' id="'.$this->id.'"';
+ if (!empty($this->enctype)) print ' enctype="'.$this->enctype.'"';
print '>'.NL;
if (!empty($this->_hidden)) {
print '<div class="no">';