@@ -19,6 +19,9 @@ discard block |
||
19 | 19 | protected $style=""; |
20 | 20 | protected $styleLimits=null; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $identifier |
|
24 | + */ |
|
22 | 25 | public function __construct($identifier, $style="info", $value=0, $max=100, $min=0) { |
23 | 26 | parent::__construct($identifier); |
24 | 27 | $this->_template=include 'templates/tplProgressbar.php'; |
@@ -28,6 +31,9 @@ discard block |
||
28 | 31 | $this->setStyle($style); |
29 | 32 | } |
30 | 33 | |
34 | + /** |
|
35 | + * @param boolean $value |
|
36 | + */ |
|
31 | 37 | public function setActive($value) { |
32 | 38 | if(\is_array($this->content)){ |
33 | 39 | foreach ($this->content as $pb){ |
@@ -42,6 +48,9 @@ discard block |
||
42 | 48 | return $this; |
43 | 49 | } |
44 | 50 | |
51 | + /** |
|
52 | + * @param boolean $value |
|
53 | + */ |
|
45 | 54 | public function setStriped($value) { |
46 | 55 | if(\is_array($this->content)){ |
47 | 56 | foreach ($this->content as $pb){ |
@@ -56,6 +65,9 @@ discard block |
||
56 | 65 | return $this; |
57 | 66 | } |
58 | 67 | |
68 | + /** |
|
69 | + * @param boolean $value |
|
70 | + */ |
|
59 | 71 | public function showCaption($value) { |
60 | 72 | if(\is_array($this->content)){ |
61 | 73 | foreach ($this->content as $pb){ |
@@ -113,6 +125,9 @@ discard block |
||
113 | 125 | return $this->stacked; |
114 | 126 | } |
115 | 127 | |
128 | + /** |
|
129 | + * @param boolean $stacked |
|
130 | + */ |
|
116 | 131 | public function setStacked($stacked) { |
117 | 132 | $this->stacked=$stacked; |
118 | 133 | return $this; |
@@ -121,7 +136,7 @@ discard block |
||
121 | 136 | /** |
122 | 137 | * define the progressbar style |
123 | 138 | * avaible values : "success","info","warning","danger" |
124 | - * @param string|int $cssStyle |
|
139 | + * @param string $cssStyle |
|
125 | 140 | * @return \Ajax\bootstrap\html\HtmlProgressbar default : "" |
126 | 141 | */ |
127 | 142 | public function setStyle($cssStyle) { |
@@ -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; |
@@ -7,6 +7,11 @@ |
||
7 | 7 | use Ajax\common\html\HtmlDoubleElement; |
8 | 8 | |
9 | 9 | trait AttachedTrait { |
10 | + |
|
11 | + /** |
|
12 | + * @param string $name |
|
13 | + * @param string $value |
|
14 | + */ |
|
10 | 15 | abstract public function addToPropertyCtrl($name, $value, $typeCtrl); |
11 | 16 | /** |
12 | 17 | * @param HtmlSemDoubleElement $toElement |
@@ -25,6 +25,9 @@ discard block |
||
25 | 25 | protected $_associative; |
26 | 26 | protected $_multiple; |
27 | 27 | |
28 | + /** |
|
29 | + * @param string $identifier |
|
30 | + */ |
|
28 | 31 | public function __construct($identifier, $value="", $items=array(),$associative=true) { |
29 | 32 | parent::__construct($identifier, "div"); |
30 | 33 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
@@ -78,7 +81,7 @@ discard block |
||
78 | 81 | /** |
79 | 82 | * Insert an item at a position |
80 | 83 | * @param mixed $item |
81 | - * @param number $position |
|
84 | + * @param integer $position |
|
82 | 85 | * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown |
83 | 86 | */ |
84 | 87 | public function insertItem($item,$position=0){ |
@@ -190,7 +193,7 @@ discard block |
||
190 | 193 | * Sets the values of a property for each item in the collection |
191 | 194 | * @param string $property |
192 | 195 | * @param array $values |
193 | - * @return HtmlCollection |
|
196 | + * @return HtmlDropdown |
|
194 | 197 | */ |
195 | 198 | public function setPropertyValues($property,$values){ |
196 | 199 | $i=0; |
@@ -209,6 +212,9 @@ discard block |
||
209 | 212 | return $this; |
210 | 213 | } |
211 | 214 | |
215 | + /** |
|
216 | + * @param integer $index |
|
217 | + */ |
|
212 | 218 | public function getItem($index){ |
213 | 219 | return $this->items[$index]; |
214 | 220 | } |
@@ -302,6 +308,9 @@ discard block |
||
302 | 308 | return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
303 | 309 | } |
304 | 310 | |
311 | + /** |
|
312 | + * @param string $value |
|
313 | + */ |
|
305 | 314 | public function setValue($value){ |
306 | 315 | $this->value=$value; |
307 | 316 | return $this; |
@@ -338,6 +347,9 @@ discard block |
||
338 | 347 | return $this->addToPropertyCtrl("class", "compact", array("compact")); |
339 | 348 | } |
340 | 349 | |
350 | + /** |
|
351 | + * @param string $action |
|
352 | + */ |
|
341 | 353 | public function setAction($action){ |
342 | 354 | $this->_params["action"]=$action; |
343 | 355 | } |
@@ -15,15 +15,28 @@ discard block |
||
15 | 15 | * @property InstanceViewer $_instanceViewer |
16 | 16 | */ |
17 | 17 | trait DataTableFieldAsTrait{ |
18 | + |
|
19 | + /** |
|
20 | + * @param \Closure $field |
|
21 | + */ |
|
18 | 22 | abstract public function addField($field); |
23 | + |
|
24 | + /** |
|
25 | + * @param integer $index |
|
26 | + * @param \Closure $field |
|
27 | + */ |
|
19 | 28 | abstract public function insertField($index,$field); |
29 | + |
|
30 | + /** |
|
31 | + * @param \Closure $field |
|
32 | + */ |
|
20 | 33 | abstract public function insertInField($index,$field); |
21 | 34 | abstract public function fieldAs($index,$type,$attributes=NULL); |
22 | 35 | /** |
23 | 36 | * @param string $caption |
24 | 37 | * @param callable $callback |
25 | 38 | * @param boolean $visibleHover |
26 | - * @return callable |
|
39 | + * @return \Closure |
|
27 | 40 | */ |
28 | 41 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
29 | 42 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -33,7 +46,7 @@ discard block |
||
33 | 46 | * @param callable $thisCallback |
34 | 47 | * @param array $parameters |
35 | 48 | * @param callable $callback |
36 | - * @return callable |
|
49 | + * @return \Closure |
|
37 | 50 | */ |
38 | 51 | private function getCallable($thisCallback,$parameters,$callback=null){ |
39 | 52 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -103,7 +116,7 @@ discard block |
||
103 | 116 | * @param string $caption |
104 | 117 | * @param callable $callback |
105 | 118 | * @param boolean $visibleHover |
106 | - * @return DataTable |
|
119 | + * @return DataTableFieldAsTrait |
|
107 | 120 | */ |
108 | 121 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
109 | 122 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -115,7 +128,7 @@ discard block |
||
115 | 128 | * @param array $buttons |
116 | 129 | * @param callable $callback |
117 | 130 | * @param boolean $visibleHover |
118 | - * @return DataTable |
|
131 | + * @return DataTableFieldAsTrait |
|
119 | 132 | */ |
120 | 133 | public function addFieldButtons($buttons,$visibleHover=true,$callback=null){ |
121 | 134 | $this->addField($this->getCallable("getFieldButtons",[$buttons,$visibleHover],$callback)); |
@@ -127,7 +140,7 @@ discard block |
||
127 | 140 | * @param int $index |
128 | 141 | * @param string $caption |
129 | 142 | * @param callable $callback |
130 | - * @return DataTable |
|
143 | + * @return DataTableFieldAsTrait |
|
131 | 144 | */ |
132 | 145 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
133 | 146 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -139,18 +152,27 @@ discard block |
||
139 | 152 | * @param int $index |
140 | 153 | * @param string $caption |
141 | 154 | * @param callable $callback |
142 | - * @return DataTable |
|
155 | + * @return DataTableFieldAsTrait |
|
143 | 156 | */ |
144 | 157 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
145 | 158 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
146 | 159 | return $this; |
147 | 160 | } |
148 | 161 | |
162 | + /** |
|
163 | + * @param string $icon |
|
164 | + * @param string $class |
|
165 | + * @param callable $callback |
|
166 | + */ |
|
149 | 167 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
150 | 168 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
151 | 169 | return $this; |
152 | 170 | } |
153 | 171 | |
172 | + /** |
|
173 | + * @param string $icon |
|
174 | + * @param string $class |
|
175 | + */ |
|
154 | 176 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
155 | 177 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
156 | 178 | return $this; |
@@ -169,7 +191,7 @@ discard block |
||
169 | 191 | * @param boolean $visibleHover |
170 | 192 | * @param array $deleteBehavior default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"data-ajax","params"=>"{}","method"=>"get") |
171 | 193 | * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
172 | - * @return DataTable |
|
194 | + * @return DataTableFieldAsTrait |
|
173 | 195 | */ |
174 | 196 | public function addDeleteButton($visibleHover=true,$deleteBehavior=[],$callback=null){ |
175 | 197 | $this->_deleteBehavior=$deleteBehavior; |
@@ -181,7 +203,7 @@ discard block |
||
181 | 203 | * @param string $visibleHover |
182 | 204 | * @param array $editBehavior default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"data-ajax","params"=>"{}","method"=>"get") |
183 | 205 | * @param callable $callback this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
184 | - * @return DataTable |
|
206 | + * @return DataTableFieldAsTrait |
|
185 | 207 | */ |
186 | 208 | public function addEditButton($visibleHover=true,$editBehavior=[],$callback=null){ |
187 | 209 | $this->_editBehavior=$editBehavior; |
@@ -194,7 +216,7 @@ discard block |
||
194 | 216 | * @param array $behavior default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"data-ajax","params"=>"{}","method"=>"get") |
195 | 217 | * @param callable $callbackEdit this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
196 | 218 | * @param callable $callbackDelete this function takes the following arguments : $object=>the delete button, $instance : the active instance of the object |
197 | - * @return DataTable |
|
219 | + * @return DataTableFieldAsTrait |
|
198 | 220 | */ |
199 | 221 | public function addEditDeleteButtons($visibleHover=true,$behavior=[],$callbackEdit=null,$callbackDelete=null){ |
200 | 222 | $this->addEditButton($visibleHover,$behavior,$callbackEdit); |
@@ -203,6 +225,9 @@ discard block |
||
203 | 225 | return $this; |
204 | 226 | } |
205 | 227 | |
228 | + /** |
|
229 | + * @param callable $callback |
|
230 | + */ |
|
206 | 231 | public function insertDeleteButtonIn($index,$visibleHover=true,$deleteBehavior=[],$callback=null){ |
207 | 232 | $this->_deleteBehavior=$deleteBehavior; |
208 | 233 | return $this->insertDefaultButtonIn($index,"remove","_delete red basic",$visibleHover,$callback); |