From afc02bc1c3db9ffe8c9bf660c8aa08666752edfb Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 8 May 2011 15:26:22 +0000 Subject: h-source:added new EasyGiant SVN version --- h-source/Library/Form/Form.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'h-source/Library/Form/Form.php') 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 = "
\n"; + $fenctype = isset($this->enctype) ? " enctype=".$this->enctype." " : null; + $htmlForm = "\n"; $subset = (isset($subset)) ? explode(',',$subset) : array_keys($values); -- cgit v1.2.3