@@ -15,6 +15,7 @@ |
||
| 15 | 15 | * {@inheritdoc} |
| 16 | 16 | * |
| 17 | 17 | * @see \Ajax\semantic\widgets\dataform\DataForm::__construct() |
| 18 | + * @param string $identifier |
|
| 18 | 19 | */ |
| 19 | 20 | public function __construct($identifier,$modelInstance=null,$fieldsOrder,$fieldsDefinition,$fields=[],$captions=[],$separators=[]) { |
| 20 | 21 | if(!isset($modelInstance)){ |
@@ -128,12 +128,20 @@ |
||
| 128 | 128 | $this->content[$this->_toolbarPosition]=$this->_toolbar; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | + /** |
|
| 132 | + * @param integer $index |
|
| 133 | + * @param string $title |
|
| 134 | + */ |
|
| 131 | 135 | public function addDividerBefore($index,$title){ |
| 132 | 136 | $index=$this->_getIndex($index); |
| 133 | 137 | $this->_instanceViewer->addHeaderDividerBefore($index, $title); |
| 134 | 138 | return $this; |
| 135 | 139 | } |
| 136 | 140 | |
| 141 | + /** |
|
| 142 | + * @param string $index |
|
| 143 | + * @param string $contentAfter |
|
| 144 | + */ |
|
| 137 | 145 | public function addWrapper($index,$contentBefore,$contentAfter=null){ |
| 138 | 146 | $index=$this->_getIndex($index); |
| 139 | 147 | $this->_instanceViewer->addWrapper($index, $contentBefore,$contentAfter); |
@@ -18,6 +18,9 @@ discard block |
||
| 18 | 18 | private $_container; |
| 19 | 19 | private $_row; |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param string $identifier |
|
| 23 | + */ |
|
| 21 | 24 | public function __construct($identifier) { |
| 22 | 25 | parent::__construct($identifier, "tr", ""); |
| 23 | 26 | $this->_states=[ State::ACTIVE,State::POSITIVE,State::NEGATIVE,State::WARNING,State::ERROR,State::DISABLED ]; |
@@ -78,6 +81,7 @@ discard block |
||
| 78 | 81 | /** |
| 79 | 82 | * Sets or adds values to the row cols |
| 80 | 83 | * @param mixed $values |
| 84 | + * @param \Closure $callback |
|
| 81 | 85 | */ |
| 82 | 86 | protected function _addOrSetValues($values,$callback) { |
| 83 | 87 | $count=$this->count(); |
@@ -63,6 +63,9 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string $op |
|
| 68 | + */ |
|
| 66 | 69 | protected function _generateBehavior($op,$params,JsUtils $js){ |
| 67 | 70 | if(isset($this->_urls[$op])){ |
| 68 | 71 | $params=\array_merge($params,["attr"=>"data-ajax"]); |
@@ -139,6 +142,9 @@ discard block |
||
| 139 | 142 | } |
| 140 | 143 | } |
| 141 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $checkedClass |
|
| 147 | + */ |
|
| 142 | 148 | protected function _generateRow($instance,&$table,$checkedClass=null){ |
| 143 | 149 | $this->_instanceViewer->setInstance($instance); |
| 144 | 150 | InstanceViewer::$index++; |
@@ -215,6 +221,9 @@ discard block |
||
| 215 | 221 | return $this; |
| 216 | 222 | } |
| 217 | 223 | |
| 224 | + /** |
|
| 225 | + * @param PositionInTable $part |
|
| 226 | + */ |
|
| 218 | 227 | private function addToolbarRow($part,$table,$captions){ |
| 219 | 228 | $hasPart=$table->hasPart($part); |
| 220 | 229 | if($hasPart){ |
@@ -254,7 +263,7 @@ discard block |
||
| 254 | 263 | * Paginates the DataTable element with a Semantic HtmlPaginationMenu component |
| 255 | 264 | * @param number $page the active page number |
| 256 | 265 | * @param number $total_rowcount the total number of items |
| 257 | - * @param number $items_per_page The number of items per page |
|
| 266 | + * @param integer $items_per_page The number of items per page |
|
| 258 | 267 | * @param number $pages_visibles The number of visible pages in the Pagination component |
| 259 | 268 | * @return DataTable |
| 260 | 269 | */ |
@@ -265,9 +274,9 @@ discard block |
||
| 265 | 274 | |
| 266 | 275 | /** |
| 267 | 276 | * Auto Paginates the DataTable element with a Semantic HtmlPaginationMenu component |
| 268 | - * @param number $page the active page number |
|
| 269 | - * @param number $items_per_page The number of items per page |
|
| 270 | - * @param number $pages_visibles The number of visible pages in the Pagination component |
|
| 277 | + * @param integer $page the active page number |
|
| 278 | + * @param integer $items_per_page The number of items per page |
|
| 279 | + * @param integer $pages_visibles The number of visible pages in the Pagination component |
|
| 271 | 280 | * @return DataTable |
| 272 | 281 | */ |
| 273 | 282 | public function autoPaginate($page=1,$items_per_page=10,$pages_visibles=4){ |
@@ -333,6 +342,9 @@ discard block |
||
| 333 | 342 | return $this; |
| 334 | 343 | } |
| 335 | 344 | |
| 345 | + /** |
|
| 346 | + * @return string |
|
| 347 | + */ |
|
| 336 | 348 | public function getRefreshSelector() { |
| 337 | 349 | if(isset($this->_refreshSelector)) |
| 338 | 350 | return $this->_refreshSelector; |
@@ -17,6 +17,10 @@ discard block |
||
| 17 | 17 | protected $_checkedMessage; |
| 18 | 18 | protected $_checkedClass; |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param HtmlLabel $element |
|
| 22 | + * @param callable $callback |
|
| 23 | + */ |
|
| 20 | 24 | abstract public function addInToolbar($element,$callback=NULL); |
| 21 | 25 | |
| 22 | 26 | protected function _runCheckboxes(JsUtils $js){ |
@@ -67,6 +71,9 @@ discard block |
||
| 67 | 71 | \array_unshift($captions, $ck); |
| 68 | 72 | } |
| 69 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $checked |
|
| 76 | + */ |
|
| 70 | 77 | protected function _setAllChecked($checked){ |
| 71 | 78 | $result="$('#".$this->identifier." [name=%quote%selection[]%quote%]:not(._jsonArrayChecked)').prop('checked',".$checked.");"; |
| 72 | 79 | if(isset($this->_checkedClass)){ |
@@ -96,7 +103,7 @@ discard block |
||
| 96 | 103 | * Defines the message displayed when checkboxes are checked or unchecked |
| 97 | 104 | * with an associative array 0=>no selection,1=>one item selected, other=>{count} items selected |
| 98 | 105 | * @param array $_checkedMessage |
| 99 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 106 | + * @return HasCheckboxesTrait |
|
| 100 | 107 | */ |
| 101 | 108 | public function setCheckedMessage(array $_checkedMessage) { |
| 102 | 109 | $this->_checkedMessage=$_checkedMessage; |
@@ -3,11 +3,18 @@ discard block |
||
| 3 | 3 | namespace Ajax\service; |
| 4 | 4 | |
| 5 | 5 | class JReflection { |
| 6 | + |
|
| 7 | + /** |
|
| 8 | + * @param \Ajax\common\html\HtmlCollection $object |
|
| 9 | + */ |
|
| 6 | 10 | public static function shortClassName($object){ |
| 7 | 11 | $classNameWithNamespace = get_class($object); |
| 8 | 12 | return substr($classNameWithNamespace, strrpos($classNameWithNamespace, '\\')+1); |
| 9 | 13 | } |
| 10 | 14 | |
| 15 | + /** |
|
| 16 | + * @param string $classname |
|
| 17 | + */ |
|
| 11 | 18 | public static function jsonObject($classname){ |
| 12 | 19 | $object=new $classname(); |
| 13 | 20 | $class = new \ReflectionClass($classname); |
@@ -27,6 +34,9 @@ discard block |
||
| 27 | 34 | return $object; |
| 28 | 35 | } |
| 29 | 36 | |
| 37 | + /** |
|
| 38 | + * @param string $callback |
|
| 39 | + */ |
|
| 30 | 40 | public static function callMethod($object,$callback,array $values){ |
| 31 | 41 | return \call_user_func_array([$object,$callback],$values); |
| 32 | 42 | } |