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