60 $this->values = array();
61 if (is_array($a_value))
63 if (is_array($a_value[
'key']))
65 foreach ($a_value[
'key'] as $idx =>
$key)
67 array_push($this->values, array(
$key, $a_value[
'value'][$idx]));
80 $this->key_size = $a_size;
100 $this->value_size = $a_size;
120 $this->key_maxlength = $a_maxlength;
140 $this->value_maxlength = $a_maxlength;
160 $this->value_name = $a_name;
180 $this->key_name = $a_name;
200 $this->values = $a_values;
220 $this->allowMove = $a_allow_move;
242 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
245 if (is_array($foundvalues))
248 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value']))
250 foreach ($foundvalues[
'key'] as $val)
254 $this->
setAlert($lng->txt(
"msg_input_is_required"));
258 foreach ($foundvalues[
'value'] as $val)
262 $this->
setAlert($lng->txt(
"msg_input_is_required"));
271 $this->
setAlert($lng->txt(
"msg_input_is_required"));
280 $this->
setAlert($lng->txt(
"msg_input_is_required"));
296 $tpl =
new ilTemplate(
"tpl.prop_kvpwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
298 foreach ($this->values as
$value)
300 if (is_array($value))
302 $tpl->setCurrentBlock(
"prop_key_propval");
304 $tpl->parseCurrentBlock();
305 $tpl->setCurrentBlock(
"prop_value_propval");
307 $tpl->parseCurrentBlock();
311 $tpl->setCurrentBlock(
"move");
312 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
313 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
317 $tpl->parseCurrentBlock();
320 $tpl->setCurrentBlock(
"row");
321 $class = ($i % 2 == 0) ?
"even" :
"odd";
322 if ($i == 0) $class .=
" first";
323 if ($i == count($this->values)-1) $class .=
" last";
324 $tpl->setVariable(
"ROW_CLASS", $class);
325 $tpl->setVariable(
"ROW_NUMBER", $i);
332 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
336 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
337 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
343 $tpl->parseCurrentBlock();
351 $a_tpl->setCurrentBlock(
"prop_generic");
352 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
353 $a_tpl->parseCurrentBlock();
356 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
358 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/kvpwizard.js");