@@ -28,10 +28,11 @@ discard block |
||
28 | 28 | $this->setProperty("aria-describedby", $id); |
29 | 29 | $span->setContent($text); |
30 | 30 | $span->setClass("input-group-addon"); |
31 | - if (strtolower($position)==="left") |
|
32 | - $this->addonLeft=$span; |
|
33 | - else |
|
34 | - $this->addonRight=$span; |
|
31 | + if (strtolower($position)==="left") { |
|
32 | + $this->addonLeft=$span; |
|
33 | + } else { |
|
34 | + $this->addonRight=$span; |
|
35 | + } |
|
35 | 36 | return $span; |
36 | 37 | } |
37 | 38 | |
@@ -74,7 +75,7 @@ discard block |
||
74 | 75 | $bt=NULL; |
75 | 76 | if(is_string($item)){ |
76 | 77 | $bt=new HtmlButton($this->identifier."-bt-".$i++,$item); |
77 | - }elseif ($item instanceof HtmlButton){ |
|
78 | + } elseif ($item instanceof HtmlButton){ |
|
78 | 79 | $bt=$item; |
79 | 80 | } |
80 | 81 | if(isset($bt)){ |
@@ -88,10 +89,11 @@ discard block |
||
88 | 89 | $dropdown->setBtnCaption($caption); |
89 | 90 | $dropdown->fromArray($items); |
90 | 91 | |
91 | - if (strtolower($position)==="left") |
|
92 | - $this->addonLeft=$dropdown; |
|
93 | - else |
|
94 | - $this->addonRight=$dropdown; |
|
92 | + if (strtolower($position)==="left") { |
|
93 | + $this->addonLeft=$dropdown; |
|
94 | + } else { |
|
95 | + $this->addonRight=$dropdown; |
|
96 | + } |
|
95 | 97 | return $dropdown; |
96 | 98 | } |
97 | 99 | |
@@ -126,10 +128,12 @@ discard block |
||
126 | 128 | |
127 | 129 | public function run(JsUtils $js) { |
128 | 130 | parent::run($js); |
129 | - if (isset($this->addonLeft)) |
|
130 | - $this->addonLeft->run($js); |
|
131 | - if (isset($this->addonRight)) |
|
132 | - $this->addonRight->run($js); |
|
131 | + if (isset($this->addonLeft)) { |
|
132 | + $this->addonLeft->run($js); |
|
133 | + } |
|
134 | + if (isset($this->addonRight)) { |
|
135 | + $this->addonRight->run($js); |
|
136 | + } |
|
133 | 137 | } |
134 | 138 | |
135 | 139 | } |
136 | 140 | \ No newline at end of file |
@@ -40,8 +40,9 @@ |
||
40 | 40 | * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default" |
41 | 41 | */ |
42 | 42 | public function setStyle($cssStyle) { |
43 | - if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) |
|
44 | - $cssStyle="list-group-item".$cssStyle; |
|
43 | + if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) { |
|
44 | + $cssStyle="list-group-item".$cssStyle; |
|
45 | + } |
|
45 | 46 | $this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item")); |
46 | 47 | return $this->element; |
47 | 48 | } |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | if (is_array($elements)) { |
62 | 62 | foreach ( $elements as $key => $element ) { |
63 | 63 | $iid=$this->getElementsCount()+1; |
64 | - if ($element instanceof HtmlDropdownItem) |
|
65 | - $this->elements []=$element; |
|
66 | - else if (is_array($element)) { |
|
64 | + if ($element instanceof HtmlDropdownItem) { |
|
65 | + $this->elements []=$element; |
|
66 | + } else if (is_array($element)) { |
|
67 | 67 | if (is_string($key)===true) { |
68 | 68 | $dropdown=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
69 | 69 | $dropdown->addItems($element); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $li=new HtmlBsDoubleElement($this->identifier."-li-".$iid, "li"); |
90 | 90 | if($caption instanceof HtmlLink){ |
91 | 91 | $link=$caption; |
92 | - }else{ |
|
92 | + } else{ |
|
93 | 93 | $link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption); |
94 | 94 | } |
95 | 95 | $li->setContent($link); |
@@ -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 |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
43 | 43 | $retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n"; |
44 | - if ($immediatly) |
|
45 | - $this->jquery_code_for_compile[]=$retour; |
|
44 | + if ($immediatly) { |
|
45 | + $this->jquery_code_for_compile[]=$retour; |
|
46 | + } |
|
46 | 47 | return $retour; |
47 | 48 | } |
48 | 49 | |
@@ -50,13 +51,15 @@ discard block |
||
50 | 51 | $url=$this->_correctAjaxUrl($url); |
51 | 52 | $retour="url='".$url."';\n"; |
52 | 53 | $slash="/"; |
53 | - if(JString::endswith($url, "/")===true) |
|
54 | - $slash=""; |
|
54 | + if(JString::endswith($url, "/")===true) { |
|
55 | + $slash=""; |
|
56 | + } |
|
55 | 57 | if(JString::isNotNull($attr)){ |
56 | - if ($attr=="value") |
|
57 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
58 | - else if($attr!=null && $attr!=="") |
|
59 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
58 | + if ($attr=="value") { |
|
59 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
60 | + } else if($attr!=null && $attr!=="") { |
|
61 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
62 | + } |
|
60 | 63 | } |
61 | 64 | return $retour; |
62 | 65 | } |
@@ -78,8 +81,9 @@ discard block |
||
78 | 81 | } |
79 | 82 | |
80 | 83 | protected function _correctAjaxUrl($url) { |
81 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
82 | - $url=substr($url, 0, strlen($url)-1); |
|
84 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
85 | + $url=substr($url, 0, strlen($url)-1); |
|
86 | + } |
|
83 | 87 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
84 | 88 | $url=$this->jsUtils->getUrl($url); |
85 | 89 | } |
@@ -103,8 +107,9 @@ discard block |
||
103 | 107 | $retour.="\t".$jsCallback."\n". |
104 | 108 | "\t$(document).trigger('jsonReady',[data]);\n". |
105 | 109 | "});\n"; |
106 | - if ($immediatly) |
|
107 | - $this->jquery_code_for_compile[]=$retour; |
|
110 | + if ($immediatly) { |
|
111 | + $this->jquery_code_for_compile[]=$retour; |
|
112 | + } |
|
108 | 113 | return $retour; |
109 | 114 | } |
110 | 115 | |
@@ -143,7 +148,7 @@ discard block |
||
143 | 148 | if($context===null){ |
144 | 149 | $appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n"; |
145 | 150 | $newElm = "$('#'+newId)"; |
146 | - }else{ |
|
151 | + } else{ |
|
147 | 152 | $appendTo="\t\tnewElm.appendTo(".$context.");\n"; |
148 | 153 | $newElm = $context.".find('#'+newId)"; |
149 | 154 | } |
@@ -153,8 +158,9 @@ discard block |
||
153 | 158 | $retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('[['+key+']]')>-1){\n"."\t\t\t\tcontent=$(html.split('[['+key+']]').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n"; |
154 | 159 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
155 | 160 | $retour.="\t".$jsCallback."\n"."});\n"; |
156 | - if ($immediatly) |
|
157 | - $this->jquery_code_for_compile[]=$retour; |
|
161 | + if ($immediatly) { |
|
162 | + $this->jquery_code_for_compile[]=$retour; |
|
163 | + } |
|
158 | 164 | return $retour; |
159 | 165 | } |
160 | 166 | /** |
@@ -195,8 +201,9 @@ discard block |
||
195 | 201 | }});\n"; |
196 | 202 | $retour.="$('#".$form."').submit();\n"; |
197 | 203 | } |
198 | - if ($immediatly) |
|
199 | - $this->jquery_code_for_compile[]=$retour; |
|
204 | + if ($immediatly) { |
|
205 | + $this->jquery_code_for_compile[]=$retour; |
|
206 | + } |
|
200 | 207 | return $retour; |
201 | 208 | } |
202 | 209 |
@@ -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 |
@@ -23,10 +23,11 @@ discard block |
||
23 | 23 | foreach ( $this->events as $event => $jsCode ) { |
24 | 24 | if($event=="execute"){ |
25 | 25 | $this->jquery_code_for_compile []=$jsCode; |
26 | - }else if($event=="beforeExecute"){ |
|
26 | + } else if($event=="beforeExecute"){ |
|
27 | 27 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
28 | - }else |
|
29 | - $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
|
28 | + } else { |
|
29 | + $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | } |
32 | 33 | |
@@ -69,8 +70,9 @@ discard block |
||
69 | 70 | |
70 | 71 | protected function setParamCtrl($key, $value, $typeCtrl) { |
71 | 72 | if (is_array($typeCtrl)) { |
72 | - if (array_search($value, $typeCtrl)===false) |
|
73 | - 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)."}"); |
|
73 | + if (array_search($value, $typeCtrl)===false) { |
|
74 | + 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)."}"); |
|
75 | + } |
|
74 | 76 | } else { |
75 | 77 | if (!$typeCtrl($value)) { |
76 | 78 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |