mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
3c1d81d014
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.
32 lines
574 B
PHP
Executable File
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);
|
|
}
|
|
} |