silverstripe-userforms/code/model/formfields/EditableRadioField.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

29 lines
557 B
PHP
Executable File

<?php
/**
* EditableRadioField
*
* Represents a set of selectable radio buttons
*
* @package userforms
*/
class EditableRadioField extends EditableMultipleOptionField {
private static $singular_name = 'Radio field';
private static $plural_name = 'Radio fields';
public function getFormField() {
$optionSet = $this->Options();
$options = array();
if($optionSet) {
foreach( $optionSet as $option ) {
$options[$option->Title] = $option->Title;
}
}
return new OptionsetField($this->Name, $this->Title, $options);
}
}