@@ -23,8 +23,9 @@ |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | public function getTabItem($index) { |
26 | - if ($index<sizeof($this->content)) |
|
27 | - return $this->content [$index]; |
|
26 | + if ($index<sizeof($this->content)) { |
|
27 | + return $this->content [$index]; |
|
28 | + } |
|
28 | 29 | } |
29 | 30 | |
30 | 31 | public function getTabItems() { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $result=null; |
44 | 44 | if($index<sizeof($this->cols)+1){ |
45 | 45 | $result=$this->cols[$index-1]; |
46 | - }else if ($force){ |
|
46 | + } else if ($force){ |
|
47 | 47 | $result=$this->addColAt(CssSize::SIZE_MD,1,$index); |
48 | 48 | } |
49 | 49 | return $result; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->cols = array_values($this->cols); |
97 | 97 | $width=$width-$widthCol; |
98 | 98 | } |
99 | - }else{ |
|
99 | + } else{ |
|
100 | 100 | $width=0; |
101 | 101 | } |
102 | 102 | } |
@@ -69,7 +69,8 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getPanel($index) { |
72 | - if ($index<sizeof($this->content)) |
|
73 | - return $this->content [$index]; |
|
72 | + if ($index<sizeof($this->content)) { |
|
73 | + return $this->content [$index]; |
|
74 | + } |
|
74 | 75 | } |
75 | 76 | } |
76 | 77 | \ No newline at end of file |
@@ -19,10 +19,12 @@ discard block |
||
19 | 19 | if (isset($value)) { |
20 | 20 | $value=$this->_prep_value($value); |
21 | 21 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
22 | - } else |
|
23 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
24 | - if ($immediatly) |
|
25 | - $this->jquery_code_for_compile[]=$str; |
|
22 | + } else { |
|
23 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
24 | + } |
|
25 | + if ($immediatly) { |
|
26 | + $this->jquery_code_for_compile[]=$str; |
|
27 | + } |
|
26 | 28 | return $str; |
27 | 29 | } |
28 | 30 | |
@@ -37,8 +39,9 @@ discard block |
||
37 | 39 | $element=$this->_prep_element($element); |
38 | 40 | $value=$this->_prep_value($value); |
39 | 41 | $str="$({$element}).after({$value});"; |
40 | - if ($immediatly) |
|
41 | - $this->jquery_code_for_compile[]=$str; |
|
42 | + if ($immediatly) { |
|
43 | + $this->jquery_code_for_compile[]=$str; |
|
44 | + } |
|
42 | 45 | return $str; |
43 | 46 | } |
44 | 47 | |
@@ -74,8 +77,9 @@ discard block |
||
74 | 77 | |
75 | 78 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
76 | 79 | |
77 | - if ($immediatly) |
|
78 | - $this->jquery_code_for_compile[]=$str; |
|
80 | + if ($immediatly) { |
|
81 | + $this->jquery_code_for_compile[]=$str; |
|
82 | + } |
|
79 | 83 | return $str; |
80 | 84 | } |
81 | 85 | |
@@ -100,8 +104,9 @@ discard block |
||
100 | 104 | |
101 | 105 | $str="$({$element}).fadeIn({$speed}{$callback});"; |
102 | 106 | |
103 | - if ($immediatly) |
|
104 | - $this->jquery_code_for_compile[]=$str; |
|
107 | + if ($immediatly) { |
|
108 | + $this->jquery_code_for_compile[]=$str; |
|
109 | + } |
|
105 | 110 | return $str; |
106 | 111 | } |
107 | 112 | |
@@ -126,8 +131,9 @@ discard block |
||
126 | 131 | |
127 | 132 | $str="$({$element}).fadeOut({$speed}{$callback});"; |
128 | 133 | |
129 | - if ($immediatly) |
|
130 | - $this->jquery_code_for_compile[]=$str; |
|
134 | + if ($immediatly) { |
|
135 | + $this->jquery_code_for_compile[]=$str; |
|
136 | + } |
|
131 | 137 | return $str; |
132 | 138 | } |
133 | 139 | |
@@ -152,8 +158,9 @@ discard block |
||
152 | 158 | |
153 | 159 | $str="$({$element}).hide({$speed}{$callback});"; |
154 | 160 | |
155 | - if ($immediatly) |
|
156 | - $this->jquery_code_for_compile[]=$str; |
|
161 | + if ($immediatly) { |
|
162 | + $this->jquery_code_for_compile[]=$str; |
|
163 | + } |
|
157 | 164 | return $str; |
158 | 165 | } |
159 | 166 | |
@@ -180,8 +187,9 @@ discard block |
||
180 | 187 | |
181 | 188 | $str="$({$element}).slideUp({$speed}{$callback});"; |
182 | 189 | |
183 | - if ($immediatly) |
|
184 | - $this->jquery_code_for_compile[]=$str; |
|
190 | + if ($immediatly) { |
|
191 | + $this->jquery_code_for_compile[]=$str; |
|
192 | + } |
|
185 | 193 | return $str; |
186 | 194 | } |
187 | 195 | |
@@ -206,8 +214,9 @@ discard block |
||
206 | 214 | |
207 | 215 | $str="$({$element}).slideDown({$speed}{$callback});"; |
208 | 216 | |
209 | - if ($immediatly) |
|
210 | - $this->jquery_code_for_compile[]=$str; |
|
217 | + if ($immediatly) { |
|
218 | + $this->jquery_code_for_compile[]=$str; |
|
219 | + } |
|
211 | 220 | return $str; |
212 | 221 | } |
213 | 222 | |
@@ -232,8 +241,9 @@ discard block |
||
232 | 241 | |
233 | 242 | $str="$({$element}).slideToggle({$speed}{$callback});"; |
234 | 243 | |
235 | - if ($immediatly) |
|
236 | - $this->jquery_code_for_compile[]=$str; |
|
244 | + if ($immediatly) { |
|
245 | + $this->jquery_code_for_compile[]=$str; |
|
246 | + } |
|
237 | 247 | return $str; |
238 | 248 | } |
239 | 249 | |
@@ -250,8 +260,9 @@ discard block |
||
250 | 260 | $element=$this->_prep_element($element); |
251 | 261 | $str="$({$element}).toggle();"; |
252 | 262 | |
253 | - if ($immediatly) |
|
254 | - $this->jquery_code_for_compile[]=$str; |
|
263 | + if ($immediatly) { |
|
264 | + $this->jquery_code_for_compile[]=$str; |
|
265 | + } |
|
255 | 266 | return $str; |
256 | 267 | } |
257 | 268 | |
@@ -267,8 +278,9 @@ discard block |
||
267 | 278 | $element=$this->_prep_element($element); |
268 | 279 | $str="$({$element}).trigger(\"$event\");"; |
269 | 280 | |
270 | - if ($immediatly) |
|
271 | - $this->jquery_code_for_compile[]=$str; |
|
281 | + if ($immediatly) { |
|
282 | + $this->jquery_code_for_compile[]=$str; |
|
283 | + } |
|
272 | 284 | return $str; |
273 | 285 | } |
274 | 286 | |
@@ -293,8 +305,9 @@ discard block |
||
293 | 305 | |
294 | 306 | $str="$({$element}).show({$speed}{$callback});"; |
295 | 307 | |
296 | - if ($immediatly) |
|
297 | - $this->jquery_code_for_compile[]=$str; |
|
308 | + if ($immediatly) { |
|
309 | + $this->jquery_code_for_compile[]=$str; |
|
310 | + } |
|
298 | 311 | return $str; |
299 | 312 | } |
300 | 313 | |
@@ -312,8 +325,9 @@ discard block |
||
312 | 325 | $str.="else{".$jsCodeIfFalse."}"; |
313 | 326 | } |
314 | 327 | |
315 | - if ($immediatly) |
|
316 | - $this->jquery_code_for_compile[]=$str; |
|
328 | + if ($immediatly) { |
|
329 | + $this->jquery_code_for_compile[]=$str; |
|
330 | + } |
|
317 | 331 | return $str; |
318 | 332 | } |
319 | 333 | |
@@ -330,11 +344,13 @@ discard block |
||
330 | 344 | public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
331 | 345 | $param=$this->_prep_value($param); |
332 | 346 | $callback=""; |
333 | - if ($jsCallback!="") |
|
334 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
347 | + if ($jsCallback!="") { |
|
348 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
349 | + } |
|
335 | 350 | $script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
336 | - if ($immediatly) |
|
337 | - $this->jquery_code_for_compile[]=$script; |
|
351 | + if ($immediatly) { |
|
352 | + $this->jquery_code_for_compile[]=$script; |
|
353 | + } |
|
338 | 354 | return $script; |
339 | 355 | } |
340 | 356 | |
@@ -363,8 +379,9 @@ discard block |
||
363 | 379 | */ |
364 | 380 | public function _exec($js, $immediatly=false) { |
365 | 381 | $script=$js."\n"; |
366 | - if ($immediatly) |
|
367 | - $this->jquery_code_for_compile[]=$script; |
|
382 | + if ($immediatly) { |
|
383 | + $this->jquery_code_for_compile[]=$script; |
|
384 | + } |
|
368 | 385 | return $script; |
369 | 386 | } |
370 | 387 |
@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | public function getParam($key) { |
41 | 41 | $value=null; |
42 | - if (array_key_exists($key, $this->params)) |
|
43 | - $value=$this->params [$key]; |
|
42 | + if (array_key_exists($key, $this->params)) { |
|
43 | + $value=$this->params [$key]; |
|
44 | + } |
|
44 | 45 | return $value; |
45 | 46 | } |
46 | 47 | |
@@ -49,16 +50,18 @@ discard block |
||
49 | 50 | } |
50 | 51 | |
51 | 52 | public function compile(JsUtils $js=NULL) { |
52 | - if ($js==NULL) |
|
53 | - $js=$this->js; |
|
53 | + if ($js==NULL) { |
|
54 | + $js=$this->js; |
|
55 | + } |
|
54 | 56 | $script=$this->getScript(); |
55 | 57 | $js->addToCompile($script); |
56 | 58 | } |
57 | 59 | |
58 | 60 | protected function setParamCtrl($key, $value, $typeCtrl) { |
59 | 61 | if (is_array($typeCtrl)) { |
60 | - if (array_search($value, $typeCtrl)===false) |
|
61 | - throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
62 | + if (array_search($value, $typeCtrl)===false) { |
|
63 | + throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
64 | + } |
|
62 | 65 | } else { |
63 | 66 | if (!$typeCtrl($value)) { |
64 | 67 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key); |
@@ -70,9 +73,9 @@ discard block |
||
70 | 73 | public function setParams($params) { |
71 | 74 | foreach ( $params as $k => $v ) { |
72 | 75 | $method="set".ucfirst($k); |
73 | - if (method_exists($this, $method)) |
|
74 | - $this->$method($v); |
|
75 | - else { |
|
76 | + if (method_exists($this, $method)) { |
|
77 | + $this->$method($v); |
|
78 | + } else { |
|
76 | 79 | $this->setParam($k, $v); |
77 | 80 | trigger_error("`".$k."` property n'existe pas", E_USER_NOTICE); |
78 | 81 | } |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function compile($internal=false) { |
44 | - if ($internal===false&&$this->autoCompile===true) |
|
45 | - throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
44 | + if ($internal===false&&$this->autoCompile===true) { |
|
45 | + throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
46 | + } |
|
46 | 47 | foreach ( $this->components as $component ) { |
47 | 48 | $component->compile(); |
48 | 49 | } |
@@ -53,13 +54,16 @@ discard block |
||
53 | 54 | } |
54 | 55 | |
55 | 56 | public function addComponent(SimpleComponent $component, $attachTo, $params) { |
56 | - if ($this->autoCompile) |
|
57 | - $this->components []=$component; |
|
58 | - if (isset($attachTo)) |
|
59 | - $component->attach($attachTo); |
|
60 | - if (isset($params)) |
|
61 | - if (is_array($params)) |
|
57 | + if ($this->autoCompile) { |
|
58 | + $this->components []=$component; |
|
59 | + } |
|
60 | + if (isset($attachTo)) { |
|
61 | + $component->attach($attachTo); |
|
62 | + } |
|
63 | + if (isset($params)) { |
|
64 | + if (is_array($params)) |
|
62 | 65 | $component->setParams($params); |
66 | + } |
|
63 | 67 | return $component; |
64 | 68 | } |
65 | 69 |
@@ -24,14 +24,14 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public static function getConstantValues($postFix="",$prefixBefore=false) { |
27 | - if ($postFix == "") |
|
28 | - return \array_values(self::getConstants()); |
|
29 | - else { |
|
27 | + if ($postFix == "") { |
|
28 | + return \array_values(self::getConstants()); |
|
29 | + } else { |
|
30 | 30 | if($prefixBefore===false){ |
31 | 31 | return \array_map(function ($elem) use($postFix) { |
32 | 32 | return $elem . " " . $postFix; |
33 | 33 | }, \array_values(self::getConstants())); |
34 | - }else{ |
|
34 | + } else{ |
|
35 | 35 | return \array_map(function ($elem) use($postFix) { |
36 | 36 | return $postFix." ".$elem; |
37 | 37 | }, \array_values(self::getConstants())); |
@@ -16,8 +16,9 @@ discard block |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | public function setValue($value) { |
19 | - if(isset($value)) |
|
20 | - $this->setProperty("value", $value); |
|
19 | + if(isset($value)) { |
|
20 | + $this->setProperty("value", $value); |
|
21 | + } |
|
21 | 22 | return $this; |
22 | 23 | } |
23 | 24 | |
@@ -27,11 +28,13 @@ discard block |
||
27 | 28 | |
28 | 29 | public function setPlaceholder($value){ |
29 | 30 | if(JString::isNull($value)){ |
30 | - if(JString::isNotNull($this->identifier)) |
|
31 | - $value=\ucfirst($this->identifier); |
|
31 | + if(JString::isNotNull($this->identifier)) { |
|
32 | + $value=\ucfirst($this->identifier); |
|
33 | + } |
|
34 | + } |
|
35 | + if(JString::isNotNull($value)) { |
|
36 | + $this->setProperty("placeholder", $value); |
|
32 | 37 | } |
33 | - if(JString::isNotNull($value)) |
|
34 | - $this->setProperty("placeholder", $value); |
|
35 | 38 | return $this; |
36 | 39 | } |
37 | 40 | } |
38 | 41 | \ No newline at end of file |
@@ -11,18 +11,21 @@ |
||
11 | 11 | parent::__construct($identifier, "textarea"); |
12 | 12 | $this->setValue($value); |
13 | 13 | $this->setPlaceholder($placeholder); |
14 | - if(isset($rows)) |
|
15 | - $this->setRows($rows); |
|
14 | + if(isset($rows)) { |
|
15 | + $this->setRows($rows); |
|
16 | + } |
|
16 | 17 | } |
17 | 18 | public function setValue($value) { |
18 | - if(isset($value)) |
|
19 | - $this->setContent($value); |
|
19 | + if(isset($value)) { |
|
20 | + $this->setContent($value); |
|
21 | + } |
|
20 | 22 | return $this; |
21 | 23 | } |
22 | 24 | |
23 | 25 | public function setPlaceholder($value){ |
24 | - if(JString::isNotNull($value)) |
|
25 | - $this->setProperty("placeholder", $value); |
|
26 | + if(JString::isNotNull($value)) { |
|
27 | + $this->setProperty("placeholder", $value); |
|
28 | + } |
|
26 | 29 | return $this; |
27 | 30 | } |
28 | 31 |