X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fform.php;h=f872aef0b55066196d54c61456678664736c1d93;hb=4d05afae302f1870af369a713ab7ed291c821165;hp=011d4bfc9b9b440a9dde51cb5cd55f54eb05d035;hpb=4b9df58c90e25ea79aeec64c6e96f828fe06d7df;p=quix0rs-gnu-social.git diff --git a/lib/form.php b/lib/form.php index 011d4bfc9b..f872aef0b5 100644 --- a/lib/form.php +++ b/lib/form.php @@ -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(); @@ -88,7 +94,6 @@ class Form extends Widget $this->out->hidden('token', common_session_token()); } - /** * Name of the form * @@ -101,7 +106,6 @@ class Form extends Widget { } - /** * Visible or invisible data elements * @@ -154,7 +158,7 @@ class Form extends Widget function action() { } - + /** * Class of the form. * @@ -163,6 +167,6 @@ class Form extends Widget function formClass() { - return 'form'; + return 'form'; } }