19 declare(strict_types=1);
34 $this->auto_sort = (bool) $a_value;
39 $this->force_radio = (bool) $a_value;
40 if ($this->force_radio) {
41 $this->option_infos = (array) $a_info;
47 $def = $this->
getADT()->getCopyOfDefinition();
48 $selection = $this->
getADT()->getSelection();
50 $options = $def->getOptions();
52 if ($this->auto_sort) {
57 $options = array(
"" =>
"-") + $options;
58 } elseif ($this->
getADT()->isNull()) {
59 $options = array(
"" => $this->
lng->txt(
"please_select")) + $options;
62 if (!$this->force_radio) {
65 $select->setOptions($options);
69 foreach ($options as $value => $caption) {
71 if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) {
72 $option->setInfo($this->option_infos[$value]);
74 $select->addOption($option);
80 $select->setValue($selection);
91 $field->setValue($this->
getADT()->getSelection());
96 return ($this->
getADT()->getSelection() == $a_parent_option);
This class represents an option in a radio group.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null