@@ -51,14 +51,15 @@ |
||
51 | 51 | foreach ($values as $v){ |
52 | 52 | $form->addField($v); |
53 | 53 | } |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $separators[]=$count; |
56 | 56 | for($i=0;$i<$size-1;$i++){ |
57 | 57 | $fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]); |
58 | 58 | if(\sizeof($fields)===1){ |
59 | 59 | $form->addField($fields[0]); |
60 | - }else |
|
61 | - $form->addFields($fields); |
|
60 | + } else { |
|
61 | + $form->addFields($fields); |
|
62 | + } |
|
62 | 63 | } |
63 | 64 | } |
64 | 65 | } |
@@ -9,16 +9,18 @@ |
||
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 | } |
16 | 17 | |
17 | 18 | public function getDataField(){ |
18 | 19 | $field= $this->getField(); |
19 | 20 | //TODO check getField |
20 | - if($field instanceof HtmlInput) |
|
21 | - $field=$field->getDataField(); |
|
21 | + if($field instanceof HtmlInput) { |
|
22 | + $field=$field->getDataField(); |
|
23 | + } |
|
22 | 24 | return $field; |
23 | 25 | } |
24 | 26 | } |
25 | 27 | \ No newline at end of file |
@@ -17,8 +17,9 @@ |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public function setInputType($type){ |
20 | - if($type==="hidden") |
|
21 | - $this->addToProperty("style","display:none;"); |
|
20 | + if($type==="hidden") { |
|
21 | + $this->addToProperty("style","display:none;"); |
|
22 | + } |
|
22 | 23 | $this->getDataField()->setInputType($type); |
23 | 24 | return $this; |
24 | 25 | } |
@@ -62,10 +62,11 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | public function setDismissable($dismiss=true){ |
65 | - if($dismiss===true) |
|
66 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
67 | - else |
|
68 | - $this->close=NULL; |
|
65 | + if($dismiss===true) { |
|
66 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
67 | + } else { |
|
68 | + $this->close=NULL; |
|
69 | + } |
|
69 | 70 | return $this; |
70 | 71 | } |
71 | 72 | |
@@ -100,7 +101,8 @@ discard block |
||
100 | 101 | public function setMessage($message){ |
101 | 102 | if(\is_array($this->content)){ |
102 | 103 | $this->content[\sizeof($this->content)-1]=$message; |
103 | - }else |
|
104 | - $this->setContent($message); |
|
104 | + } else { |
|
105 | + $this->setContent($message); |
|
106 | + } |
|
105 | 107 | } |
106 | 108 | } |
107 | 109 | \ No newline at end of file |
@@ -52,8 +52,9 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function addHeader($title, $niveau=1, $dividing=true) { |
54 | 54 | $header=new HtmlHeader("", $niveau, $title); |
55 | - if ($dividing) |
|
56 | - $header->setDividing(); |
|
55 | + if ($dividing) { |
|
56 | + $header->setDividing(); |
|
57 | + } |
|
57 | 58 | return $this->addItem($header); |
58 | 59 | } |
59 | 60 | |
@@ -74,14 +75,16 @@ discard block |
||
74 | 75 | if (\is_string($end)) { |
75 | 76 | $label=$end; |
76 | 77 | \array_pop($fields); |
77 | - } else |
|
78 | - $label=NULL; |
|
78 | + } else { |
|
79 | + $label=NULL; |
|
80 | + } |
|
79 | 81 | } |
80 | 82 | $this->_fields=\array_merge($this->_fields, $fields); |
81 | 83 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields); |
82 | 84 | } |
83 | - if (isset($label)) |
|
84 | - $fields=new HtmlFormField("", $fields, $label); |
|
85 | + if (isset($label)) { |
|
86 | + $fields=new HtmlFormField("", $fields, $label); |
|
87 | + } |
|
85 | 88 | } else { |
86 | 89 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count()); |
87 | 90 | } |
@@ -134,12 +137,15 @@ discard block |
||
134 | 137 | */ |
135 | 138 | public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) { |
136 | 139 | $message=new HtmlMessage($identifier, $content); |
137 | - if (isset($header)) |
|
138 | - $message->addHeader($header); |
|
139 | - if (isset($icon)) |
|
140 | - $message->setIcon($icon); |
|
141 | - if (isset($type)) |
|
142 | - $message->setStyle($type); |
|
140 | + if (isset($header)) { |
|
141 | + $message->addHeader($header); |
|
142 | + } |
|
143 | + if (isset($icon)) { |
|
144 | + $message->setIcon($icon); |
|
145 | + } |
|
146 | + if (isset($type)) { |
|
147 | + $message->setStyle($type); |
|
148 | + } |
|
143 | 149 | return $this->addItem($message); |
144 | 150 | } |
145 | 151 | |
@@ -156,23 +162,26 @@ discard block |
||
156 | 162 | } |
157 | 163 | |
158 | 164 | public function compile(JsUtils $js=NULL,&$view=NULL){ |
159 | - if(\sizeof($this->_validationParams)>0) |
|
160 | - $this->setProperty("novalidate", ""); |
|
165 | + if(\sizeof($this->_validationParams)>0) { |
|
166 | + $this->setProperty("novalidate", ""); |
|
167 | + } |
|
161 | 168 | return parent::compile($js,$view); |
162 | 169 | } |
163 | 170 | |
164 | 171 | public function run(JsUtils $js) { |
165 | 172 | $compo=NULL; |
166 | 173 | foreach ($this->_fields as $field){ |
167 | - if($field instanceof HtmlFormField) |
|
168 | - $compo=$this->addCompoValidation($js, $compo, $field); |
|
174 | + if($field instanceof HtmlFormField) { |
|
175 | + $compo=$this->addCompoValidation($js, $compo, $field); |
|
176 | + } |
|
169 | 177 | } |
170 | 178 | foreach ($this->content as $field){ |
171 | 179 | if($field instanceof HtmlFormFields){ |
172 | 180 | $items=$field->getItems(); |
173 | 181 | foreach ($items as $_field){ |
174 | - if($_field instanceof HtmlFormField) |
|
175 | - $compo=$this->addCompoValidation($js, $compo, $_field); |
|
182 | + if($_field instanceof HtmlFormField) { |
|
183 | + $compo=$this->addCompoValidation($js, $compo, $_field); |
|
184 | + } |
|
176 | 185 | } |
177 | 186 | } |
178 | 187 | } |
@@ -47,9 +47,9 @@ |
||
47 | 47 | $rules=$attributes["rules"]; |
48 | 48 | if(\is_array($rules)){ |
49 | 49 | $element->addRules($rules); |
50 | + } else { |
|
51 | + $element->addRule($rules); |
|
50 | 52 | } |
51 | - else |
|
52 | - $element->addRule($rules); |
|
53 | 53 | unset($attributes["rules"]); |
54 | 54 | } |
55 | 55 | } |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | $name=$attributes["name"]; |
36 | 36 | } |
37 | 37 | $element=$elementCallback($this->_getFieldIdentifier($prefix),$name,$value,""); |
38 | - if(\is_array($attributes)) |
|
39 | - $this->_applyAttributes($element, $attributes,$index); |
|
38 | + if(\is_array($attributes)) { |
|
39 | + $this->_applyAttributes($element, $attributes,$index); |
|
40 | + } |
|
40 | 41 | return $element; |
41 | 42 | }); |
42 | 43 | return $this; |
@@ -70,8 +71,9 @@ discard block |
||
70 | 71 | public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){ |
71 | 72 | return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){ |
72 | 73 | $header=new HtmlHeader($id,$niveau,$value); |
73 | - if(isset($icon)) |
|
74 | - $header->asIcon($icon, $value); |
|
74 | + if(isset($icon)) { |
|
75 | + $header->asIcon($icon, $value); |
|
76 | + } |
|
75 | 77 | return $header; |
76 | 78 | }, $index,$attributes,"header"); |
77 | 79 | } |
@@ -79,7 +81,9 @@ discard block |
||
79 | 81 | |
80 | 82 | public function fieldAsImage($index,$size=Size::MINI,$circular=false){ |
81 | 83 | $this->setValueFunction($index,function($img) use($size,$circular){ |
82 | - $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular(); |
|
84 | + $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) { |
|
85 | + $image->setCircular(); |
|
86 | + } |
|
83 | 87 | return $image; |
84 | 88 | }); |
85 | 89 | return $this; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | if(\sizeof($this->_compileParts)<3){ |
233 | 233 | $this->_template="%content%"; |
234 | 234 | $this->refresh(); |
235 | - }else{ |
|
235 | + } else{ |
|
236 | 236 | if ($this->propertyContains("class", "sortable")) { |
237 | 237 | $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
238 | 238 | } |
@@ -255,8 +255,9 @@ discard block |
||
255 | 255 | $result= $this->getBody()->_addRow($result); |
256 | 256 | } |
257 | 257 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
258 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
259 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
258 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
259 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
260 | + } |
|
260 | 261 | } |
261 | 262 | return $result; |
262 | 263 | } |
@@ -277,8 +278,9 @@ discard block |
||
277 | 278 | |
278 | 279 | public function run(JsUtils $js){ |
279 | 280 | $result= parent::run($js); |
280 | - if(isset($this->_footer)) |
|
281 | - $this->_footer->run($js); |
|
281 | + if(isset($this->_footer)) { |
|
282 | + $this->_footer->run($js); |
|
283 | + } |
|
282 | 284 | return $result; |
283 | 285 | } |
284 | 286 |
@@ -17,8 +17,9 @@ |
||
17 | 17 | |
18 | 18 | public function setBasic($very=false) { |
19 | 19 | $table=$this->getTable(); |
20 | - if ($very) |
|
21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
20 | + if ($very) { |
|
21 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
22 | + } |
|
22 | 23 | return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
23 | 24 | } |
24 | 25 |