3 require_once
"Services/ADT/classes/Bridges/class.ilADTFormBridge.php";
18 $this->auto_sort = (bool) $a_value;
21 public function forceRadio($a_value, array $a_info = null)
23 $this->force_radio = (bool) $a_value;
24 if ($this->force_radio) {
25 $this->option_infos = $a_info;
35 $def = $this->
getADT()->getCopyOfDefinition();
36 $selection = $this->
getADT()->getSelection();
38 $options = $def->getOptions();
40 if ((
bool) $this->auto_sort) {
45 $options = array(
"" =>
"-") + $options;
46 } elseif ($this->
getADT()->isNull()) {
47 $options = array(
"" =>
$lng->txt(
"please_select")) + $options;
53 $select->setOptions($options);
57 foreach ($options as $value => $caption) {
59 if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) {
60 $option->setInfo($this->option_infos[$value]);
62 $select->addOption($option);
68 $select->setValue($selection);
79 $field->setValue($this->
getADT()->getSelection());
84 return ($this->
getADT()->getSelection() == $a_parent_option);
This class represents an option in a radio group.