24 include_once(
"./Services/Form/classes/class.ilCheckboxOption.php");
59 $this->use_values_as_keys = $a_val;
79 $this->options[] = $a_option;
89 foreach($a_options as $key => $label) {
90 if (is_string($label)) {
92 $this->options[] = $chb;
95 $this->options[] = $label;
117 $this->value = $a_value;
140 foreach($option->getSubItems() as $item)
142 $item->setValueByArray($a_values);
158 $this->
setAlert($lng->txt(
"msg_input_is_required"));
166 foreach($option->getSubItems() as $item)
168 $item_ok = $item->checkInput();
169 if (!$item_ok && in_array($option->getValue(),
$_POST[$this->
getPostVar()]))
186 $tpl =
new ilTemplate(
"tpl.prop_checkbox_group.html",
true,
true,
"Services/Form");
191 if ($option->getInfo() !=
"")
193 $tpl->setCurrentBlock(
"checkbox_option_desc");
194 $tpl->setVariable(
"CHECKBOX_OPTION_DESC", $option->getInfo());
195 $tpl->parseCurrentBlock();
199 if (count($option->getSubItems()) > 0)
201 $tpl->setCurrentBlock(
"checkbox_option_subform");
203 $pf->setMode(
"subform");
204 $pf->setItems($option->getSubItems());
205 $tpl->setVariable(
"SUB_FORM", $pf->getContent());
206 $tpl->setVariable(
"SOP_ID", $this->
getFieldId().
"_".$option->getValue());
207 if ($pf->getMultipart())
211 $tpl->parseCurrentBlock();
212 if ($pf->getMultipart())
218 $tpl->setCurrentBlock(
"prop_checkbox_option");
223 $tpl->setVariable(
"VAL_CHECKBOX_OPTION", $option->getValue());
227 $tpl->setVariable(
"POST_VAR", $this->
getPostVar().
'['.$option->getValue().
']');
228 $tpl->setVariable(
"VAL_CHECKBOX_OPTION",
"1");
231 $tpl->setVariable(
"OP_ID", $this->
getFieldId().
"_".$option->getValue());
236 $tpl->setVariable(
'DISABLED',
'disabled="disabled" ');
243 if (in_array($option->getValue(), $this->
getValue()))
245 $tpl->setVariable(
"CHK_CHECKBOX_OPTION",
246 'checked="checked"');
252 if ($cval[$option->getValue()] == 1)
254 $tpl->setVariable(
"CHK_CHECKBOX_OPTION",
255 'checked="checked"');
259 $tpl->setVariable(
"TXT_CHECKBOX_OPTION", $option->getTitle());
262 $tpl->parseCurrentBlock();
266 $a_tpl->setCurrentBlock(
"prop_generic");
267 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
268 $a_tpl->parseCurrentBlock();
286 foreach($option->getSubItems() as $item)
288 if ($item->getType() !=
"section_header")
290 $ret = $item->getItemByPostVar($a_post_var);