@@ -21,6 +21,10 @@ discard block |
||
| 21 | 21 | private $_footer; |
| 22 | 22 | private $_afterCompileEvents; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param integer $rowCount |
|
| 26 | + * @param integer $colCount |
|
| 27 | + */ |
|
| 24 | 28 | public function __construct($identifier, $rowCount, $colCount) { |
| 25 | 29 | parent::__construct($identifier, "table", "ui table"); |
| 26 | 30 | $this->content=array (); |
@@ -102,7 +106,7 @@ discard block |
||
| 102 | 106 | /** |
| 103 | 107 | * Retuns the row at $rowIndex |
| 104 | 108 | * @param int $rowIndex |
| 105 | - * @return \Ajax\semantic\html\content\HtmlTR |
|
| 109 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
| 106 | 110 | */ |
| 107 | 111 | public function getRow($rowIndex) { |
| 108 | 112 | return $this->getBody()->getRow($rowIndex); |
@@ -178,6 +182,9 @@ discard block |
||
| 178 | 182 | return $this->colAlign($colIndex, "colLeft"); |
| 179 | 183 | } |
| 180 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $function |
|
| 187 | + */ |
|
| 181 | 188 | private function colAlign($colIndex, $function) { |
| 182 | 189 | if (\is_array($colIndex)) { |
| 183 | 190 | foreach ( $colIndex as $cIndex ) { |
@@ -197,8 +197,9 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | public function setBasic($very=false) { |
| 200 | - if ($very) |
|
| 201 | - $this->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 200 | + if ($very) { |
|
| 201 | + $this->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 202 | + } |
|
| 202 | 203 | return $this->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 203 | 204 | } |
| 204 | 205 | |
@@ -263,7 +264,7 @@ discard block |
||
| 263 | 264 | if(\sizeof($this->_compileParts)<3){ |
| 264 | 265 | $this->_template="%content%"; |
| 265 | 266 | $this->refresh(); |
| 266 | - }else{ |
|
| 267 | + } else{ |
|
| 267 | 268 | if ($this->propertyContains("class", "sortable")) { |
| 268 | 269 | $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
| 269 | 270 | } |
@@ -286,8 +287,9 @@ discard block |
||
| 286 | 287 | $result= $this->getBody()->_addRow($result); |
| 287 | 288 | } |
| 288 | 289 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 289 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 290 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 290 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 291 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 292 | + } |
|
| 291 | 293 | } |
| 292 | 294 | return $result; |
| 293 | 295 | } |
@@ -308,8 +310,9 @@ discard block |
||
| 308 | 310 | |
| 309 | 311 | public function run(JsUtils $js){ |
| 310 | 312 | $result= parent::run($js); |
| 311 | - if(isset($this->_footer)) |
|
| 312 | - $this->_footer->run($js); |
|
| 313 | + if(isset($this->_footer)) { |
|
| 314 | + $this->_footer->run($js); |
|
| 315 | + } |
|
| 313 | 316 | return $result; |
| 314 | 317 | } |
| 315 | 318 | |
@@ -41,6 +41,10 @@ discard block |
||
| 41 | 41 | parent::run($js); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + /** |
|
| 45 | + * @param string $identifier |
|
| 46 | + * @param string $model |
|
| 47 | + */ |
|
| 44 | 48 | public function __construct($identifier,$model,$modelInstance=NULL) { |
| 45 | 49 | parent::__construct($identifier, $model,$modelInstance); |
| 46 | 50 | $this->_instanceViewer=new InstanceViewer(); |
@@ -168,16 +172,26 @@ discard block |
||
| 168 | 172 | return $this; |
| 169 | 173 | } |
| 170 | 174 | |
| 175 | + /** |
|
| 176 | + * @param \Closure $field |
|
| 177 | + */ |
|
| 171 | 178 | public function addField($field){ |
| 172 | 179 | $this->_instanceViewer->addField($field); |
| 173 | 180 | return $this; |
| 174 | 181 | } |
| 175 | 182 | |
| 183 | + /** |
|
| 184 | + * @param integer $index |
|
| 185 | + * @param \Closure $field |
|
| 186 | + */ |
|
| 176 | 187 | public function insertField($index,$field){ |
| 177 | 188 | $this->_instanceViewer->insertField($index, $field); |
| 178 | 189 | return $this; |
| 179 | 190 | } |
| 180 | 191 | |
| 192 | + /** |
|
| 193 | + * @param \Closure $field |
|
| 194 | + */ |
|
| 181 | 195 | public function insertInField($index,$field){ |
| 182 | 196 | $this->_instanceViewer->insertInField($index, $field); |
| 183 | 197 | return $this; |
@@ -226,16 +240,17 @@ discard block |
||
| 226 | 240 | /** |
| 227 | 241 | * @param string $caption |
| 228 | 242 | * @param callable $callback |
| 229 | - * @return callable |
|
| 243 | + * @return \Closure |
|
| 230 | 244 | */ |
| 231 | 245 | private function getFieldButtonCallable($caption,$callback=null){ |
| 232 | 246 | return $this->getCallable("getFieldButton",[$caption],$callback); |
| 233 | 247 | } |
| 234 | 248 | |
| 235 | 249 | /** |
| 236 | - * @param mixed $object |
|
| 237 | 250 | * @param callable $callback |
| 238 | - * @return callable |
|
| 251 | + * @param string $thisCallback |
|
| 252 | + * @param string[] $parameters |
|
| 253 | + * @return \Closure |
|
| 239 | 254 | */ |
| 240 | 255 | private function getCallable($thisCallback,$parameters,$callback=null){ |
| 241 | 256 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -296,11 +311,19 @@ discard block |
||
| 296 | 311 | return $this; |
| 297 | 312 | } |
| 298 | 313 | |
| 314 | + /** |
|
| 315 | + * @param string $icon |
|
| 316 | + * @param string $class |
|
| 317 | + */ |
|
| 299 | 318 | private function addDefaultButton($icon,$class=null,$callback=null){ |
| 300 | 319 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class],$callback)); |
| 301 | 320 | return $this; |
| 302 | 321 | } |
| 303 | 322 | |
| 323 | + /** |
|
| 324 | + * @param string $icon |
|
| 325 | + * @param string $class |
|
| 326 | + */ |
|
| 304 | 327 | private function insertDefaultButtonIn($index,$icon,$class=null,$callback=null){ |
| 305 | 328 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class],$callback)); |
| 306 | 329 | return $this; |