@@ -322,8 +322,9 @@ discard block |
||
322 | 322 | $result= $this->getBody()->_addRow($result); |
323 | 323 | } |
324 | 324 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
325 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
326 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
325 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
326 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
327 | + } |
|
327 | 328 | } |
328 | 329 | return $result; |
329 | 330 | } |
@@ -345,8 +346,9 @@ discard block |
||
345 | 346 | |
346 | 347 | public function run(JsUtils $js){ |
347 | 348 | $result= parent::run($js); |
348 | - if(isset($this->_footer)) |
|
349 | - $this->_footer->run($js); |
|
349 | + if(isset($this->_footer)) { |
|
350 | + $this->_footer->run($js); |
|
351 | + } |
|
350 | 352 | return $result; |
351 | 353 | } |
352 | 354 | |
@@ -387,9 +389,10 @@ discard block |
||
387 | 389 | public function setColWidth($colIndex,$width){ |
388 | 390 | if($this->hasPart("thead")){ |
389 | 391 | $this->getHeader()->getCell(0, $colIndex)->setWidth($width); |
390 | - }else{ |
|
391 | - if($this->getBody()->count()>0) |
|
392 | - $this->getBody()->getCell(0, $colIndex)->setWidth($width); |
|
392 | + } else{ |
|
393 | + if($this->getBody()->count()>0) { |
|
394 | + $this->getBody()->getCell(0, $colIndex)->setWidth($width); |
|
395 | + } |
|
393 | 396 | } |
394 | 397 | return $this; |
395 | 398 | } |
@@ -57,10 +57,12 @@ discard block |
||
57 | 57 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
58 | 58 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
59 | 59 | } |
60 | - if(\is_array($this->_deleteBehavior)) |
|
61 | - $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
62 | - if(\is_array($this->_editBehavior)) |
|
63 | - $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
60 | + if(\is_array($this->_deleteBehavior)) { |
|
61 | + $this->_generateBehavior("delete",$this->_deleteBehavior, $js); |
|
62 | + } |
|
63 | + if(\is_array($this->_editBehavior)) { |
|
64 | + $this->_generateBehavior("edit",$this->_editBehavior,$js); |
|
65 | + } |
|
64 | 66 | return parent::run($js); |
65 | 67 | } |
66 | 68 | |
@@ -96,12 +98,14 @@ discard block |
||
96 | 98 | $table->setRowCount(0, \sizeof($captions)); |
97 | 99 | $this->_generateHeader($table,$captions); |
98 | 100 | |
99 | - if(isset($this->_compileParts)) |
|
100 | - $table->setCompileParts($this->_compileParts); |
|
101 | + if(isset($this->_compileParts)) { |
|
102 | + $table->setCompileParts($this->_compileParts); |
|
103 | + } |
|
101 | 104 | |
102 | 105 | if(isset($this->_searchField) && isset($js)){ |
103 | - if(isset($this->_urls["refresh"])) |
|
104 | - $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
106 | + if(isset($this->_urls["refresh"])) { |
|
107 | + $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
108 | + } |
|
105 | 109 | } |
106 | 110 | |
107 | 111 | $this->_generateContent($table); |
@@ -119,8 +123,9 @@ discard block |
||
119 | 123 | |
120 | 124 | $this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]); |
121 | 125 | $this->_compileForm(); |
122 | - if(isset($this->_hiddenColumns)) |
|
123 | - $this->_hideColumns(); |
|
126 | + if(isset($this->_hiddenColumns)) { |
|
127 | + $this->_hideColumns(); |
|
128 | + } |
|
124 | 129 | if(isset($this->_colWidths)){ |
125 | 130 | foreach ($this->_colWidths as $colIndex=>$width){ |
126 | 131 | $table->setColWidth($colIndex,$width); |
@@ -176,8 +181,9 @@ discard block |
||
176 | 181 | $field=$ck->getField(); |
177 | 182 | $field->setProperty("value",$id); |
178 | 183 | $field->setProperty("name", "selection[]"); |
179 | - if(isset($checkedClass)) |
|
180 | - $field->setClass($checkedClass); |
|
184 | + if(isset($checkedClass)) { |
|
185 | + $field->setClass($checkedClass); |
|
186 | + } |
|
181 | 187 | \array_unshift($values, $ck); |
182 | 188 | } |
183 | 189 | $result=$table->newRow(); |
@@ -190,8 +196,9 @@ discard block |
||
190 | 196 | |
191 | 197 | protected function _generatePagination($table,$js=NULL){ |
192 | 198 | if(isset($this->_toolbar)){ |
193 | - if($this->_toolbarPosition==PositionInTable::FOOTER) |
|
194 | - $this->_toolbar->setFloated("left"); |
|
199 | + if($this->_toolbarPosition==PositionInTable::FOOTER) { |
|
200 | + $this->_toolbar->setFloated("left"); |
|
201 | + } |
|
195 | 202 | } |
196 | 203 | $footer=$table->getFooter(); |
197 | 204 | $footer->mergeCol(); |
@@ -210,8 +217,9 @@ discard block |
||
210 | 217 | |
211 | 218 | protected function _getFieldName($index){ |
212 | 219 | $fieldName=parent::_getFieldName($index); |
213 | - if(\is_object($fieldName)) |
|
214 | - $fieldName="field-".$index; |
|
220 | + if(\is_object($fieldName)) { |
|
221 | + $fieldName="field-".$index; |
|
222 | + } |
|
215 | 223 | return $fieldName."[]"; |
216 | 224 | } |
217 | 225 | |
@@ -251,7 +259,7 @@ discard block |
||
251 | 259 | $hasPart=$table->hasPart($part); |
252 | 260 | if($hasPart){ |
253 | 261 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
254 | - }else{ |
|
262 | + } else{ |
|
255 | 263 | $row=$table->getPart($part)->getRow(0); |
256 | 264 | } |
257 | 265 | $row->mergeCol(); |
@@ -276,7 +284,7 @@ discard block |
||
276 | 284 | $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
277 | 285 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
278 | 286 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
279 | - }else{ |
|
287 | + } else{ |
|
280 | 288 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
281 | 289 | } |
282 | 290 | return $this; |
@@ -350,8 +358,9 @@ discard block |
||
350 | 358 | |
351 | 359 | protected function getTargetSelector() { |
352 | 360 | $result=$this->_targetSelector; |
353 | - if(!isset($result)) |
|
354 | - $result="#".$this->identifier; |
|
361 | + if(!isset($result)) { |
|
362 | + $result="#".$this->identifier; |
|
363 | + } |
|
355 | 364 | return $result; |
356 | 365 | } |
357 | 366 | |
@@ -366,8 +375,9 @@ discard block |
||
366 | 375 | } |
367 | 376 | |
368 | 377 | public function getRefreshSelector() { |
369 | - if(isset($this->_refreshSelector)) |
|
370 | - return $this->_refreshSelector; |
|
378 | + if(isset($this->_refreshSelector)) { |
|
379 | + return $this->_refreshSelector; |
|
380 | + } |
|
371 | 381 | return "#".$this->identifier." tbody"; |
372 | 382 | } |
373 | 383 | |
@@ -386,8 +396,9 @@ discard block |
||
386 | 396 | */ |
387 | 397 | public function show($modelInstance){ |
388 | 398 | if(\is_array($modelInstance)){ |
389 | - if(\is_array(array_values($modelInstance)[0])) |
|
390 | - $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
399 | + if(\is_array(array_values($modelInstance)[0])) { |
|
400 | + $modelInstance=\json_decode(\json_encode($modelInstance), FALSE); |
|
401 | + } |
|
391 | 402 | } |
392 | 403 | $this->_modelInstance=$modelInstance; |
393 | 404 | } |
@@ -427,8 +438,9 @@ discard block |
||
427 | 438 | } |
428 | 439 | |
429 | 440 | public function hideColumn($colIndex){ |
430 | - if(!\is_array($this->_hiddenColumns)) |
|
431 | - $this->_hiddenColumns=[]; |
|
441 | + if(!\is_array($this->_hiddenColumns)) { |
|
442 | + $this->_hiddenColumns=[]; |
|
443 | + } |
|
432 | 444 | $this->_hiddenColumns[]=$colIndex; |
433 | 445 | return $this; |
434 | 446 | } |