aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Form/Form.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-05-08 15:26:22 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-05-08 15:26:22 +0000
commitafc02bc1c3db9ffe8c9bf660c8aa08666752edfb (patch)
tree9a02b06b390dd0c1e796474b888e92c245473424 /h-source/Library/Form/Form.php
parent7fdac301801bc44f6fdb343187413bdfd2d5366c (diff)
h-source:added new EasyGiant SVN version
Diffstat (limited to 'h-source/Library/Form/Form.php')
-rwxr-xr-xh-source/Library/Form/Form.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/h-source/Library/Form/Form.php b/h-source/Library/Form/Form.php
index 9705666..9aba086 100755
--- a/h-source/Library/Form/Form.php
+++ b/h-source/Library/Form/Form.php
@@ -31,12 +31,14 @@ class Form_Form {
public $id = null;
public $submit = array(); //the submit entries array('name'=>'value')
public $method = 'POST'; //the transmission method: POST/GET
+ public $enctype = null; //enctype attribute of the form
- public function __construct($action,$submit = array('generalAction'=>'save'),$method = 'POST')
+ public function __construct($action,$submit = array('generalAction'=>'save'),$method = 'POST',$enctype = null)
{
$this->action = $action; //action of the form: controller/action
$this->submit = $submit;
$this->method = $method;
+ $this->enctype = $enctype;
}
//method to manage the $this->entry associative array
@@ -76,7 +78,7 @@ class Form_Form {
$labelClass = array_key_exists('labelClass',$entry) ? $entry['labelClass'] : null;
$defaultValue = array_key_exists('defaultValue',$entry) ? $entry['defaultValue'] : null;
$wrap = array_key_exists('wrap',$entry) ? $entry['wrap'] : array();
-
+
$this->entry[$name]->entryClass = $entryClass;
$this->entry[$name]->labelString = $labelString;
$this->entry[$name]->idName = $idName;
@@ -105,7 +107,8 @@ class Form_Form {
$fid = isset($this->id) ? "id='".$this->id."'" : null;
$fname = isset($this->name) ? "name='".$this->name."'" : null;
$fclass = isset($this->className) ? "class='".$this->className."'" : null;
- $htmlForm = "<form $fname $fclass $fid action='".Url::getRoot($this->action)."' method='".$this->method."'>\n";
+ $fenctype = isset($this->enctype) ? " enctype=".$this->enctype." " : null;
+ $htmlForm = "<form $fname $fclass $fid action='".Url::getRoot($this->action)."' method='".$this->method."' $fenctype>\n";
$subset = (isset($subset)) ? explode(',',$subset) : array_keys($values);