@@ -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); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * define the button style |
50 | - * @param string|int $cssStyle |
|
50 | + * @param string $cssStyle |
|
51 | 51 | * @return HtmlButton default : "" |
52 | 52 | */ |
53 | 53 | public function setStyle($cssStyle) { |
@@ -11,6 +11,11 @@ discard block |
||
11 | 11 | */ |
12 | 12 | trait JsUtilsActionsTrait { |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $element |
|
16 | + * @param string $js |
|
17 | + * @param string $event |
|
18 | + */ |
|
14 | 19 | abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
15 | 20 | /** |
16 | 21 | * show or hide with effect |
@@ -35,7 +40,7 @@ discard block |
||
35 | 40 | } |
36 | 41 | /** |
37 | 42 | * Ensures the speed parameter is valid for jQuery |
38 | - * @param string|int $speed |
|
43 | + * @param string $speed |
|
39 | 44 | * @return string |
40 | 45 | */ |
41 | 46 | private function _validate_speed($speed) { |
@@ -364,7 +369,7 @@ discard block |
||
364 | 369 | * |
365 | 370 | * @param string $element |
366 | 371 | * @param array $options |
367 | - * @return void |
|
372 | + * @return string |
|
368 | 373 | */ |
369 | 374 | public function sortable($element, $options=array()) { |
370 | 375 | if (count($options)>0) { |
@@ -435,7 +440,7 @@ discard block |
||
435 | 440 | * @param string $jqueryCall the JQuery callback |
436 | 441 | * @param mixed $param array or string parameters |
437 | 442 | * @param string $jsCallback javascript code to execute after the jquery call |
438 | - * @return mixed |
|
443 | + * @return string |
|
439 | 444 | */ |
440 | 445 | public function doJQuery($element, $jqueryCall, $param="", $jsCallback="") { |
441 | 446 | return $this->_doJQuery($element, $jqueryCall, $param, $jsCallback, true); |
@@ -447,7 +452,7 @@ discard block |
||
447 | 452 | * @param string $jqueryCall the JQuery callback |
448 | 453 | * @param mixed $param array or string parameters |
449 | 454 | * @param string $jsCallback javascript code to execute after the jquery call |
450 | - * @return mixed |
|
455 | + * @return string |
|
451 | 456 | */ |
452 | 457 | public function doJQueryDeferred($element, $jqueryCall, $param="", $jsCallback="") { |
453 | 458 | return $this->_doJQuery($element, $jqueryCall, $param, $jsCallback, false); |
@@ -459,7 +464,7 @@ discard block |
||
459 | 464 | * @param string $element |
460 | 465 | * @param string $elementToModify |
461 | 466 | * @param string $jqueryCall |
462 | - * @param string|array $param |
|
467 | + * @param string $param |
|
463 | 468 | * @param boolean $preventDefault |
464 | 469 | * @param boolean $stopPropagation |
465 | 470 | * @param string $jsCallback javascript code to execute after the jquery call |
@@ -504,7 +509,6 @@ discard block |
||
504 | 509 | /** |
505 | 510 | * Executes the code $js |
506 | 511 | * @param string $js Code to execute |
507 | - * @param boolean $immediatly delayed if false |
|
508 | 512 | * @return String |
509 | 513 | */ |
510 | 514 | public function execAtLast($js) { |
@@ -17,9 +17,16 @@ |
||
17 | 17 | */ |
18 | 18 | trait FieldTrait { |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $name |
|
22 | + */ |
|
20 | 23 | abstract public function addToProperty($name, $value, $separator=" "); |
21 | 24 | abstract public function addLabel($caption, $style="label-default", $leftSeparator=" "); |
22 | 25 | abstract public function addContent($content,$before=false); |
26 | + |
|
27 | + /** |
|
28 | + * @return string |
|
29 | + */ |
|
23 | 30 | abstract public function getField(); |
24 | 31 | abstract public function getDataField(); |
25 | 32 |
@@ -50,6 +50,10 @@ discard block |
||
50 | 50 | return $itemO; |
51 | 51 | } |
52 | 52 | |
53 | + /** |
|
54 | + * @param string $classname |
|
55 | + * @param integer $index |
|
56 | + */ |
|
53 | 57 | protected function setItemIdentifier($item,$classname,$index){ |
54 | 58 | if($item instanceof BaseWidget){ |
55 | 59 | if(JString::isNull($item->getIdentifier())){ |
@@ -94,6 +98,9 @@ discard block |
||
94 | 98 | return $this; |
95 | 99 | } |
96 | 100 | |
101 | + /** |
|
102 | + * @param integer $index |
|
103 | + */ |
|
97 | 104 | public function removeItem($index){ |
98 | 105 | return array_splice($this->content, $index, 1); |
99 | 106 | } |
@@ -109,6 +116,9 @@ discard block |
||
109 | 116 | return $this->addItem($function($object)); |
110 | 117 | } |
111 | 118 | |
119 | + /** |
|
120 | + * @param \Closure $callBack |
|
121 | + */ |
|
112 | 122 | public function apply($callBack){ |
113 | 123 | foreach ($this->content as $item){ |
114 | 124 | $callBack($item); |
@@ -83,6 +83,9 @@ discard block |
||
83 | 83 | |
84 | 84 | } |
85 | 85 | |
86 | + /** |
|
87 | + * @param integer $index |
|
88 | + */ |
|
86 | 89 | protected function _getDefaultValue($name,$value,$index){ |
87 | 90 | $func=$this->defaultValueFunction; |
88 | 91 | return $func($name,$value,$index,$this->instance); |
@@ -244,6 +247,9 @@ discard block |
||
244 | 247 | return $this; |
245 | 248 | } |
246 | 249 | |
250 | + /** |
|
251 | + * @param callable $callback |
|
252 | + */ |
|
247 | 253 | public function setValueFunction($index,$callback){ |
248 | 254 | $this->values[$index]=$callback; |
249 | 255 | return $this; |
@@ -254,6 +260,9 @@ discard block |
||
254 | 260 | return $this; |
255 | 261 | } |
256 | 262 | |
263 | + /** |
|
264 | + * @param integer $index |
|
265 | + */ |
|
257 | 266 | public static function setIndex($index) { |
258 | 267 | self::$index=$index; |
259 | 268 | } |
@@ -313,7 +322,7 @@ discard block |
||
313 | 322 | * The $callback function can take the following arguments : $field=>the compiled field, $instance : the active instance of the object, $index: the field position |
314 | 323 | * @param int $index postion of the compiled field |
315 | 324 | * @param callable $callback function called after the field compilation |
316 | - * @return \Ajax\semantic\widgets\datatable\InstanceViewer |
|
325 | + * @return InstanceViewer |
|
317 | 326 | */ |
318 | 327 | public function afterCompile($index,$callback){ |
319 | 328 | $this->afterCompile[$index]=$callback; |