silverstripe-userforms/code/model/formfields/EditableDropdown.php
Fred Condo 656a9fbb4e BUG: Fix access to static configuration variables
- 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).
2013-04-03 14:31:37 -07:00

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);
}
}