mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
27 lines
663 B
PHP
Executable File
27 lines
663 B
PHP
Executable File
<?php
|
|
/**
|
|
* EditableCheckbox
|
|
* A user modifiable checkbox on a UserDefinedForm
|
|
*
|
|
* @package userforms
|
|
*/
|
|
class EditableCheckbox extends EditableFormField {
|
|
|
|
static $singular_name = 'Checkbox';
|
|
|
|
static $plural_name = 'Checkboxes';
|
|
|
|
|
|
public function ExtraOptions() {
|
|
$fields = new FieldSet(
|
|
new CheckboxField("Fields[$this->ID][CustomSettings][Default]", _t('EditableFormField.CHECKEDBYDEFAULT', 'Checked by Default?'), $this->getSetting('Default'))
|
|
);
|
|
$fields->merge(parent::ExtraOptions());
|
|
return $fields;
|
|
}
|
|
|
|
public function getFormField() {
|
|
return new CheckboxField( $this->Name, $this->Title, $this->getSetting('Default'));
|
|
}
|
|
}
|
|
?>
|