2008-09-29 05:18:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2009-04-17 04:26:40 +02:00
|
|
|
* EditableRadioField
|
|
|
|
*
|
2008-09-29 05:18:23 +02:00
|
|
|
* Represents a set of selectable radio buttons
|
2009-04-17 04:26:40 +02:00
|
|
|
*
|
|
|
|
* @package userforms
|
2008-09-29 05:18:23 +02:00
|
|
|
*/
|
2009-12-07 03:04:20 +01:00
|
|
|
|
2009-04-17 04:26:40 +02:00
|
|
|
class EditableRadioField extends EditableMultipleOptionField {
|
2008-09-29 05:18:23 +02:00
|
|
|
|
2013-04-03 03:34:43 +02:00
|
|
|
private static $singular_name = 'Radio field';
|
2008-09-29 05:18:23 +02:00
|
|
|
|
2013-04-03 03:34:43 +02:00
|
|
|
private static $plural_name = 'Radio fields';
|
2008-09-29 05:18:23 +02:00
|
|
|
|
2012-07-17 06:09:31 +02:00
|
|
|
public function getFormField() {
|
2008-09-29 05:18:23 +02:00
|
|
|
$optionSet = $this->Options();
|
|
|
|
$options = array();
|
|
|
|
|
2009-04-27 08:00:05 +02:00
|
|
|
if($optionSet) {
|
|
|
|
foreach( $optionSet as $option ) {
|
2013-06-04 07:20:03 +02:00
|
|
|
$options[$option->EscapedTitle] = $option->Title;
|
2009-04-27 08:00:05 +02:00
|
|
|
}
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
|
|
|
|
2009-04-27 08:00:05 +02:00
|
|
|
return new OptionsetField($this->Name, $this->Title, $options);
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
2012-07-17 06:09:31 +02:00
|
|
|
}
|