. */ /** * Defines the field */ require_once(FILESYSTEMROOTPATH."include/form/AbstractFormField.php"); class MyCheckboxField extends AbstractFormField { private $checked=false; /** * Constructor */ public function __construct($name, $title, $value) { parent::__construct($name, $title); $this->value = $value; } public function getField( $i = NULL ) { if( is_numeric( $i ) ) { return "name."[]\" value=\"".$this->value[ $i ]."\"".($this->class!=NULL?" class=\"".$this->class."\"":"").($this->readonly?" readonly":"").($this->checked?" checked":"").">"; }else{ //echo $this->value.$this->name; //echo $this->getValue(); return "name."\" value=\"".$this->value."\"".($this->class!=NULL?" class=\"".$this->class."\"":"").($this->readonly?" readonly":"").($this->checked?" checked":"").">".$this->title; } } public function setChecked($checked) { $this->checked = $checked; return true; } public function getChecked() { return $this->checked; } } ?>