@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
| 28 | 28 | parent::__construct($identifier, $tagName, ""); |
| 29 | - if (isset($rowCount) && isset($colCount)) |
|
| 30 | - $this->setRowCount($rowCount, $colCount); |
|
| 29 | + if (isset($rowCount) && isset($colCount)) { |
|
| 30 | + $this->setRowCount($rowCount, $colCount); |
|
| 31 | + } |
|
| 31 | 32 | } |
| 32 | 33 | |
| 33 | 34 | /** |
@@ -103,7 +104,7 @@ discard block |
||
| 103 | 104 | $row=$this->getItem($row); |
| 104 | 105 | if (isset($row) && $row instanceof HtmlCollection) { |
| 105 | 106 | $col=$row->getItem($col); |
| 106 | - }else{ |
|
| 107 | + } else{ |
|
| 107 | 108 | $col=$row; |
| 108 | 109 | } |
| 109 | 110 | return $col; |
@@ -161,8 +162,9 @@ discard block |
||
| 161 | 162 | $values=\array_fill(0, $count, $values); |
| 162 | 163 | $isArray=false; |
| 163 | 164 | } |
| 164 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 165 | - $values=[ $values ]; |
|
| 165 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 166 | + $values=[ $values ]; |
|
| 167 | + } |
|
| 166 | 168 | |
| 167 | 169 | $count=\min(\sizeof($values), $count); |
| 168 | 170 | |
@@ -189,8 +191,9 @@ discard block |
||
| 189 | 191 | $count=$this->count(); |
| 190 | 192 | for($i=0; $i < $count; $i++) { |
| 191 | 193 | $cell=$this->getCell($i, $colIndex); |
| 192 | - if($cell instanceof BaseTrait) |
|
| 193 | - $cell->addVariations($variations); |
|
| 194 | + if($cell instanceof BaseTrait) { |
|
| 195 | + $cell->addVariations($variations); |
|
| 196 | + } |
|
| 194 | 197 | } |
| 195 | 198 | return $this; |
| 196 | 199 | } |
@@ -208,8 +211,9 @@ discard block |
||
| 208 | 211 | $count=$this->count(); |
| 209 | 212 | for($i=0; $i < $count; $i++) { |
| 210 | 213 | $index=$this->content[$i]->getColPosition($colIndex); |
| 211 | - if ($index !== NULL) |
|
| 212 | - $this->getCell($i, $index)->$function(); |
|
| 214 | + if ($index !== NULL) { |
|
| 215 | + $this->getCell($i, $index)->$function(); |
|
| 216 | + } |
|
| 213 | 217 | } |
| 214 | 218 | return $this; |
| 215 | 219 | } |
@@ -240,8 +244,9 @@ discard block |
||
| 240 | 244 | */ |
| 241 | 245 | public function getColCount() { |
| 242 | 246 | $result=0; |
| 243 | - if ($this->count() > 0) |
|
| 244 | - $result=$this->getItem(0)->count(); |
|
| 247 | + if ($this->count() > 0) { |
|
| 248 | + $result=$this->getItem(0)->count(); |
|
| 249 | + } |
|
| 245 | 250 | return $result; |
| 246 | 251 | } |
| 247 | 252 | |
@@ -265,8 +270,9 @@ discard block |
||
| 265 | 270 | |
| 266 | 271 | public function toDelete($rowIndex, $colIndex){ |
| 267 | 272 | $row=$this->getItem($rowIndex); |
| 268 | - if (isset($row) === true) |
|
| 269 | - $row->toDelete($colIndex); |
|
| 273 | + if (isset($row) === true) { |
|
| 274 | + $row->toDelete($colIndex); |
|
| 275 | + } |
|
| 270 | 276 | return $this; |
| 271 | 277 | } |
| 272 | 278 | |
@@ -364,8 +370,9 @@ discard block |
||
| 364 | 370 | foreach ( $rows as $row ) { |
| 365 | 371 | $cell=$row->getItem($colIndex); |
| 366 | 372 | $value=$cell->getContent(); |
| 367 | - if($functionExists) |
|
| 368 | - $value=\call_user_func($function,$value); |
|
| 373 | + if($functionExists) { |
|
| 374 | + $value=\call_user_func($function,$value); |
|
| 375 | + } |
|
| 369 | 376 | if($value!==$identiqual){ |
| 370 | 377 | if($counter>0 && isset($cellToMerge)){ |
| 371 | 378 | $cellToMerge->setRowspan($counter); |
@@ -29,8 +29,9 @@ discard block |
||
| 29 | 29 | $this->_colSizing=false; |
| 30 | 30 | $this->setWide($numCols); |
| 31 | 31 | } |
| 32 | - if($createCols) |
|
| 33 | - $this->setRowsCount($numRows, $numCols); |
|
| 32 | + if($createCols) { |
|
| 33 | + $this->setRowsCount($numRows, $numCols); |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | public function asSegment() { |
@@ -82,8 +83,9 @@ discard block |
||
| 82 | 83 | public function addCol($width=NULL) { |
| 83 | 84 | $colCount=$this->colCount() + 1; |
| 84 | 85 | $this->setColsCount($colCount, true, $width); |
| 85 | - if ($this->hasOnlyCols($this->count())) |
|
| 86 | - return $this->content[$colCount - 1]; |
|
| 86 | + if ($this->hasOnlyCols($this->count())) { |
|
| 87 | + return $this->content[$colCount - 1]; |
|
| 88 | + } |
|
| 87 | 89 | return $this; |
| 88 | 90 | } |
| 89 | 91 | |
@@ -178,8 +180,9 @@ discard block |
||
| 178 | 180 | */ |
| 179 | 181 | public function rowCount() { |
| 180 | 182 | $count=$this->count(); |
| 181 | - if ($this->hasOnlyCols($count)) |
|
| 182 | - return 0; |
|
| 183 | + if ($this->hasOnlyCols($count)) { |
|
| 184 | + return 0; |
|
| 185 | + } |
|
| 183 | 186 | return $count; |
| 184 | 187 | } |
| 185 | 188 | |
@@ -189,10 +192,12 @@ discard block |
||
| 189 | 192 | */ |
| 190 | 193 | public function colCount() { |
| 191 | 194 | $count=$this->count(); |
| 192 | - if ($this->hasOnlyCols($count)) |
|
| 193 | - return $count; |
|
| 194 | - if ($count > 0) |
|
| 195 | - return $this->getItem(0)->count(); |
|
| 195 | + if ($this->hasOnlyCols($count)) { |
|
| 196 | + return $count; |
|
| 197 | + } |
|
| 198 | + if ($count > 0) { |
|
| 199 | + return $this->getItem(0)->count(); |
|
| 200 | + } |
|
| 196 | 201 | return 0; |
| 197 | 202 | } |
| 198 | 203 | |
@@ -203,8 +208,9 @@ discard block |
||
| 203 | 208 | * @return HtmlGridCol|HtmlGridRow |
| 204 | 209 | */ |
| 205 | 210 | public function getCell($row, $col) { |
| 206 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
| 207 | - return $this->getItem($col); |
|
| 211 | + if ($row < 2 && $this->hasOnlyCols($this->count())) { |
|
| 212 | + return $this->getItem($col); |
|
| 213 | + } |
|
| 208 | 214 | $rowO=$this->getItem($row); |
| 209 | 215 | if (isset($rowO)) { |
| 210 | 216 | $colO=$rowO->getItem($col); |
@@ -253,8 +259,9 @@ discard block |
||
| 253 | 259 | * @return \Ajax\semantic\html\collections\HtmlGrid |
| 254 | 260 | */ |
| 255 | 261 | public function setPadded($value=NULL) { |
| 256 | - if (isset($value)) |
|
| 257 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 262 | + if (isset($value)) { |
|
| 263 | + $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 264 | + } |
|
| 258 | 265 | return $this->addToProperty("class", "padded"); |
| 259 | 266 | } |
| 260 | 267 | |
@@ -279,8 +286,9 @@ discard block |
||
| 279 | 286 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 280 | 287 | */ |
| 281 | 288 | protected function createItem($value) { |
| 282 | - if ($this->_createCols === false) |
|
| 283 | - $value=null; |
|
| 289 | + if ($this->_createCols === false) { |
|
| 290 | + $value=null; |
|
| 291 | + } |
|
| 284 | 292 | $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
| 285 | 293 | return $item; |
| 286 | 294 | } |
@@ -328,8 +336,9 @@ discard block |
||
| 328 | 336 | */ |
| 329 | 337 | public function addDivider($afterColIndex, $vertical=true, $content=NULL) { |
| 330 | 338 | $col=$this->getCell(0, $afterColIndex); |
| 331 | - if($col instanceof HtmlGridCol) |
|
| 332 | - $col->addDivider($vertical, $content); |
|
| 339 | + if($col instanceof HtmlGridCol) { |
|
| 340 | + $col->addDivider($vertical, $content); |
|
| 341 | + } |
|
| 333 | 342 | return $this; |
| 334 | 343 | } |
| 335 | 344 | } |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | * @param mixed $view |
| 17 | 17 | */ |
| 18 | 18 | protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
| 19 | - if(isset($view)) |
|
| 20 | - $library->compileHtml($this, $view); |
|
| 19 | + if(isset($view)) { |
|
| 20 | + $library->compileHtml($this, $view); |
|
| 21 | + } |
|
| 21 | 22 | if ($library->isAutoCompile()) { |
| 22 | 23 | $library->compile(true); |
| 23 | 24 | } |
@@ -36,7 +37,9 @@ discard block |
||
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | protected function minify($input) { |
| 39 | - if(trim($input) === "") return $input; |
|
| 40 | + if(trim($input) === "") { |
|
| 41 | + return $input; |
|
| 42 | + } |
|
| 40 | 43 | return preg_replace( |
| 41 | 44 | array( |
| 42 | 45 | // Remove comment(s) |