@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->wrapContent("<div class='content'>","</div>"); |
52 | 52 | if(\is_string($icon)){ |
53 | 53 | $this->icon=new HtmlIcon("icon-".$this->identifier, $icon); |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $this->icon=$icon; |
56 | 56 | } |
57 | 57 | return $this; |
@@ -64,10 +64,11 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | public function setDismissable($dismiss=true){ |
67 | - if($dismiss===true) |
|
68 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
69 | - else |
|
70 | - $this->close=NULL; |
|
67 | + if($dismiss===true) { |
|
68 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
69 | + } else { |
|
70 | + $this->close=NULL; |
|
71 | + } |
|
71 | 72 | return $this; |
72 | 73 | } |
73 | 74 | |
@@ -111,8 +112,9 @@ discard block |
||
111 | 112 | public function setMessage($message){ |
112 | 113 | if(\is_array($this->content)){ |
113 | 114 | $this->content[\sizeof($this->content)-1]=$message; |
114 | - }else |
|
115 | - $this->setContent($message); |
|
115 | + } else { |
|
116 | + $this->setContent($message); |
|
117 | + } |
|
116 | 118 | } |
117 | 119 | |
118 | 120 | } |
@@ -49,8 +49,9 @@ discard block |
||
49 | 49 | $retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data, textStatus, jqXHR ) {\n"; |
50 | 50 | $retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone,$ajaxTransition,$jsCallback)."});\n"; |
51 | 51 | $retour=$this->_addJsCondition($jsCondition,$retour); |
52 | - if ($immediatly) |
|
53 | - $this->jquery_code_for_compile[]=$retour; |
|
52 | + if ($immediatly) { |
|
53 | + $this->jquery_code_for_compile[]=$retour; |
|
54 | + } |
|
54 | 55 | return $retour; |
55 | 56 | } |
56 | 57 | |
@@ -86,12 +87,13 @@ discard block |
||
86 | 87 | if(JString::isNotNull($attr)){ |
87 | 88 | if ($attr==="value"){ |
88 | 89 | $retour.="url=url+'".$slash."'+$(this).val();\n"; |
89 | - }elseif ($attr==="html"){ |
|
90 | + } elseif ($attr==="html"){ |
|
90 | 91 | $retour.="url=url+'".$slash."'+$(this).html();\n"; |
91 | - }elseif(\substr($attr, 0,3)==="js:"){ |
|
92 | + } elseif(\substr($attr, 0,3)==="js:"){ |
|
92 | 93 | $retour.="url=url+'".$slash."'+".\substr($attr, 3).";\n"; |
93 | - }elseif($attr!==null && $attr!=="") |
|
94 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
94 | + } elseif($attr!==null && $attr!=="") { |
|
95 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
96 | + } |
|
95 | 97 | } |
96 | 98 | return $retour; |
97 | 99 | } |
@@ -101,13 +103,14 @@ discard block |
||
101 | 103 | if ($responseElement!=="") { |
102 | 104 | if(isset($ajaxTransition)){ |
103 | 105 | $call=$this->setAjaxDataCall($ajaxTransition); |
104 | - }elseif(isset($this->ajaxTransition)){ |
|
106 | + } elseif(isset($this->ajaxTransition)){ |
|
105 | 107 | $call=$this->ajaxTransition; |
106 | 108 | } |
107 | - if(\is_callable($call)) |
|
108 | - $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
109 | - else |
|
110 | - $retour="\t$({$responseElement}).{$jqueryDone}( data );\n"; |
|
109 | + if(\is_callable($call)) { |
|
110 | + $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
111 | + } else { |
|
112 | + $retour="\t$({$responseElement}).{$jqueryDone}( data );\n"; |
|
113 | + } |
|
111 | 114 | } |
112 | 115 | $retour.="\t".$jsCallback."\n"; |
113 | 116 | return $retour; |
@@ -121,8 +124,9 @@ discard block |
||
121 | 124 | } |
122 | 125 | |
123 | 126 | protected function _correctAjaxUrl($url) { |
124 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
125 | - $url=substr($url, 0, strlen($url)-1); |
|
127 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
128 | + $url=substr($url, 0, strlen($url)-1); |
|
129 | + } |
|
126 | 130 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
127 | 131 | $url=$this->getUrl($url); |
128 | 132 | } |
@@ -142,8 +146,9 @@ discard block |
||
142 | 146 | public static function _implodeParams($parameters){ |
143 | 147 | $allParameters=[]; |
144 | 148 | foreach ($parameters as $params){ |
145 | - if(isset($params)) |
|
146 | - $allParameters[]=self::_correctParams($params); |
|
149 | + if(isset($params)) { |
|
150 | + $allParameters[]=self::_correctParams($params); |
|
151 | + } |
|
147 | 152 | } |
148 | 153 | return \implode("+'&'+", $allParameters); |
149 | 154 | } |
@@ -172,8 +177,9 @@ discard block |
||
172 | 177 | |
173 | 178 | protected function setDefaultParameters(&$parameters,$default){ |
174 | 179 | foreach ($default as $k=>$v){ |
175 | - if(!isset($parameters[$k])) |
|
176 | - $parameters[$k]=$v; |
|
180 | + if(!isset($parameters[$k])) { |
|
181 | + $parameters[$k]=$v; |
|
182 | + } |
|
177 | 183 | } |
178 | 184 | } |
179 | 185 | |
@@ -244,8 +250,9 @@ discard block |
||
244 | 250 | $retour.="\t".$jsCallback."\n". |
245 | 251 | "\t$(document).trigger('jsonReady',[data]);\n". |
246 | 252 | "});\n"; |
247 | - if ($immediatly) |
|
248 | - $this->jquery_code_for_compile[]=$retour; |
|
253 | + if ($immediatly) { |
|
254 | + $this->jquery_code_for_compile[]=$retour; |
|
255 | + } |
|
249 | 256 | return $retour; |
250 | 257 | } |
251 | 258 | |
@@ -310,7 +317,7 @@ discard block |
||
310 | 317 | if($context===null){ |
311 | 318 | $parent="$('".$maskSelector."').parent()"; |
312 | 319 | $newElm = "$('#'+newId)"; |
313 | - }else{ |
|
320 | + } else{ |
|
314 | 321 | $parent=$context; |
315 | 322 | $newElm = $context.".find('#'+newId)"; |
316 | 323 | } |
@@ -323,8 +330,9 @@ discard block |
||
323 | 330 | $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"; |
324 | 331 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
325 | 332 | $retour.="\t".$jsCallback."\n"."});\n"; |
326 | - if ($immediatly) |
|
327 | - $this->jquery_code_for_compile[]=$retour; |
|
333 | + if ($immediatly) { |
|
334 | + $this->jquery_code_for_compile[]=$retour; |
|
335 | + } |
|
328 | 336 | return $retour; |
329 | 337 | } |
330 | 338 | |
@@ -527,8 +535,9 @@ discard block |
||
527 | 535 | $retour.="$('#".$form."').submit();\n"; |
528 | 536 | } |
529 | 537 | $retour=$this->_addJsCondition($jsCondition, $retour); |
530 | - if ($immediatly) |
|
531 | - $this->jquery_code_for_compile[]=$retour; |
|
538 | + if ($immediatly) { |
|
539 | + $this->jquery_code_for_compile[]=$retour; |
|
540 | + } |
|
532 | 541 | return $retour; |
533 | 542 | } |
534 | 543 |