. */ /** * Defines the form field */ require_once(FILESYSTEMROOTPATH."include/form/IFormField.php"); abstract class AbstractFormField implements IFormField { protected $name; protected $title; protected $value = ""; protected $readonly = false; protected $compulsory = false; protected $class = NULL; protected $explanation = NULL; /** * Constructor */ public function __construct($name, $title) { $this->name = $name; $this->title = $title; } public function getName() { return $this->name; } public function getTitle( $i = NULL ) { if( is_numeric( $i ) ) return $this->title[$i]; else return $this->title; } public function getValue() { return $this->value; } public function setValue($value) { $this->value = $value; return $this; } public function getInputValue() { if( isset($_POST[$this->name]) ) { return $_POST[$this->name]; }else { return NULL; } } public function isReadonly() { return $this->readonly; } public function setReadonly($readonly) { $this->readonly = $readonly; return $this; } public function isCompulsory() { return $this->compulsory; } public function setCompulsory($compulsory) { $this->compulsory = $compulsory; return $this; } public function setClass($class) { $this->class = $class; return $this; } public function getClass() { return $this->class; } public function setExplanation($explanation) { $this->explanation = $explanation; return $this; } public function getExplanation() { return $this->explanation; } } ?>