@@ -112,15 +112,18 @@ discard block |
||
112 | 112 | $flag = false; |
113 | 113 | $index = 0; |
114 | 114 | while (! $flag && $index < sizeof($elements)) { |
115 | - if ($elements[$index] instanceof BaseHtml) |
|
116 | - $flag = ($callback($elements[$index])); |
|
115 | + if ($elements[$index] instanceof BaseHtml) { |
|
116 | + $flag = ($callback($elements[$index])); |
|
117 | + } |
|
117 | 118 | $index ++; |
118 | 119 | } |
119 | - if ($flag === true) |
|
120 | - return $elements[$index - 1]; |
|
120 | + if ($flag === true) { |
|
121 | + return $elements[$index - 1]; |
|
122 | + } |
|
121 | 123 | } elseif ($elements instanceof BaseHtml) { |
122 | - if ($callback($elements)) |
|
123 | - return $elements; |
|
124 | + if ($callback($elements)) { |
|
125 | + return $elements; |
|
126 | + } |
|
124 | 127 | } |
125 | 128 | return null; |
126 | 129 | } |
@@ -146,8 +149,9 @@ discard block |
||
146 | 149 | |
147 | 150 | public function fromArray($array) { |
148 | 151 | foreach ($this as $key => $value) { |
149 | - if (array_key_exists($key, $array) === true) |
|
150 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
152 | + if (array_key_exists($key, $array) === true) { |
|
153 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
154 | + } |
|
151 | 155 | } |
152 | 156 | foreach ($array as $key => $value) { |
153 | 157 | if ($this->_callSetter($key, $key, $value, $array) === false) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (isset($partial)) { |
68 | 68 | $ajaxParameters["xhr"] = "xhrProvider"; |
69 | 69 | $retour .= "var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.onreadystatechange = function (e) { if (3==e.target.readyState){let response=e.target.responseText;" . $partial . ";}; };"; |
70 | - }elseif (isset($upload)) { |
|
70 | + } elseif (isset($upload)) { |
|
71 | 71 | $ajaxParameters["xhr"] = "xhrProvider"; |
72 | 72 | $retour .= 'var xhr = $.ajaxSettings.xhr();function xhrProvider() {return xhr;};xhr.upload.addEventListener("progress", function(event) {if (event.lengthComputable) {'.$upload.'}}, false);'; |
73 | 73 | } |
@@ -165,10 +165,11 @@ discard block |
||
165 | 165 | } elseif (isset($this->ajaxTransition)) { |
166 | 166 | $call = $this->ajaxTransition; |
167 | 167 | } |
168 | - if (\is_callable($call)) |
|
169 | - $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
170 | - else |
|
171 | - $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
168 | + if (\is_callable($call)) { |
|
169 | + $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
170 | + } else { |
|
171 | + $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
172 | + } |
|
172 | 173 | } |
173 | 174 | if (isset($history)) { |
174 | 175 | if ($this->params["autoActiveLinks"]) { |
@@ -208,8 +209,9 @@ discard block |
||
208 | 209 | } |
209 | 210 | |
210 | 211 | protected function _correctAjaxUrl($url) { |
211 | - if ($url !== "/" && JString::endsWith($url, "/") === true) |
|
212 | - $url = substr($url, 0, strlen($url) - 1); |
|
212 | + if ($url !== "/" && JString::endsWith($url, "/") === true) { |
|
213 | + $url = substr($url, 0, strlen($url) - 1); |
|
214 | + } |
|
213 | 215 | if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) { |
214 | 216 | $url = $this->getUrl($url); |
215 | 217 | } |
@@ -233,8 +235,9 @@ discard block |
||
233 | 235 | public static function _implodeParams($parameters) { |
234 | 236 | $allParameters = []; |
235 | 237 | foreach ($parameters as $params) { |
236 | - if (isset($params)) |
|
237 | - $allParameters[] = self::_correctParams($params); |
|
238 | + if (isset($params)) { |
|
239 | + $allParameters[] = self::_correctParams($params); |
|
240 | + } |
|
238 | 241 | } |
239 | 242 | return \implode("+'&'+", $allParameters); |
240 | 243 | } |
@@ -268,8 +271,9 @@ discard block |
||
268 | 271 | |
269 | 272 | protected function setDefaultParameters(&$parameters, $default) { |
270 | 273 | foreach ($default as $k => $v) { |
271 | - if (! isset($parameters[$k])) |
|
272 | - $parameters[$k] = $v; |
|
274 | + if (! isset($parameters[$k])) { |
|
275 | + $parameters[$k] = $v; |
|
276 | + } |
|
273 | 277 | } |
274 | 278 | } |
275 | 279 | |
@@ -844,8 +848,9 @@ discard block |
||
844 | 848 | $retour .= "$('#'+" . $form . ").submit();\n"; |
845 | 849 | } |
846 | 850 | $retour = $this->_addJsCondition($jsCondition, $retour); |
847 | - if ($immediatly) |
|
848 | - $this->jquery_code_for_compile[] = $retour; |
|
851 | + if ($immediatly) { |
|
852 | + $this->jquery_code_for_compile[] = $retour; |
|
853 | + } |
|
849 | 854 | return $retour; |
850 | 855 | } |
851 | 856 |