@@ -59,24 +59,26 @@ |
||
59 | 59 | foreach ($values as $v){ |
60 | 60 | $form->addField($v); |
61 | 61 | } |
62 | - }else{ |
|
62 | + } else{ |
|
63 | 63 | $separators[]=$count; |
64 | 64 | for($i=0;$i<$size;$i++){ |
65 | 65 | $wrapper=null; |
66 | 66 | $fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]); |
67 | - if(isset($headers[$separators[$i]+1])) |
|
68 | - $form->addHeader($headers[$separators[$i]+1],4,true); |
|
67 | + if(isset($headers[$separators[$i]+1])) { |
|
68 | + $form->addHeader($headers[$separators[$i]+1],4,true); |
|
69 | + } |
|
69 | 70 | if(isset($wrappers[$separators[$i]+1])){ |
70 | 71 | $wrapper=$wrappers[$separators[$i]+1]; |
71 | 72 | } |
72 | 73 | //TODO check why $fields is empty |
73 | 74 | if(\sizeof($fields)===1){ |
74 | 75 | $added=$form->addField($fields[0]); |
75 | - }elseif(\sizeof($fields)>1){ |
|
76 | + } elseif(\sizeof($fields)>1){ |
|
76 | 77 | $added=$form->addFields($fields); |
77 | 78 | } |
78 | - if(isset($wrapper)) |
|
79 | - $added->wrap($wrapper[0],$wrapper[1]); |
|
79 | + if(isset($wrapper)) { |
|
80 | + $added->wrap($wrapper[0],$wrapper[1]); |
|
81 | + } |
|
80 | 82 | } |
81 | 83 | } |
82 | 84 | } |
@@ -9,8 +9,9 @@ discard block |
||
9 | 9 | use TextFieldsTrait; |
10 | 10 | |
11 | 11 | public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) { |
12 | - if(!isset($placeholder) && $type==="text") |
|
13 | - $placeholder=$label; |
|
12 | + if(!isset($placeholder) && $type==="text") { |
|
13 | + $placeholder=$label; |
|
14 | + } |
|
14 | 15 | parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label); |
15 | 16 | $this->_identifier=$identifier; |
16 | 17 | } |
@@ -18,8 +19,9 @@ discard block |
||
18 | 19 | public function getDataField(){ |
19 | 20 | $field= $this->getField(); |
20 | 21 | //TODO check getField |
21 | - if($field instanceof HtmlInput) |
|
22 | - $field=$field->getDataField(); |
|
22 | + if($field instanceof HtmlInput) { |
|
23 | + $field=$field->getDataField(); |
|
24 | + } |
|
23 | 25 | return $field; |
24 | 26 | } |
25 | 27 | } |
26 | 28 | \ No newline at end of file |
@@ -10,8 +10,9 @@ |
||
10 | 10 | use TextFieldsTrait; |
11 | 11 | |
12 | 12 | public function __construct($identifier, $label=NULL,$value=NULL,$placeholder=NULL,$rows=NULL) { |
13 | - if(!isset($placeholder)) |
|
14 | - $placeholder=$label; |
|
13 | + if(!isset($placeholder)) { |
|
14 | + $placeholder=$label; |
|
15 | + } |
|
15 | 16 | parent::__construct("field-".$identifier, new HtmlTextarea($identifier,$value,$placeholder,$rows), $label); |
16 | 17 | $this->_identifier=$identifier; |
17 | 18 | } |