]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/form.php
Let's you upload a file with a notice and have it shown with other attachments.
[quix0rs-gnu-social.git] / lib / form.php
index 5317df4715946e9638a1b32905f603f3652ca299..f872aef0b55066196d54c61456678664736c1d93 100644 (file)
@@ -52,6 +52,8 @@ require_once INSTALLDIR.'/lib/widget.php';
 
 class Form extends Widget
 {
+    var $enctype = null;
+
     /**
      * Show the form
      *
@@ -63,11 +65,15 @@ class Form extends Widget
 
     function show()
     {
-        $this->out->elementStart('form',
-                                 array('id' => $this->id(),
-                                       'class' => $this->formClass(),
-                                       'method' => 'post',
-                                       'action' => $this->action()));
+        $attributes = array('id' => $this->id(),
+            'class' => $this->formClass(),
+            'method' => 'post',
+            'action' => $this->action());
+
+        if (!empty($this->enctype)) {
+            $attributes['enctype'] = $this->enctype;
+        }
+        $this->out->elementStart('form', $attributes);
         $this->out->elementStart('fieldset');
         $this->formLegend();
         $this->sessionToken();