@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | */ |
| 13 | 13 | class HtmlTableContent extends HtmlSemCollection { |
| 14 | - protected $_tdTagNames=[ "thead" => "th","tbody" => "td","tfoot" => "th" ]; |
|
| 14 | + protected $_tdTagNames=["thead" => "th", "tbody" => "td", "tfoot" => "th"]; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function setRowCount($rowCount, $colCount) { |
| 36 | 36 | $count=$this->count(); |
| 37 | - for($i=$count; $i < $rowCount; $i++) { |
|
| 37 | + for ($i=$count; $i<$rowCount; $i++) { |
|
| 38 | 38 | $this->addItem(NULL); |
| 39 | 39 | } |
| 40 | - for($i=0; $i < $rowCount; $i++) { |
|
| 40 | + for ($i=0; $i<$rowCount; $i++) { |
|
| 41 | 41 | $item=$this->content[$i]; |
| 42 | 42 | $item->setTdTagName($this->_tdTagNames[$this->tagName]); |
| 43 | 43 | $this->content[$i]->setColCount($colCount); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $tr=new HtmlTR("", $value); |
| 61 | 61 | $tr->setContainer($this, $count); |
| 62 | 62 | $tr->setTdTagName($this->_tdTagNames[$this->tagName]); |
| 63 | - if (isset($value) === true) { |
|
| 63 | + if (isset($value)===true) { |
|
| 64 | 64 | $tr->setColCount($value); |
| 65 | 65 | } |
| 66 | 66 | return $tr; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function setCellValue($row, $col, $value="") { |
| 104 | 104 | $cell=$this->getCell($row, $col); |
| 105 | - if (isset($cell) === true) { |
|
| 105 | + if (isset($cell)===true) { |
|
| 106 | 106 | $cell->setValue($value); |
| 107 | 107 | } |
| 108 | 108 | return $this; |
@@ -115,16 +115,16 @@ discard block |
||
| 115 | 115 | public function setValues($values=array()) { |
| 116 | 116 | $count=$this->count(); |
| 117 | 117 | $isArray=true; |
| 118 | - if (\is_array($values) === false) { |
|
| 118 | + if (\is_array($values)===false) { |
|
| 119 | 119 | $values=\array_fill(0, $count, $values); |
| 120 | 120 | $isArray=false; |
| 121 | 121 | } |
| 122 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 123 | - $values=[ $values ]; |
|
| 122 | + if (JArray::dimension($values)==1 && $isArray) |
|
| 123 | + $values=[$values]; |
|
| 124 | 124 | |
| 125 | 125 | $count=\min(\sizeof($values), $count); |
| 126 | 126 | |
| 127 | - for($i=0; $i < $count; $i++) { |
|
| 127 | + for ($i=0; $i<$count; $i++) { |
|
| 128 | 128 | $row=$this->content[$i]; |
| 129 | 129 | $row->setValues($values[$i]); |
| 130 | 130 | } |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | public function setColValues($colIndex, $values=array()) { |
| 135 | 135 | $count=$this->count(); |
| 136 | - if (\is_array($values) === false) { |
|
| 136 | + if (\is_array($values)===false) { |
|
| 137 | 137 | $values=\array_fill(0, $count, $values); |
| 138 | 138 | } |
| 139 | 139 | $count=\min(\sizeof($values), $count); |
| 140 | - for($i=0; $i < $count; $i++) { |
|
| 140 | + for ($i=0; $i<$count; $i++) { |
|
| 141 | 141 | $this->getCell($i, $colIndex)->setValue($values[$i]); |
| 142 | 142 | } |
| 143 | 143 | return $this; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | public function addColVariations($colIndex, $variations=array()) { |
| 147 | 147 | $count=$this->count(); |
| 148 | - for($i=0; $i < $count; $i++) { |
|
| 148 | + for ($i=0; $i<$count; $i++) { |
|
| 149 | 149 | $this->getCell($i, $colIndex)->addVariations($variations); |
| 150 | 150 | } |
| 151 | 151 | return $this; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function setRowValues($rowIndex, $values=array()) { |
| 155 | 155 | $count=$this->count(); |
| 156 | - if (\is_array($values) === false) { |
|
| 156 | + if (\is_array($values)===false) { |
|
| 157 | 157 | $values=\array_fill(0, $count, $values); |
| 158 | 158 | } |
| 159 | 159 | $this->getItem($rowIndex)->setValues($values); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | public function colCenter($colIndex) { |
| 164 | 164 | $count=$this->count(); |
| 165 | - for($i=0; $i < $count; $i++) { |
|
| 165 | + for ($i=0; $i<$count; $i++) { |
|
| 166 | 166 | $this->getCell($i, $colIndex)->textCenterAligned(); |
| 167 | 167 | } |
| 168 | 168 | return $this; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | public function colRight($colIndex) { |
| 172 | 172 | $count=$this->count(); |
| 173 | - for($i=0; $i < $count; $i++) { |
|
| 173 | + for ($i=0; $i<$count; $i++) { |
|
| 174 | 174 | $this->getCell($i, $colIndex)->textRightAligned(); |
| 175 | 175 | } |
| 176 | 176 | return $this; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function getColCount() { |
| 192 | 192 | $result=0; |
| 193 | - if ($this->count() > 0) |
|
| 193 | + if ($this->count()>0) |
|
| 194 | 194 | $result=$this->getItem(0)->getColCount(); |
| 195 | 195 | return $result; |
| 196 | 196 | } |
@@ -204,10 +204,10 @@ discard block |
||
| 204 | 204 | public function delete($rowIndex, $colIndex=NULL) { |
| 205 | 205 | if (isset($colIndex)) { |
| 206 | 206 | $row=$this->getItem($rowIndex); |
| 207 | - if (isset($row) === true) { |
|
| 207 | + if (isset($row)===true) { |
|
| 208 | 208 | $row->delete($colIndex); |
| 209 | 209 | } |
| 210 | - } else { |
|
| 210 | + }else { |
|
| 211 | 211 | $this->removeItem($rowIndex); |
| 212 | 212 | } |
| 213 | 213 | return $this; |
@@ -22,8 +22,9 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
| 24 | 24 | parent::__construct($identifier, $tagName, ""); |
| 25 | - if (isset($rowCount) && isset($colCount)) |
|
| 26 | - $this->setRowCount($rowCount, $colCount); |
|
| 25 | + if (isset($rowCount) && isset($colCount)) { |
|
| 26 | + $this->setRowCount($rowCount, $colCount); |
|
| 27 | + } |
|
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | /** |
@@ -119,8 +120,9 @@ discard block |
||
| 119 | 120 | $values=\array_fill(0, $count, $values); |
| 120 | 121 | $isArray=false; |
| 121 | 122 | } |
| 122 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 123 | - $values=[ $values ]; |
|
| 123 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 124 | + $values=[ $values ]; |
|
| 125 | + } |
|
| 124 | 126 | |
| 125 | 127 | $count=\min(\sizeof($values), $count); |
| 126 | 128 | |
@@ -190,8 +192,9 @@ discard block |
||
| 190 | 192 | */ |
| 191 | 193 | public function getColCount() { |
| 192 | 194 | $result=0; |
| 193 | - if ($this->count() > 0) |
|
| 194 | - $result=$this->getItem(0)->getColCount(); |
|
| 195 | + if ($this->count() > 0) { |
|
| 196 | + $result=$this->getItem(0)->getColCount(); |
|
| 197 | + } |
|
| 195 | 198 | return $result; |
| 196 | 199 | } |
| 197 | 200 | |