@@ 422-434 (lines=13) @@ | ||
419 | return $this; |
|
420 | } |
|
421 | ||
422 | public function fieldAsInput($index,$name=NULL,$type="text",$placeholder=""){ |
|
423 | $this->setValueFunction($index,function($value) use($index,$name,$type,$placeholder){ |
|
424 | $input=new HtmlInput($this->_getFieldIdentifier("input"),$type,$value,$placeholder); |
|
425 | if(isset($name)===false){ |
|
426 | $name=$this->_instanceViewer->getCaption($index)."[]"; |
|
427 | } |
|
428 | $input->getField()->setProperty("name", $name); |
|
429 | $input->setFluid(); |
|
430 | return $input; |
|
431 | } |
|
432 | ); |
|
433 | return $this; |
|
434 | } |
|
435 | ||
436 | public function fieldAsCheckbox($index,$name=NULL){ |
|
437 | $this->setValueFunction($index,function($value) use($index,$name){ |
|
@@ 436-447 (lines=12) @@ | ||
433 | return $this; |
|
434 | } |
|
435 | ||
436 | public function fieldAsCheckbox($index,$name=NULL){ |
|
437 | $this->setValueFunction($index,function($value) use($index,$name){ |
|
438 | $checkbox=new HtmlCheckbox($this->_getFieldIdentifier("ck"),"",$value); |
|
439 | $checkbox->setChecked(JString::isBooleanTrue($value)); |
|
440 | if(isset($name)===false){ |
|
441 | $name=$this->_instanceViewer->getCaption($index)."[]"; |
|
442 | } |
|
443 | $checkbox->getField()->setProperty("name", $name); |
|
444 | return $checkbox;} |
|
445 | ); |
|
446 | return $this; |
|
447 | } |
|
448 | ||
449 | public function fieldAsDropDown($index,$elements=[],$multiple=false,$name=NULL){ |
|
450 | $this->setValueFunction($index,function($value) use($index,$elements,$multiple,$name){ |