50 $this->values = array();
51 if (is_array($a_value)) {
52 if (is_array($a_value[
'key'])) {
53 foreach ($a_value[
'key'] as $idx =>
$key) {
54 array_push($this->values, array(
$key, $a_value[
'value'][$idx]));
67 $this->key_size = $a_size;
87 $this->value_size = $a_size;
107 $this->key_maxlength = $a_maxlength;
127 $this->value_maxlength = $a_maxlength;
147 $this->value_name = $a_name;
167 $this->key_name = $a_name;
187 $this->values = $a_values;
207 $this->allowMove = $a_allow_move;
233 if (is_array($foundvalues)) {
235 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value'])) {
236 foreach ($foundvalues[
'key'] as $val) {
242 foreach ($foundvalues[
'value'] as $val) {
272 $tpl =
new ilTemplate(
"tpl.prop_kvpwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
274 foreach ($this->values as
$value) {
275 if (is_array($value)) {
276 $tpl->setCurrentBlock(
"prop_key_propval");
278 $tpl->parseCurrentBlock();
279 $tpl->setCurrentBlock(
"prop_value_propval");
281 $tpl->parseCurrentBlock();
284 $tpl->setCurrentBlock(
"move");
285 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
286 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
290 $tpl->parseCurrentBlock();
293 $tpl->setCurrentBlock(
"row");
294 $class = (
$i % 2 == 0) ?
"even" :
"odd";
298 if (
$i == count($this->values) - 1) {
301 $tpl->setVariable(
"ROW_CLASS", $class);
302 $tpl->setVariable(
"ROW_NUMBER",
$i);
309 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
313 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
314 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
320 $tpl->parseCurrentBlock();
334 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
335 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/kvpwizard.js");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
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...
static get(string $a_glyph, string $a_text="")
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl