@@ -444,8 +444,9 @@ discard block |
||
| 444 | 444 | $result = $this->getBody()->_addRow($result); |
| 445 | 445 | } |
| 446 | 446 | if (isset($this->_afterCompileEvents["onNewRow"])) { |
| 447 | - if (\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 448 | - $this->_afterCompileEvents["onNewRow"]($result, $object); |
|
| 447 | + if (\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 448 | + $this->_afterCompileEvents["onNewRow"]($result, $object); |
|
| 449 | + } |
|
| 449 | 450 | } |
| 450 | 451 | return $result; |
| 451 | 452 | } |
@@ -483,8 +484,9 @@ discard block |
||
| 483 | 484 | } |
| 484 | 485 | } |
| 485 | 486 | $result = parent::run($js); |
| 486 | - if (isset($this->_footer)) |
|
| 487 | - $this->_footer->run($js); |
|
| 487 | + if (isset($this->_footer)) { |
|
| 488 | + $this->_footer->run($js); |
|
| 489 | + } |
|
| 488 | 490 | $this->_runned = true; |
| 489 | 491 | return $result; |
| 490 | 492 | } |
@@ -538,8 +540,9 @@ discard block |
||
| 538 | 540 | |
| 539 | 541 | public function setColWidth($colIndex, $width) { |
| 540 | 542 | $part = $this->_getFirstPart(); |
| 541 | - if ($part !== null && $part->count() > 0) |
|
| 542 | - $part->getCell(0, $colIndex)->setWidth($width); |
|
| 543 | + if ($part !== null && $part->count() > 0) { |
|
| 544 | + $part->getCell(0, $colIndex)->setWidth($width); |
|
| 545 | + } |
|
| 543 | 546 | return $this; |
| 544 | 547 | } |
| 545 | 548 | |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) { |
| 36 | 36 | parent::__construct($identifier, $tagName, ""); |
| 37 | - if (isset($rowCount) && isset($colCount)) |
|
| 38 | - $this->setRowCount($rowCount, $colCount); |
|
| 37 | + if (isset($rowCount) && isset($colCount)) { |
|
| 38 | + $this->setRowCount($rowCount, $colCount); |
|
| 39 | + } |
|
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | /** |
@@ -198,10 +199,11 @@ discard block |
||
| 198 | 199 | $values = \array_fill(0, $count, $values); |
| 199 | 200 | $isArray = false; |
| 200 | 201 | } |
| 201 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 202 | - $values = [ |
|
| 202 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 203 | + $values = [ |
|
| 203 | 204 | $values |
| 204 | 205 | ]; |
| 206 | + } |
|
| 205 | 207 | |
| 206 | 208 | $count = \min(\sizeof($values), $count); |
| 207 | 209 | |
@@ -228,8 +230,9 @@ discard block |
||
| 228 | 230 | $count = $this->count(); |
| 229 | 231 | for ($i = 0; $i < $count; $i ++) { |
| 230 | 232 | $cell = $this->getCell($i, $colIndex); |
| 231 | - if ($cell instanceof BaseTrait) |
|
| 232 | - $cell->addVariations($variations); |
|
| 233 | + if ($cell instanceof BaseTrait) { |
|
| 234 | + $cell->addVariations($variations); |
|
| 235 | + } |
|
| 233 | 236 | } |
| 234 | 237 | return $this; |
| 235 | 238 | } |
@@ -238,8 +241,9 @@ discard block |
||
| 238 | 241 | $count = $this->count(); |
| 239 | 242 | for ($i = 0; $i < $count; $i ++) { |
| 240 | 243 | $cell = $this->getCell($i, $colIndex); |
| 241 | - if (isset($cell)) |
|
| 242 | - $cell->addToProperty($name, $value); |
|
| 244 | + if (isset($cell)) { |
|
| 245 | + $cell->addToProperty($name, $value); |
|
| 246 | + } |
|
| 243 | 247 | } |
| 244 | 248 | return $this; |
| 245 | 249 | } |
@@ -273,8 +277,9 @@ discard block |
||
| 273 | 277 | $maxRow = $this->content[$i]->count(); |
| 274 | 278 | $index = $maxRow - $colIndex - 1; |
| 275 | 279 | if (($cell = $this->getCell($i, $index)) !== NULL) { |
| 276 | - if ($cell->getColspan() == 1) |
|
| 277 | - $cell->$function(); |
|
| 280 | + if ($cell->getColspan() == 1) { |
|
| 281 | + $cell->$function(); |
|
| 282 | + } |
|
| 278 | 283 | } |
| 279 | 284 | } |
| 280 | 285 | return $this; |
@@ -320,8 +325,9 @@ discard block |
||
| 320 | 325 | */ |
| 321 | 326 | public function getColCount() { |
| 322 | 327 | $result = 0; |
| 323 | - if ($this->count() > 0) |
|
| 324 | - $result = $this->getItem(0)->count(); |
|
| 328 | + if ($this->count() > 0) { |
|
| 329 | + $result = $this->getItem(0)->count(); |
|
| 330 | + } |
|
| 325 | 331 | return $result; |
| 326 | 332 | } |
| 327 | 333 | |
@@ -346,15 +352,17 @@ discard block |
||
| 346 | 352 | |
| 347 | 353 | public function toDelete($rowIndex, $colIndex) { |
| 348 | 354 | $row = $this->getItem($rowIndex); |
| 349 | - if (isset($row) === true) |
|
| 350 | - $row->toDelete($colIndex); |
|
| 355 | + if (isset($row) === true) { |
|
| 356 | + $row->toDelete($colIndex); |
|
| 357 | + } |
|
| 351 | 358 | return $this; |
| 352 | 359 | } |
| 353 | 360 | |
| 354 | 361 | public function toRowspanned($rowIndex, $colIndex) { |
| 355 | 362 | $row = $this->getItem($rowIndex); |
| 356 | - if (isset($row) === true) |
|
| 357 | - $row->toRowspanned($colIndex); |
|
| 363 | + if (isset($row) === true) { |
|
| 364 | + $row->toRowspanned($colIndex); |
|
| 365 | + } |
|
| 358 | 366 | return $this; |
| 359 | 367 | } |
| 360 | 368 | |
@@ -464,8 +472,9 @@ discard block |
||
| 464 | 472 | foreach ($rows as $row) { |
| 465 | 473 | $cell = $row->getItem($colIndex); |
| 466 | 474 | $value = $cell->getContent(); |
| 467 | - if ($functionExists) |
|
| 468 | - $value = \call_user_func($function, $value); |
|
| 475 | + if ($functionExists) { |
|
| 476 | + $value = \call_user_func($function, $value); |
|
| 477 | + } |
|
| 469 | 478 | if ($value !== $identiqual) { |
| 470 | 479 | if ($counter > 0 && isset($cellToMerge)) { |
| 471 | 480 | $cellToMerge->setRowspanned($counter); |
@@ -14,16 +14,18 @@ |
||
| 14 | 14 | const TOGGLE_INTERVAL = 2; |
| 15 | 15 | |
| 16 | 16 | public function __construct($identifier, $label = NULL, $type = "text", $value = NULL, $placeholder = NULL) { |
| 17 | - if (! isset($placeholder) && $type === "text") |
|
| 18 | - $placeholder = $label; |
|
| 17 | + if (! isset($placeholder) && $type === "text") { |
|
| 18 | + $placeholder = $label; |
|
| 19 | + } |
|
| 19 | 20 | parent::__construct("field-" . $identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label); |
| 20 | 21 | $this->_identifier = $identifier; |
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | public function getDataField() { |
| 24 | 25 | $field = $this->getField(); |
| 25 | - if ($field instanceof HtmlInput) |
|
| 26 | - $field = $field->getDataField(); |
|
| 26 | + if ($field instanceof HtmlInput) { |
|
| 27 | + $field = $field->getDataField(); |
|
| 28 | + } |
|
| 27 | 29 | return $field; |
| 28 | 30 | } |
| 29 | 31 | |
@@ -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 | |
@@ -19,8 +19,9 @@ discard block |
||
| 19 | 19 | * @param mixed $view |
| 20 | 20 | */ |
| 21 | 21 | protected function _compileLibrary(BaseGui $library, &$view = NULL) { |
| 22 | - if (isset($view)) |
|
| 23 | - $library->compileHtml($this, $view); |
|
| 22 | + if (isset($view)) { |
|
| 23 | + $library->compileHtml($this, $view); |
|
| 24 | + } |
|
| 24 | 25 | if ($library->isAutoCompile()) { |
| 25 | 26 | $library->compile(true); |
| 26 | 27 | } |
@@ -39,8 +40,9 @@ discard block |
||
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | protected function minify($input) { |
| 42 | - if (trim($input) === "") |
|
| 43 | - return $input; |
|
| 43 | + if (trim($input) === "") { |
|
| 44 | + return $input; |
|
| 45 | + } |
|
| 44 | 46 | $input = preg_replace(array( |
| 45 | 47 | // Remove comment(s) |
| 46 | 48 | '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#', |