@@ -23,6 +23,10 @@ discard block |
||
| 23 | 23 | private $_footer; |
| 24 | 24 | private $_afterCompileEvents; |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param integer $rowCount |
|
| 28 | + * @param integer $colCount |
|
| 29 | + */ |
|
| 26 | 30 | public function __construct($identifier, $rowCount, $colCount) { |
| 27 | 31 | parent::__construct($identifier, "table", "ui table"); |
| 28 | 32 | $this->content=array (); |
@@ -112,7 +116,7 @@ discard block |
||
| 112 | 116 | /** |
| 113 | 117 | * Retuns the row at $rowIndex |
| 114 | 118 | * @param int $rowIndex |
| 115 | - * @return \Ajax\semantic\html\content\HtmlTR |
|
| 119 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
| 116 | 120 | */ |
| 117 | 121 | public function getRow($rowIndex) { |
| 118 | 122 | return $this->getBody()->getRow($rowIndex); |
@@ -154,7 +158,7 @@ discard block |
||
| 154 | 158 | * Sets values to the col at index $colIndex |
| 155 | 159 | * @param int $colIndex |
| 156 | 160 | * @param array $values |
| 157 | - * @return \Ajax\semantic\html\collections\HtmlTable |
|
| 161 | + * @return HtmlTable |
|
| 158 | 162 | */ |
| 159 | 163 | public function setColValues($colIndex, $values=array()) { |
| 160 | 164 | $this->getBody()->setColValues($colIndex, $values); |
@@ -165,7 +169,7 @@ discard block |
||
| 165 | 169 | * Sets values to the row at index $rowIndex |
| 166 | 170 | * @param int $rowIndex |
| 167 | 171 | * @param array $values |
| 168 | - * @return \Ajax\semantic\html\collections\HtmlTable |
|
| 172 | + * @return HtmlTable |
|
| 169 | 173 | */ |
| 170 | 174 | public function setRowValues($rowIndex, $values=array()) { |
| 171 | 175 | $this->getBody()->setRowValues($rowIndex, $values); |
@@ -188,6 +192,9 @@ discard block |
||
| 188 | 192 | return $this->colAlign($colIndex, "colLeft"); |
| 189 | 193 | } |
| 190 | 194 | |
| 195 | + /** |
|
| 196 | + * @param string $function |
|
| 197 | + */ |
|
| 191 | 198 | private function colAlign($colIndex, $function) { |
| 192 | 199 | if (\is_array($colIndex)) { |
| 193 | 200 | foreach ( $colIndex as $cIndex ) { |
@@ -263,7 +270,7 @@ discard block |
||
| 263 | 270 | |
| 264 | 271 | /** |
| 265 | 272 | * @param array $parts |
| 266 | - * @return \Ajax\semantic\html\collections\HtmlTable |
|
| 273 | + * @return HtmlTable |
|
| 267 | 274 | */ |
| 268 | 275 | public function setCompileParts($parts=["tbody"]) { |
| 269 | 276 | $this->_compileParts=$parts; |
@@ -286,7 +293,7 @@ discard block |
||
| 286 | 293 | * The callback function called after the insertion of each row when fromDatabaseObjects is called |
| 287 | 294 | * callback function takes the parameters $row : the row inserted and $object: the instance of model used |
| 288 | 295 | * @param callable $callback |
| 289 | - * @return \Ajax\semantic\html\collections\HtmlTable |
|
| 296 | + * @return HtmlTable |
|
| 290 | 297 | */ |
| 291 | 298 | public function onNewRow($callback) { |
| 292 | 299 | $this->_afterCompileEvents["onNewRow"]=$callback; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if(\sizeof($this->_compileParts)<3){ |
| 233 | 233 | $this->_template="%content%"; |
| 234 | 234 | $this->refresh(); |
| 235 | - }else{ |
|
| 235 | + } else{ |
|
| 236 | 236 | if ($this->propertyContains("class", "sortable")) { |
| 237 | 237 | $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
| 238 | 238 | } |
@@ -255,8 +255,9 @@ discard block |
||
| 255 | 255 | $result= $this->getBody()->_addRow($result); |
| 256 | 256 | } |
| 257 | 257 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 258 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 259 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 258 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 259 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 260 | + } |
|
| 260 | 261 | } |
| 261 | 262 | return $result; |
| 262 | 263 | } |
@@ -277,8 +278,9 @@ discard block |
||
| 277 | 278 | |
| 278 | 279 | public function run(JsUtils $js){ |
| 279 | 280 | $result= parent::run($js); |
| 280 | - if(isset($this->_footer)) |
|
| 281 | - $this->_footer->run($js); |
|
| 281 | + if(isset($this->_footer)) { |
|
| 282 | + $this->_footer->run($js); |
|
| 283 | + } |
|
| 282 | 284 | return $result; |
| 283 | 285 | } |
| 284 | 286 | |
@@ -17,8 +17,9 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function setBasic($very=false) { |
| 19 | 19 | $table=$this->getTable(); |
| 20 | - if ($very) |
|
| 21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 20 | + if ($very) { |
|
| 21 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 22 | + } |
|
| 22 | 23 | return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 23 | 24 | } |
| 24 | 25 | |