2008-09-29 05:18:23 +02:00
< ? php
/**
* EditableCheckbox
* A user modifiable checkbox on a UserDefinedForm
2009-04-17 04:26:40 +02:00
*
* @ package userforms
2008-09-29 05:18:23 +02:00
*/
class EditableCheckbox extends EditableFormField {
static $singular_name = 'Checkbox' ;
2009-04-25 04:54:10 +02:00
static $plural_name = 'Checkboxes' ;
2008-09-29 05:18:23 +02:00
2009-04-25 04:54:10 +02:00
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 ;
2008-09-29 05:18:23 +02:00
}
function getFormField () {
2009-04-25 04:54:10 +02:00
return new CheckboxField ( $this -> Name , $this -> Title , $this -> getSetting ( 'Default' ));
2008-09-29 05:18:23 +02:00
}
function getFilterField () {
2009-03-25 03:06:28 +01:00
return new OptionsetField ( $this -> Name , $this -> Title ,
array ( '-1' => '(' . _t ( 'EditableCheckbox.ANY' , 'Any' ) . ')' ,
'on' => _t ( 'EditableCheckbox.SELECTED' , 'Selected' ),
'0' => _t ( 'EditableCheckbox.NOTSELECTED' , 'Not selected' ) )
2008-09-29 05:18:23 +02:00
);
}
}
?>