mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
656a9fbb4e
- Make statics private - Use Config::get rather than eval to read private statics - Add a helper function to expose UserDefinedForm_EmailRecipient::$summary_fields (to make them available for i18n).
31 lines
595 B
PHP
Executable File
31 lines
595 B
PHP
Executable File
<?php
|
|
/**
|
|
* EditableDropdown
|
|
*
|
|
* Represents a modifiable dropdown (select) box on a form
|
|
*
|
|
* @package userforms
|
|
*/
|
|
|
|
class EditableDropdown extends EditableMultipleOptionField {
|
|
|
|
private static $singular_name = 'Dropdown Field';
|
|
|
|
private static $plural_name = 'Dropdowns';
|
|
|
|
/**
|
|
* @return DropdownField
|
|
*/
|
|
public 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);
|
|
}
|
|
} |