@@ -63,8 +63,9 @@ discard block |
||
63 | 63 | $retour .= $this->_getOnAjaxDone($responseElement, $jqueryDone, $ajaxTransition, $jsCallback, $hasLoader, ($historize ? $originalSelector : null)) . "});\n"; |
64 | 64 | |
65 | 65 | $retour = $this->_addJsCondition($jsCondition, $retour); |
66 | - if ($immediatly) |
|
67 | - $this->jquery_code_for_compile[] = $retour; |
|
66 | + if ($immediatly) { |
|
67 | + $this->jquery_code_for_compile[] = $retour; |
|
68 | + } |
|
68 | 69 | return $retour; |
69 | 70 | } |
70 | 71 | |
@@ -119,8 +120,9 @@ discard block |
||
119 | 120 | $retour .= "url=url+'" . $slash . "'+$(this).html();\n"; |
120 | 121 | } elseif (\substr($attr, 0, 3) === "js:") { |
121 | 122 | $retour .= "url=url+'" . $slash . "'+" . \substr($attr, 3) . ";\n"; |
122 | - } elseif ($attr !== null && $attr !== "") |
|
123 | - $retour .= "url=url+'" . $slash . "'+($(this).attr('" . $attr . "')||'');\n"; |
|
123 | + } elseif ($attr !== null && $attr !== "") { |
|
124 | + $retour .= "url=url+'" . $slash . "'+($(this).attr('" . $attr . "')||'');\n"; |
|
125 | + } |
|
124 | 126 | } |
125 | 127 | return $retour; |
126 | 128 | } |
@@ -144,10 +146,11 @@ discard block |
||
144 | 146 | } elseif (isset($this->ajaxTransition)) { |
145 | 147 | $call = $this->ajaxTransition; |
146 | 148 | } |
147 | - if (\is_callable($call)) |
|
148 | - $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
149 | - else |
|
150 | - $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
149 | + if (\is_callable($call)) { |
|
150 | + $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
151 | + } else { |
|
152 | + $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
153 | + } |
|
151 | 154 | } |
152 | 155 | if (isset($history)) { |
153 | 156 | if ($this->params["autoActiveLinks"]) { |
@@ -170,8 +173,9 @@ discard block |
||
170 | 173 | } |
171 | 174 | |
172 | 175 | protected function _correctAjaxUrl($url) { |
173 | - if ($url !== "/" && JString::endsWith($url, "/") === true) |
|
174 | - $url = substr($url, 0, strlen($url) - 1); |
|
176 | + if ($url !== "/" && JString::endsWith($url, "/") === true) { |
|
177 | + $url = substr($url, 0, strlen($url) - 1); |
|
178 | + } |
|
175 | 179 | if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) { |
176 | 180 | $url = $this->getUrl($url); |
177 | 181 | } |
@@ -195,8 +199,9 @@ discard block |
||
195 | 199 | public static function _implodeParams($parameters) { |
196 | 200 | $allParameters = []; |
197 | 201 | foreach ($parameters as $params) { |
198 | - if (isset($params)) |
|
199 | - $allParameters[] = self::_correctParams($params); |
|
202 | + if (isset($params)) { |
|
203 | + $allParameters[] = self::_correctParams($params); |
|
204 | + } |
|
200 | 205 | } |
201 | 206 | return \implode("+'&'+", $allParameters); |
202 | 207 | } |
@@ -222,8 +227,9 @@ discard block |
||
222 | 227 | |
223 | 228 | protected function setDefaultParameters(&$parameters, $default) { |
224 | 229 | foreach ($default as $k => $v) { |
225 | - if (! isset($parameters[$k])) |
|
226 | - $parameters[$k] = $v; |
|
230 | + if (! isset($parameters[$k])) { |
|
231 | + $parameters[$k] = $v; |
|
232 | + } |
|
227 | 233 | } |
228 | 234 | } |
229 | 235 | |
@@ -755,8 +761,9 @@ discard block |
||
755 | 761 | $retour .= "$('#" . $form . "').submit();\n"; |
756 | 762 | } |
757 | 763 | $retour = $this->_addJsCondition($jsCondition, $retour); |
758 | - if ($immediatly) |
|
759 | - $this->jquery_code_for_compile[] = $retour; |
|
764 | + if ($immediatly) { |
|
765 | + $this->jquery_code_for_compile[] = $retour; |
|
766 | + } |
|
760 | 767 | return $retour; |
761 | 768 | } |
762 | 769 |
@@ -24,10 +24,11 @@ discard block |
||
24 | 24 | |
25 | 25 | public function setBasic($very = false) { |
26 | 26 | $table = $this->_self; |
27 | - if ($very) |
|
28 | - $table->addToPropertyCtrl("class", "very", array( |
|
27 | + if ($very) { |
|
28 | + $table->addToPropertyCtrl("class", "very", array( |
|
29 | 29 | "very" |
30 | 30 | )); |
31 | + } |
|
31 | 32 | return $table->addToPropertyCtrl("class", "basic", array( |
32 | 33 | "basic" |
33 | 34 | )); |
@@ -35,10 +36,11 @@ discard block |
||
35 | 36 | |
36 | 37 | public function setCompact($very = false) { |
37 | 38 | $table = $this->_self; |
38 | - if ($very) |
|
39 | - $table->addToPropertyCtrl("class", "very", array( |
|
39 | + if ($very) { |
|
40 | + $table->addToPropertyCtrl("class", "very", array( |
|
40 | 41 | "very" |
41 | 42 | )); |
43 | + } |
|
42 | 44 | return $table->addToPropertyCtrl("class", "compact", array( |
43 | 45 | "compact" |
44 | 46 | )); |
@@ -72,8 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | protected function getItemToAdd($item) { |
74 | 74 | $itemO = parent::getItemToAdd($item); |
75 | - if ($itemO instanceof AbstractCheckbox) |
|
76 | - $itemO->addClass("item"); |
|
75 | + if ($itemO instanceof AbstractCheckbox) { |
|
76 | + $itemO->addClass("item"); |
|
77 | + } |
|
77 | 78 | return $itemO; |
78 | 79 | } |
79 | 80 | |
@@ -179,8 +180,9 @@ discard block |
||
179 | 180 | if (isset($masterItem)) { |
180 | 181 | if (\is_array($masterItem)) { |
181 | 182 | $masterO = new HtmlFormCheckbox("master-" . $identifier, @$masterItem[0], @$masterItem[1]); |
182 | - if (isset($name)) |
|
183 | - $masterO->setName($name); |
|
183 | + if (isset($name)) { |
|
184 | + $masterO->setName($name); |
|
185 | + } |
|
184 | 186 | if (isset($masterItem[1])) { |
185 | 187 | if (\array_search($masterItem[1], $values) !== false) { |
186 | 188 | $masterO->getDataField()->setProperty("checked", ""); |
@@ -204,8 +206,9 @@ discard block |
||
204 | 206 | if (\array_search($val, $values) !== false) { |
205 | 207 | $itemO->getDataField()->setProperty("checked", ""); |
206 | 208 | } |
207 | - if (isset($name)) |
|
208 | - $itemO->setName($name); |
|
209 | + if (isset($name)) { |
|
210 | + $itemO->setName($name); |
|
211 | + } |
|
209 | 212 | $itemO->setClass("item"); |
210 | 213 | $fields[] = $itemO; |
211 | 214 | } |
@@ -151,25 +151,29 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | public function getColPosition($colIndex) { |
154 | - if ($this->_container->_isMerged() !== true) |
|
155 | - return $colIndex; |
|
154 | + if ($this->_container->_isMerged() !== true) { |
|
155 | + return $colIndex; |
|
156 | + } |
|
156 | 157 | $pos = 0; |
157 | 158 | $rows = $this->_container->getContent(); |
158 | 159 | for ($i = 0; $i < $this->_row; $i ++) { |
159 | 160 | $max = \min($colIndex, $rows[$i]->count()); |
160 | 161 | for ($j = 0; $j < $max; $j ++) { |
161 | 162 | $rowspan = $rows[$i]->getItem($j)->getRowspan(); |
162 | - if ($rowspan + $i > $this->_row) |
|
163 | - $pos ++; |
|
163 | + if ($rowspan + $i > $this->_row) { |
|
164 | + $pos ++; |
|
165 | + } |
|
164 | 166 | } |
165 | 167 | } |
166 | - if ($pos > $colIndex) |
|
167 | - return NULL; |
|
168 | + if ($pos > $colIndex) { |
|
169 | + return NULL; |
|
170 | + } |
|
168 | 171 | $count = $this->count(); |
169 | 172 | for ($i = 0; $i < $count; $i ++) { |
170 | 173 | $pos += $this->content[$i]->getColspan(); |
171 | - if ($pos >= $colIndex + 1) |
|
172 | - return $i; |
|
174 | + if ($pos >= $colIndex + 1) { |
|
175 | + return $i; |
|
176 | + } |
|
173 | 177 | } |
174 | 178 | return null; |
175 | 179 | } |
@@ -192,8 +196,9 @@ discard block |
||
192 | 196 | public function containsStr($needle) { |
193 | 197 | $cells = $this->content; |
194 | 198 | foreach ($cells as $cell) { |
195 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
196 | - return true; |
|
199 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
200 | + return true; |
|
201 | + } |
|
197 | 202 | } |
198 | 203 | return false; |
199 | 204 | } |
@@ -108,15 +108,17 @@ discard block |
||
108 | 108 | |
109 | 109 | public function getColspan() { |
110 | 110 | $colspan = 1; |
111 | - if (\array_key_exists("colspan", $this->properties)) |
|
112 | - $colspan = $this->getProperty("colspan"); |
|
111 | + if (\array_key_exists("colspan", $this->properties)) { |
|
112 | + $colspan = $this->getProperty("colspan"); |
|
113 | + } |
|
113 | 114 | return $colspan; |
114 | 115 | } |
115 | 116 | |
116 | 117 | public function getRowspan() { |
117 | 118 | $rowspan = 1; |
118 | - if (\array_key_exists("rowspan", $this->properties)) |
|
119 | - $rowspan = $this->getProperty("rowspan"); |
|
119 | + if (\array_key_exists("rowspan", $this->properties)) { |
|
120 | + $rowspan = $this->getProperty("rowspan"); |
|
121 | + } |
|
120 | 122 | return $rowspan; |
121 | 123 | } |
122 | 124 | |
@@ -155,7 +157,8 @@ discard block |
||
155 | 157 | } |
156 | 158 | |
157 | 159 | public function compile(JsUtils $js = NULL, &$view = NULL) { |
158 | - if (! $this->_deleted) |
|
159 | - return parent::compile($js, $view); |
|
160 | + if (! $this->_deleted) { |
|
161 | + return parent::compile($js, $view); |
|
162 | + } |
|
160 | 163 | } |
161 | 164 | } |
@@ -32,8 +32,9 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function __construct($identifier, $tagName = "tbody", $rowCount = NULL, $colCount = NULL) { |
34 | 34 | parent::__construct($identifier, $tagName, ""); |
35 | - if (isset($rowCount) && isset($colCount)) |
|
36 | - $this->setRowCount($rowCount, $colCount); |
|
35 | + if (isset($rowCount) && isset($colCount)) { |
|
36 | + $this->setRowCount($rowCount, $colCount); |
|
37 | + } |
|
37 | 38 | } |
38 | 39 | |
39 | 40 | /** |
@@ -193,10 +194,11 @@ discard block |
||
193 | 194 | $values = \array_fill(0, $count, $values); |
194 | 195 | $isArray = false; |
195 | 196 | } |
196 | - if (JArray::dimension($values) == 1 && $isArray) |
|
197 | - $values = [ |
|
197 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
198 | + $values = [ |
|
198 | 199 | $values |
199 | 200 | ]; |
201 | + } |
|
200 | 202 | |
201 | 203 | $count = \min(\sizeof($values), $count); |
202 | 204 | |
@@ -223,8 +225,9 @@ discard block |
||
223 | 225 | $count = $this->count(); |
224 | 226 | for ($i = 0; $i < $count; $i ++) { |
225 | 227 | $cell = $this->getCell($i, $colIndex); |
226 | - if ($cell instanceof BaseTrait) |
|
227 | - $cell->addVariations($variations); |
|
228 | + if ($cell instanceof BaseTrait) { |
|
229 | + $cell->addVariations($variations); |
|
230 | + } |
|
228 | 231 | } |
229 | 232 | return $this; |
230 | 233 | } |
@@ -233,8 +236,9 @@ discard block |
||
233 | 236 | $count = $this->count(); |
234 | 237 | for ($i = 0; $i < $count; $i ++) { |
235 | 238 | $cell = $this->getCell($i, $colIndex); |
236 | - if (isset($cell)) |
|
237 | - $cell->addToProperty($name, $value); |
|
239 | + if (isset($cell)) { |
|
240 | + $cell->addToProperty($name, $value); |
|
241 | + } |
|
238 | 242 | } |
239 | 243 | return $this; |
240 | 244 | } |
@@ -252,8 +256,9 @@ discard block |
||
252 | 256 | $count = $this->count(); |
253 | 257 | for ($i = 0; $i < $count; $i ++) { |
254 | 258 | $index = $this->content[$i]->getColPosition($colIndex); |
255 | - if ($index !== NULL) |
|
256 | - $this->getCell($i, $index)->$function(); |
|
259 | + if ($index !== NULL) { |
|
260 | + $this->getCell($i, $index)->$function(); |
|
261 | + } |
|
257 | 262 | } |
258 | 263 | return $this; |
259 | 264 | } |
@@ -264,8 +269,9 @@ discard block |
||
264 | 269 | $maxRow = $this->content[$i]->count(); |
265 | 270 | $index = $maxRow - $colIndex - 1; |
266 | 271 | if (($cell = $this->getCell($i, $index)) !== NULL) { |
267 | - if ($cell->getColspan() == 1) |
|
268 | - $cell->$function(); |
|
272 | + if ($cell->getColspan() == 1) { |
|
273 | + $cell->$function(); |
|
274 | + } |
|
269 | 275 | } |
270 | 276 | } |
271 | 277 | return $this; |
@@ -311,8 +317,9 @@ discard block |
||
311 | 317 | */ |
312 | 318 | public function getColCount() { |
313 | 319 | $result = 0; |
314 | - if ($this->count() > 0) |
|
315 | - $result = $this->getItem(0)->count(); |
|
320 | + if ($this->count() > 0) { |
|
321 | + $result = $this->getItem(0)->count(); |
|
322 | + } |
|
316 | 323 | return $result; |
317 | 324 | } |
318 | 325 | |
@@ -337,15 +344,17 @@ discard block |
||
337 | 344 | |
338 | 345 | public function toDelete($rowIndex, $colIndex) { |
339 | 346 | $row = $this->getItem($rowIndex); |
340 | - if (isset($row) === true) |
|
341 | - $row->toDelete($colIndex); |
|
347 | + if (isset($row) === true) { |
|
348 | + $row->toDelete($colIndex); |
|
349 | + } |
|
342 | 350 | return $this; |
343 | 351 | } |
344 | 352 | |
345 | 353 | public function toRowspanned($rowIndex, $colIndex) { |
346 | 354 | $row = $this->getItem($rowIndex); |
347 | - if (isset($row) === true) |
|
348 | - $row->toRowspanned($colIndex); |
|
355 | + if (isset($row) === true) { |
|
356 | + $row->toRowspanned($colIndex); |
|
357 | + } |
|
349 | 358 | return $this; |
350 | 359 | } |
351 | 360 | |
@@ -455,8 +464,9 @@ discard block |
||
455 | 464 | foreach ($rows as $row) { |
456 | 465 | $cell = $row->getItem($colIndex); |
457 | 466 | $value = $cell->getContent(); |
458 | - if ($functionExists) |
|
459 | - $value = \call_user_func($function, $value); |
|
467 | + if ($functionExists) { |
|
468 | + $value = \call_user_func($function, $value); |
|
469 | + } |
|
460 | 470 | if ($value !== $identiqual) { |
461 | 471 | if ($counter > 0 && isset($cellToMerge)) { |
462 | 472 | $cellToMerge->setRowspanned($counter); |