3 declare(strict_types=1);
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 = (array) $a_info;
31 $def = $this->
getADT()->getCopyOfDefinition();
32 $selection = $this->
getADT()->getSelection();
34 $options = $def->getOptions();
36 if ($this->auto_sort) {
41 $options = array(
"" =>
"-") + $options;
42 } elseif ($this->
getADT()->isNull()) {
43 $options = array(
"" => $this->
lng->txt(
"please_select")) + $options;
46 if (!$this->force_radio) {
49 $select->setOptions($options);
53 foreach ($options as $value => $caption) {
55 if (is_array($this->option_infos) && array_key_exists($value, $this->option_infos)) {
56 $option->setInfo($this->option_infos[$value]);
58 $select->addOption($option);
64 $select->setValue($selection);
75 $field->setValue($this->
getADT()->getSelection());
80 return ($this->
getADT()->getSelection() == $a_parent_option);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...