19 declare(strict_types=1);
34 string $a_postvar =
"" 38 $this->
lng = $DIC->language();
45 $this->options[] = $a_option;
53 public function setValue(
string $a_value): void
55 $this->value = $a_value;
67 foreach ($option->getSubItems() as $item) {
68 $item->setValueByArray($a_values);
86 foreach ($option->getSubItems() as $item) {
87 if ($value == $option->getValue()) {
88 if (!$item->checkInput()) {
113 $tpl =
new ilTemplate(
"tpl.prop_radio.html",
true,
true,
"components/ILIAS/Form");
117 if ($option->getInfo() !=
"") {
118 $tpl->setCurrentBlock(
"radio_option_desc");
119 $tpl->setVariable(
"RADIO_OPTION_DESC", $option->getInfo());
120 if ($option->getInfo() !==
'') {
121 $tpl->setVariable(
'DESCRIPTION_FOR_ID', $this->
getFieldId() .
"_" . $option->getValue());
123 $tpl->parseCurrentBlock();
127 if (count($option->getSubItems()) > 0) {
128 if ($option->getValue() != $this->
getValue()) {
130 if ($this->global_tpl) {
131 $hop_id = $this->
getFieldId() .
"_" . $option->getValue();
132 $this->global_tpl->addOnloadCode(
133 "il.Form.hideSubForm('subform_$hop_id');" 138 "il.Form.hideSubForm('subform_$hop_id');" 142 $tpl->setCurrentBlock(
"radio_option_subform");
144 $pf->setMode(
"subform");
145 $pf->setItems($option->getSubItems());
146 $tpl->setVariable(
"SUB_FORM", $pf->getContent());
147 $tpl->setVariable(
"SOP_ID", $this->
getFieldId() .
"_" . $option->getValue());
148 if ($pf->getMultipart()) {
151 $tpl->parseCurrentBlock();
152 if ($pf->getMultipart()) {
157 $tpl->setCurrentBlock(
"prop_radio_option");
158 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
159 $tpl->setVariable(
"VAL_RADIO_OPTION", $option->getValue());
160 $tpl->setVariable(
"OP_ID", $this->
getFieldId() .
"_" . $option->getValue());
161 if ($option->getInfo() !==
'') {
162 $tpl->setVariable(
'DESCRIBED_BY_FIELD_ID', $this->
getFieldId() .
"_" . $option->getValue());
164 $tpl->setVariable(
"FID", $this->
getFieldId());
165 if ($this->
getDisabled() or $option->getDisabled()) {
166 $tpl->setVariable(
'DISABLED',
'disabled="disabled" ');
168 if ($option->getValue() == $this->
getValue()) {
174 $tpl->setVariable(
"TXT_RADIO_OPTION", $option->getTitle());
177 $tpl->parseCurrentBlock();
198 foreach ($option->getSubItems() as $item) {
199 if ($item->getType() !=
"section_header") {
200 $ret = $item->getItemByPostVar($a_post_var);
201 if (is_object($ret)) {
218 $subInputItems = parent::getSubInputItemsRecursive();
223 $subInputItems = array_merge($subInputItems, $option->getSubInputItemsRecursive());
226 return $subInputItems;
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
This class represents an option in a radio group.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)