@@ -38,6 +38,10 @@ discard block |
||
38 | 38 | parent::run($js); |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param string $identifier |
|
43 | + * @param string $model |
|
44 | + */ |
|
41 | 45 | public function __construct($identifier,$model,$modelInstance=NULL) { |
42 | 46 | parent::__construct($identifier, $model,$modelInstance); |
43 | 47 | $this->_instanceViewer=new InstanceViewer(); |
@@ -164,21 +168,34 @@ discard block |
||
164 | 168 | return $this; |
165 | 169 | } |
166 | 170 | |
171 | + /** |
|
172 | + * @param \Closure $field |
|
173 | + */ |
|
167 | 174 | public function addField($field){ |
168 | 175 | $this->_instanceViewer->addField($field); |
169 | 176 | return $this; |
170 | 177 | } |
171 | 178 | |
179 | + /** |
|
180 | + * @param integer $index |
|
181 | + * @param \Closure $field |
|
182 | + */ |
|
172 | 183 | public function insertField($index,$field){ |
173 | 184 | $this->_instanceViewer->insertField($index, $field); |
174 | 185 | return $this; |
175 | 186 | } |
176 | 187 | |
188 | + /** |
|
189 | + * @param \Closure $field |
|
190 | + */ |
|
177 | 191 | public function insertInField($index,$field){ |
178 | 192 | $this->_instanceViewer->insertInField($index, $field); |
179 | 193 | return $this; |
180 | 194 | } |
181 | 195 | |
196 | + /** |
|
197 | + * @param \Closure $callback |
|
198 | + */ |
|
182 | 199 | public function setValueFunction($index,$callback){ |
183 | 200 | $this->_instanceViewer->setValueFunction($index, $callback); |
184 | 201 | return $this; |
@@ -222,16 +239,16 @@ discard block |
||
222 | 239 | /** |
223 | 240 | * @param string $caption |
224 | 241 | * @param callable $callback |
225 | - * @return callable |
|
242 | + * @return \Closure |
|
226 | 243 | */ |
227 | 244 | private function getFieldButtonCallable($caption,$callback=null){ |
228 | 245 | return $this->getCallable($this->getFieldButton($caption),$callback); |
229 | 246 | } |
230 | 247 | |
231 | 248 | /** |
232 | - * @param mixed $object |
|
249 | + * @param HtmlButton $object |
|
233 | 250 | * @param callable $callback |
234 | - * @return callable |
|
251 | + * @return \Closure |
|
235 | 252 | */ |
236 | 253 | private function getCallable($object,$callback=null){ |
237 | 254 | $result=function($instance) use($object,$callback){ |
@@ -290,12 +307,20 @@ discard block |
||
290 | 307 | return $this; |
291 | 308 | } |
292 | 309 | |
310 | + /** |
|
311 | + * @param string $icon |
|
312 | + * @param string $class |
|
313 | + */ |
|
293 | 314 | private function addDefaultButton($icon,$class=null,$callback=null){ |
294 | 315 | $bt=$this->getDefaultButton($icon,$class); |
295 | 316 | $this->addField($this->getCallable($bt,$callback)); |
296 | 317 | return $this; |
297 | 318 | } |
298 | 319 | |
320 | + /** |
|
321 | + * @param string $icon |
|
322 | + * @param string $class |
|
323 | + */ |
|
299 | 324 | private function insertDefaultButtonIn($index,$icon,$class=null,$callback=null){ |
300 | 325 | $bt=$this->getDefaultButton($icon,$class); |
301 | 326 | $this->insertInField($index,$this->getCallable($bt,$callback)); |
@@ -458,6 +483,9 @@ discard block |
||
458 | 483 | return $this; |
459 | 484 | } |
460 | 485 | |
486 | + /** |
|
487 | + * @param string $prefix |
|
488 | + */ |
|
461 | 489 | private function _getFieldIdentifier($prefix){ |
462 | 490 | return $this->identifier."-{$prefix}-".$this->_instanceViewer->getIdentifier(); |
463 | 491 | } |