mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-09-08 10:41:30 +02:00
29 lines
541 B
PHP
Executable File
29 lines
541 B
PHP
Executable File
<?php
|
|
/**
|
|
* EditableDropdown
|
|
*
|
|
* Represents a modifiable dropdown box on a form
|
|
*
|
|
* @package userforms
|
|
*/
|
|
class EditableDropdown extends EditableMultipleOptionField {
|
|
|
|
static $singular_name = 'Dropdown';
|
|
|
|
static $plural_name = 'Dropdowns';
|
|
|
|
|
|
function getFormField($asFilter = false) {
|
|
$optionSet = $this->Options();
|
|
$options = array();
|
|
if($optionSet) {
|
|
foreach( $optionSet as $option ) {
|
|
$options[$option->Title] = $option->Title;
|
|
}
|
|
}
|
|
return new DropdownField( $this->Name, $this->Title, $options);
|
|
}
|
|
|
|
}
|
|
?>
|