silverstripe-userforms/code/editor/EditableDropdown.php
Will Rossiter 3c1d81d014 ENHANCEMENT: added test coverage for UserDefinedForm.php and placeholders for other sections. API change: processNewFormFields removed
API change: refactored Form() into getFormFields(), getFormActions(), getRequiredFields()

ENHANCEMENT: added updateForm* extension hooks to allow customization of userforms
BUGFIX: gave custom scripts their own ID to enable it to be blocked.
2010-09-03 05:06:13 +00:00

32 lines
574 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);
}
}