40 $this->values = array();
41 if (is_array($a_value))
43 if (is_array($a_value[
'key']))
45 foreach ($a_value[
'key'] as $idx => $key)
47 array_push($this->values, array($key, $a_value[
'value'][$idx]));
60 $this->key_size = $a_size;
80 $this->value_size = $a_size;
100 $this->key_maxlength = $a_maxlength;
120 $this->value_maxlength = $a_maxlength;
140 $this->value_name = $a_name;
160 $this->key_name = $a_name;
180 $this->values = $a_values;
200 $this->allowMove = $a_allow_move;
224 if (is_array($foundvalues))
227 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value']))
229 foreach ($foundvalues[
'key'] as $val)
233 $this->
setAlert($lng->txt(
"msg_input_is_required"));
237 foreach ($foundvalues[
'value'] as $val)
241 $this->
setAlert($lng->txt(
"msg_input_is_required"));
250 $this->
setAlert($lng->txt(
"msg_input_is_required"));
259 $this->
setAlert($lng->txt(
"msg_input_is_required"));
275 $tpl =
new ilTemplate(
"tpl.prop_kvpwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
277 foreach ($this->values as
$value)
279 if (is_array($value))
281 $tpl->setCurrentBlock(
"prop_key_propval");
283 $tpl->parseCurrentBlock();
284 $tpl->setCurrentBlock(
"prop_value_propval");
286 $tpl->parseCurrentBlock();
290 $tpl->setCurrentBlock(
"move");
291 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
292 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
296 $tpl->parseCurrentBlock();
299 $tpl->setCurrentBlock(
"row");
300 $class = ($i % 2 == 0) ?
"even" :
"odd";
301 if ($i == 0) $class .=
" first";
302 if ($i == count($this->values)-1) $class .=
" last";
303 $tpl->setVariable(
"ROW_CLASS", $class);
304 $tpl->setVariable(
"ROW_NUMBER", $i);
311 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
315 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
316 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
322 $tpl->parseCurrentBlock();
330 $a_tpl->setCurrentBlock(
"prop_generic");
331 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
332 $a_tpl->parseCurrentBlock();
335 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
337 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/kvpwizard.js");