24 include_once(
"./Services/Form/classes/class.ilCheckboxOption.php");
57 $this->options[] = $a_option;
67 foreach($a_options as $key => $label) {
68 if (is_string($label)) {
70 $this->options[] = $chb;
73 $this->options[] = $label;
95 $this->value = $a_value;
118 foreach($option->getSubItems() as $item)
120 $item->setValueByArray($a_values);
136 $this->
setAlert($lng->txt(
"msg_input_is_required"));
144 foreach($option->getSubItems() as $item)
146 $item_ok = $item->checkInput();
147 if (!$item_ok && in_array($option->getValue(),
$_POST[$this->
getPostVar()]))
164 $tpl =
new ilTemplate(
"tpl.prop_checkbox_group.html",
true,
true,
"Services/Form");
169 if ($option->getInfo() !=
"")
171 $tpl->setCurrentBlock(
"checkbox_option_desc");
172 $tpl->setVariable(
"CHECKBOX_OPTION_DESC", $option->getInfo());
173 $tpl->parseCurrentBlock();
177 if (count($option->getSubItems()) > 0)
179 $tpl->setCurrentBlock(
"checkbox_option_subform");
181 $pf->setMode(
"subform");
182 $pf->setItems($option->getSubItems());
183 $tpl->setVariable(
"SUB_FORM", $pf->getContent());
184 $tpl->setVariable(
"SOP_ID", $this->
getFieldId().
"_".$option->getValue());
185 if ($pf->getMultipart())
189 $tpl->parseCurrentBlock();
190 if ($pf->getMultipart())
196 $tpl->setCurrentBlock(
"prop_checkbox_option");
198 $tpl->setVariable(
"VAL_CHECKBOX_OPTION", $option->getValue());
199 $tpl->setVariable(
"OP_ID", $this->
getFieldId().
"_".$option->getValue());
203 $tpl->setVariable(
'DISABLED',
'disabled="disabled" ');
207 if (in_array($option->getValue(), $this->
getValue()))
209 $tpl->setVariable(
"CHK_CHECKBOX_OPTION",
210 'checked="checked"');
213 $tpl->setVariable(
"TXT_CHECKBOX_OPTION", $option->getTitle());
216 $tpl->parseCurrentBlock();
220 $a_tpl->setCurrentBlock(
"prop_generic");
221 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
222 $a_tpl->parseCurrentBlock();
240 foreach($option->getSubItems() as $item)
242 if ($item->getType() !=
"section_header")
244 $ret = $item->getItemByPostVar($a_post_var);