Source of file CheckableOption.php
Size: 1,097 Bytes - Last Modified: 2021-12-23T10:30:31+00:00
/var/www/docs.ssmods.com/process/src/code/formfields/CheckableOption.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php class CheckableOption extends CompositeField { protected $childField, $checkbox; public function __construct($checkName, $childField, $value = "", $readonly = false) { $this->name = $checkName; $this->checkbox = new CheckboxField($checkName, "", $value); if ($readonly) { $this->checkbox->setDisabled(true); } $this->childField = $childField; $children = new FieldList( $this->childField, $this->checkbox ); parent::__construct($children); } public function FieldHolder($properties = array()) { return FormField::FieldHolder($properties); } public function Message() { return $this->childField->Message(); } public function MessageType() { return $this->childField->MessageType(); } public function Title() { return $this->childField->Title(); } public function Field($properties = array()) { return $this->childField->Field() . ' ' . $this->checkbox->Field(); } } |