@@ -18,8 +18,9 @@ discard block |
||
18 | 18 | parent::__construct($identifier, "div","field"); |
19 | 19 | $this->content=array(); |
20 | 20 | $this->_states=[State::ERROR,State::DISABLED]; |
21 | - if(isset($label)) |
|
22 | - $this->setLabel($label); |
|
21 | + if(isset($label)) { |
|
22 | + $this->setLabel($label); |
|
23 | + } |
|
23 | 24 | $this->setField($field); |
24 | 25 | $this->_validation=NULL; |
25 | 26 | } |
@@ -50,8 +51,9 @@ discard block |
||
50 | 51 | * @return mixed |
51 | 52 | */ |
52 | 53 | public function getLabel(){ |
53 | - if(\array_key_exists("label", $this->content)) |
|
54 | - return $this->content["label"]; |
|
54 | + if(\array_key_exists("label", $this->content)) { |
|
55 | + return $this->content["label"]; |
|
56 | + } |
|
55 | 57 | } |
56 | 58 | |
57 | 59 | /** |
@@ -34,8 +34,9 @@ |
||
34 | 34 | * @see BaseHtml::run() |
35 | 35 | */ |
36 | 36 | public function run(JsUtils $js) { |
37 | - if(isset($this->_bsComponent)===false) |
|
38 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
37 | + if(isset($this->_bsComponent)===false) { |
|
38 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
39 | + } |
|
39 | 40 | $this->addEventsOnRun($js); |
40 | 41 | return $this->_bsComponent; |
41 | 42 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function setActive($value=true){ |
12 | 12 | if($value){ |
13 | 13 | $this->addToPropertyCtrl("class", "active", ["active"]); |
14 | - }else{ |
|
14 | + } else{ |
|
15 | 15 | $this->removePropertyValue("class", "active"); |
16 | 16 | } |
17 | 17 | return $this; |
@@ -20,8 +20,9 @@ discard block |
||
20 | 20 | public function __construct($identifier, $width=NULL) { |
21 | 21 | parent::__construct($identifier, "div"); |
22 | 22 | $this->setClass("column"); |
23 | - if (isset($width)) |
|
24 | - $this->setWidth($width); |
|
23 | + if (isset($width)) { |
|
24 | + $this->setWidth($width); |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
@@ -48,10 +49,11 @@ discard block |
||
48 | 49 | |
49 | 50 | public function addDivider($vertical=true, $content=NULL) { |
50 | 51 | $divider=new HtmlDivider("", $content); |
51 | - if ($vertical) |
|
52 | - $divider->setVertical(); |
|
53 | - else |
|
54 | - $divider->setHorizontal(); |
|
52 | + if ($vertical) { |
|
53 | + $divider->setVertical(); |
|
54 | + } else { |
|
55 | + $divider->setHorizontal(); |
|
56 | + } |
|
55 | 57 | $this->wrap($divider,""); |
56 | 58 | return $divider; |
57 | 59 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $icon=@$content[0]; |
19 | 19 | $title=@$content[1]; |
20 | 20 | $desc=@$content[2]; |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | if(isset($title)){ |
30 | 30 | $this->setTitle($title,$desc); |
31 | 31 | } |
32 | - }else{ |
|
32 | + } else{ |
|
33 | 33 | $this->setContent($content); |
34 | 34 | } |
35 | 35 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $title=@$content[1]; |
18 | 18 | $desc=@$content[2]; |
19 | 19 | $status=@$content[3]; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | $desc=@$content["description"]; |
@@ -32,16 +32,17 @@ discard block |
||
32 | 32 | if(isset($title)){ |
33 | 33 | $this->setTitle($title,$desc); |
34 | 34 | } |
35 | - }else{ |
|
35 | + } else{ |
|
36 | 36 | $this->setContent($content); |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | 40 | public function setActive($value=true){ |
41 | - if($value) |
|
42 | - $this->setStatus(StepStatus::ACTIVE); |
|
43 | - else |
|
44 | - $this->setStatus(StepStatus::NONE); |
|
41 | + if($value) { |
|
42 | + $this->setStatus(StepStatus::ACTIVE); |
|
43 | + } else { |
|
44 | + $this->setStatus(StepStatus::NONE); |
|
45 | + } |
|
45 | 46 | return $this; |
46 | 47 | } |
47 | 48 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
27 | 27 | $this->addContent($iconO,$direction===Direction::LEFT); |
28 | 28 | $this->_hasIcon=true; |
29 | - }else{ |
|
29 | + } else{ |
|
30 | 30 | $iconO=$this->getIcon(); |
31 | 31 | $iconO->setIcon($icon); |
32 | 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | public function getIcon(){ |
38 | 38 | if(\is_array($this->content)){ |
39 | 39 | foreach ($this->content as $item){ |
40 | - if($item instanceof HtmlIcon) |
|
41 | - return $item; |
|
40 | + if($item instanceof HtmlIcon) { |
|
41 | + return $item; |
|
42 | + } |
|
42 | 43 | } |
43 | 44 | } |
44 | 45 | } |
@@ -24,10 +24,12 @@ discard block |
||
24 | 24 | if (isset($value)) { |
25 | 25 | $value=Javascript::prep_value($value); |
26 | 26 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
27 | - } else |
|
28 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
29 | - if ($immediatly) |
|
30 | - $this->jquery_code_for_compile[]=$str; |
|
27 | + } else { |
|
28 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
29 | + } |
|
30 | + if ($immediatly) { |
|
31 | + $this->jquery_code_for_compile[]=$str; |
|
32 | + } |
|
31 | 33 | return $str; |
32 | 34 | } |
33 | 35 | |
@@ -42,8 +44,9 @@ discard block |
||
42 | 44 | $element=Javascript::prep_element($element); |
43 | 45 | $value=Javascript::prep_value($value); |
44 | 46 | $str="$({$element}).after({$value});"; |
45 | - if ($immediatly) |
|
46 | - $this->jquery_code_for_compile[]=$str; |
|
47 | + if ($immediatly) { |
|
48 | + $this->jquery_code_for_compile[]=$str; |
|
49 | + } |
|
47 | 50 | return $str; |
48 | 51 | } |
49 | 52 | |
@@ -79,8 +82,9 @@ discard block |
||
79 | 82 | |
80 | 83 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
81 | 84 | |
82 | - if ($immediatly) |
|
83 | - $this->jquery_code_for_compile[]=$str; |
|
85 | + if ($immediatly) { |
|
86 | + $this->jquery_code_for_compile[]=$str; |
|
87 | + } |
|
84 | 88 | return $str; |
85 | 89 | } |
86 | 90 | |
@@ -105,8 +109,9 @@ discard block |
||
105 | 109 | |
106 | 110 | $str="$({$element}).fadeIn({$speed}{$callback});"; |
107 | 111 | |
108 | - if ($immediatly) |
|
109 | - $this->jquery_code_for_compile[]=$str; |
|
112 | + if ($immediatly) { |
|
113 | + $this->jquery_code_for_compile[]=$str; |
|
114 | + } |
|
110 | 115 | return $str; |
111 | 116 | } |
112 | 117 | |
@@ -131,8 +136,9 @@ discard block |
||
131 | 136 | |
132 | 137 | $str="$({$element}).fadeOut({$speed}{$callback});"; |
133 | 138 | |
134 | - if ($immediatly) |
|
135 | - $this->jquery_code_for_compile[]=$str; |
|
139 | + if ($immediatly) { |
|
140 | + $this->jquery_code_for_compile[]=$str; |
|
141 | + } |
|
136 | 142 | return $str; |
137 | 143 | } |
138 | 144 | |
@@ -157,8 +163,9 @@ discard block |
||
157 | 163 | |
158 | 164 | $str="$({$element}).hide({$speed}{$callback});"; |
159 | 165 | |
160 | - if ($immediatly) |
|
161 | - $this->jquery_code_for_compile[]=$str; |
|
166 | + if ($immediatly) { |
|
167 | + $this->jquery_code_for_compile[]=$str; |
|
168 | + } |
|
162 | 169 | return $str; |
163 | 170 | } |
164 | 171 | |
@@ -185,8 +192,9 @@ discard block |
||
185 | 192 | |
186 | 193 | $str="$({$element}).slideUp({$speed}{$callback});"; |
187 | 194 | |
188 | - if ($immediatly) |
|
189 | - $this->jquery_code_for_compile[]=$str; |
|
195 | + if ($immediatly) { |
|
196 | + $this->jquery_code_for_compile[]=$str; |
|
197 | + } |
|
190 | 198 | return $str; |
191 | 199 | } |
192 | 200 | |
@@ -211,8 +219,9 @@ discard block |
||
211 | 219 | |
212 | 220 | $str="$({$element}).slideDown({$speed}{$callback});"; |
213 | 221 | |
214 | - if ($immediatly) |
|
215 | - $this->jquery_code_for_compile[]=$str; |
|
222 | + if ($immediatly) { |
|
223 | + $this->jquery_code_for_compile[]=$str; |
|
224 | + } |
|
216 | 225 | return $str; |
217 | 226 | } |
218 | 227 | |
@@ -237,8 +246,9 @@ discard block |
||
237 | 246 | |
238 | 247 | $str="$({$element}).slideToggle({$speed}{$callback});"; |
239 | 248 | |
240 | - if ($immediatly) |
|
241 | - $this->jquery_code_for_compile[]=$str; |
|
249 | + if ($immediatly) { |
|
250 | + $this->jquery_code_for_compile[]=$str; |
|
251 | + } |
|
242 | 252 | return $str; |
243 | 253 | } |
244 | 254 | |
@@ -255,8 +265,9 @@ discard block |
||
255 | 265 | $element=Javascript::prep_element($element); |
256 | 266 | $str="$({$element}).toggle();"; |
257 | 267 | |
258 | - if ($immediatly) |
|
259 | - $this->jquery_code_for_compile[]=$str; |
|
268 | + if ($immediatly) { |
|
269 | + $this->jquery_code_for_compile[]=$str; |
|
270 | + } |
|
260 | 271 | return $str; |
261 | 272 | } |
262 | 273 | |
@@ -272,8 +283,9 @@ discard block |
||
272 | 283 | $element=Javascript::prep_element($element); |
273 | 284 | $str="$({$element}).trigger(\"$event\");"; |
274 | 285 | |
275 | - if ($immediatly) |
|
276 | - $this->jquery_code_for_compile[]=$str; |
|
286 | + if ($immediatly) { |
|
287 | + $this->jquery_code_for_compile[]=$str; |
|
288 | + } |
|
277 | 289 | return $str; |
278 | 290 | } |
279 | 291 | |
@@ -298,8 +310,9 @@ discard block |
||
298 | 310 | |
299 | 311 | $str="$({$element}).show({$speed}{$callback});"; |
300 | 312 | |
301 | - if ($immediatly) |
|
302 | - $this->jquery_code_for_compile[]=$str; |
|
313 | + if ($immediatly) { |
|
314 | + $this->jquery_code_for_compile[]=$str; |
|
315 | + } |
|
303 | 316 | return $str; |
304 | 317 | } |
305 | 318 | |
@@ -317,8 +330,9 @@ discard block |
||
317 | 330 | $str.="else{".$jsCodeIfFalse."}"; |
318 | 331 | } |
319 | 332 | |
320 | - if ($immediatly) |
|
321 | - $this->jquery_code_for_compile[]=$str; |
|
333 | + if ($immediatly) { |
|
334 | + $this->jquery_code_for_compile[]=$str; |
|
335 | + } |
|
322 | 336 | return $str; |
323 | 337 | } |
324 | 338 | |
@@ -335,11 +349,13 @@ discard block |
||
335 | 349 | public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
336 | 350 | $param=Javascript::prep_value($param); |
337 | 351 | $callback=""; |
338 | - if ($jsCallback!="") |
|
339 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
352 | + if ($jsCallback!="") { |
|
353 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
354 | + } |
|
340 | 355 | $script="$(".Javascript::prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
341 | - if ($immediatly) |
|
342 | - $this->jquery_code_for_compile[]=$script; |
|
356 | + if ($immediatly) { |
|
357 | + $this->jquery_code_for_compile[]=$script; |
|
358 | + } |
|
343 | 359 | return $script; |
344 | 360 | } |
345 | 361 | |
@@ -368,8 +384,9 @@ discard block |
||
368 | 384 | */ |
369 | 385 | public function _exec($js, $immediatly=false) { |
370 | 386 | $script=$js."\n"; |
371 | - if ($immediatly) |
|
372 | - $this->jquery_code_for_compile[]=$script; |
|
387 | + if ($immediatly) { |
|
388 | + $this->jquery_code_for_compile[]=$script; |
|
389 | + } |
|
373 | 390 | return $script; |
374 | 391 | } |
375 | 392 |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | foreach ( $this->events as $event => $jsCode ) { |
25 | 25 | if($event=="execute"){ |
26 | 26 | $this->jquery_code_for_compile []=$jsCode; |
27 | - }else if($event=="beforeExecute"){ |
|
27 | + } else if($event=="beforeExecute"){ |
|
28 | 28 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
29 | - }else{ |
|
29 | + } else{ |
|
30 | 30 | $selector=$this->attachTo; |
31 | 31 | if(isset($this->itemSelector)){ |
32 | 32 | $selector.=" ".$this->itemSelector; |
@@ -75,8 +75,9 @@ discard block |
||
75 | 75 | |
76 | 76 | protected function setParamCtrl($key, $value, $typeCtrl) { |
77 | 77 | if (\is_array($typeCtrl)) { |
78 | - if (array_search($value, $typeCtrl)===false) |
|
79 | - throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
78 | + if (array_search($value, $typeCtrl)===false) { |
|
79 | + throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
80 | + } |
|
80 | 81 | } else { |
81 | 82 | if (!$typeCtrl($value)) { |
82 | 83 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |