@@ -63,6 +63,10 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string $name |
|
| 68 | + * @param string[] $typeCtrl |
|
| 69 | + */ |
|
| 66 | 70 | protected function setMemberCtrl(&$name, $value, $typeCtrl) { |
| 67 | 71 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 68 | 72 | return $name=$value; |
@@ -80,6 +84,10 @@ discard block |
||
| 80 | 84 | |
| 81 | 85 | |
| 82 | 86 | |
| 87 | + /** |
|
| 88 | + * @param string $name |
|
| 89 | + * @param string[] $typeCtrl |
|
| 90 | + */ |
|
| 83 | 91 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 84 | 92 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 85 | 93 | if (\is_array($typeCtrl)) { |
@@ -90,6 +98,9 @@ discard block |
||
| 90 | 98 | return $this; |
| 91 | 99 | } |
| 92 | 100 | |
| 101 | + /** |
|
| 102 | + * @param string $name |
|
| 103 | + */ |
|
| 93 | 104 | protected function addToMember(&$name, $value, $separator=" ") { |
| 94 | 105 | $name=str_ireplace($value, "", $name) . $separator . $value; |
| 95 | 106 | return $this; |
@@ -102,6 +113,9 @@ discard block |
||
| 102 | 113 | $oldValue=trim($oldValue); |
| 103 | 114 | } |
| 104 | 115 | |
| 116 | + /** |
|
| 117 | + * @param \Closure $callback |
|
| 118 | + */ |
|
| 105 | 119 | protected function _getElementBy($callback,$elements){ |
| 106 | 120 | if (\is_array($elements)) { |
| 107 | 121 | $elements=\array_values($elements); |
@@ -183,6 +197,9 @@ discard block |
||
| 183 | 197 | return $this->_bsComponent; |
| 184 | 198 | } |
| 185 | 199 | |
| 200 | + /** |
|
| 201 | + * @param \Ajax\semantic\components\Form $bsComponent |
|
| 202 | + */ |
|
| 186 | 203 | public function setBsComponent($bsComponent) { |
| 187 | 204 | $this->_bsComponent=$bsComponent; |
| 188 | 205 | return $this; |
@@ -14,15 +14,28 @@ discard block |
||
| 14 | 14 | * @property InstanceViewer $_instanceViewer |
| 15 | 15 | */ |
| 16 | 16 | trait DataTableFieldAsTrait{ |
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * @param \Closure $field |
|
| 20 | + */ |
|
| 17 | 21 | abstract public function addField($field); |
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @param integer $index |
|
| 25 | + * @param \Closure $field |
|
| 26 | + */ |
|
| 18 | 27 | abstract public function insertField($index,$field); |
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @param \Closure $field |
|
| 31 | + */ |
|
| 19 | 32 | abstract public function insertInField($index,$field); |
| 20 | 33 | abstract public function fieldAs($index,$type,$attributes=NULL); |
| 21 | 34 | /** |
| 22 | 35 | * @param string $caption |
| 23 | 36 | * @param callable $callback |
| 24 | 37 | * @param boolean $visibleHover |
| 25 | - * @return callable |
|
| 38 | + * @return \Closure |
|
| 26 | 39 | */ |
| 27 | 40 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
| 28 | 41 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -32,7 +45,7 @@ discard block |
||
| 32 | 45 | * @param callable $thisCallback |
| 33 | 46 | * @param array $parameters |
| 34 | 47 | * @param callable $callback |
| 35 | - * @return callable |
|
| 48 | + * @return \Closure |
|
| 36 | 49 | */ |
| 37 | 50 | private function getCallable($thisCallback,$parameters,$callback=null){ |
| 38 | 51 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -94,7 +107,7 @@ discard block |
||
| 94 | 107 | * @param string $caption |
| 95 | 108 | * @param callable $callback |
| 96 | 109 | * @param boolean $visibleHover |
| 97 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 110 | + * @return DataTableFieldAsTrait |
|
| 98 | 111 | */ |
| 99 | 112 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
| 100 | 113 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -106,7 +119,7 @@ discard block |
||
| 106 | 119 | * @param int $index |
| 107 | 120 | * @param string $caption |
| 108 | 121 | * @param callable $callback |
| 109 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 122 | + * @return DataTableFieldAsTrait |
|
| 110 | 123 | */ |
| 111 | 124 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 112 | 125 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -118,18 +131,26 @@ discard block |
||
| 118 | 131 | * @param int $index |
| 119 | 132 | * @param string $caption |
| 120 | 133 | * @param callable $callback |
| 121 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 134 | + * @return DataTableFieldAsTrait |
|
| 122 | 135 | */ |
| 123 | 136 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 124 | 137 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
| 125 | 138 | return $this; |
| 126 | 139 | } |
| 127 | 140 | |
| 141 | + /** |
|
| 142 | + * @param string $icon |
|
| 143 | + * @param string $class |
|
| 144 | + */ |
|
| 128 | 145 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
| 129 | 146 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 130 | 147 | return $this; |
| 131 | 148 | } |
| 132 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $icon |
|
| 152 | + * @param string $class |
|
| 153 | + */ |
|
| 133 | 154 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
| 134 | 155 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 135 | 156 | return $this; |
@@ -147,7 +168,7 @@ discard block |
||
| 147 | 168 | * @param boolean $visibleHover |
| 148 | 169 | * @param array $deleteBehavior |
| 149 | 170 | * @param callable $callback |
| 150 | - * @return DataTable |
|
| 171 | + * @return DataTableFieldAsTrait |
|
| 151 | 172 | */ |
| 152 | 173 | public function addDeleteButton($visibleHover=true,$deleteBehavior=[],$callback=null){ |
| 153 | 174 | $this->_deleteBehavior=$deleteBehavior; |