ILIAS  release_8 Revision v8.24
class.ilDclMultiTextInputGUI.php
Go to the documentation of this file.
1<?php
2
20{
21 public function setValues($values): void
22 {
23 $this->setIdentifiedMultiValues($values);
24 }
25
26 public function getValues(): array
27 {
28 return $this->getIdentifiedMultiValues();
29 }
30
31 public function setValue($value): void
32 {
34 }
35
36 public function getValue(): array
37 {
38 return $this->getIdentifiedMultiValues();
39 }
40
41 public function setMultiValues(array $values): void
42 {
43 $this->setIdentifiedMultiValues($values);
44 }
45
46 public function getMultiValues(): array
47 {
48 return $this->getIdentifiedMultiValues();
49 }
50
51 public function render(string $a_mode = ""): string
52 {
53 $tpl = new ilTemplate("tpl.prop_multi_text_inp.html", true, true, "Services/Form");
54 $i = 0;
55 foreach ($this->getIdentifiedMultiValues() as $identifier => $value) {
56 if (is_array($value)) {
57 $value = array_shift($value);
58 }
59 if (strlen($value)) {
60 $tpl->setCurrentBlock("prop_text_propval");
61 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value));
62 $tpl->parseCurrentBlock();
63 }
64 if ($this->isEditElementOrderEnabled()) {
65 $tpl->setCurrentBlock("move");
66 $tpl->setVariable("ID_UP", $this->getMultiValuePosIndexedSubFieldId($identifier, 'up', $i));
67 $tpl->setVariable("ID_DOWN", $this->getMultiValuePosIndexedSubFieldId($identifier, 'down', $i));
68 $tpl->setVariable("CMD_UP", $this->buildMultiValueSubmitVar($identifier, $i, 'up'));
69 $tpl->setVariable("CMD_DOWN", $this->buildMultiValueSubmitVar($identifier, $i, 'down'));
70 $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
71 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
72 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
73 $tpl->parseCurrentBlock();
74 }
75 $tpl->setCurrentBlock("row");
76 $tpl->setVariable("POST_VAR", $this->getMultiValuePostVarPosIndexed($identifier, $i));
77 $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
78 $tpl->setVariable("SIZE", $this->getSize());
79 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
80
81 if ($this->getDisabled()) {
82 $tpl->setVariable(
83 "DISABLED",
84 " disabled=\"disabled\""
85 );
86 } elseif ($this->isEditElementOccuranceEnabled()) {
87 $tpl->setVariable("ID_ADD", $this->getMultiValuePosIndexedSubFieldId($identifier, 'add', $i));
88 $tpl->setVariable("ID_REMOVE", $this->getMultiValuePosIndexedSubFieldId($identifier, 'remove', $i));
89 $tpl->setVariable("CMD_ADD", $this->buildMultiValueSubmitVar($identifier, $i, 'add'));
90 $tpl->setVariable("CMD_REMOVE", $this->buildMultiValueSubmitVar($identifier, $i, 'remove'));
91 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
92 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
93 }
94
95 $tpl->parseCurrentBlock();
96 $i++;
97 }
98 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
99
100 if (!$this->getDisabled()) {
101 $globalTpl = $GLOBALS['DIC'] ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
102 $globalTpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
103 $globalTpl->addJavascript("./Services/Form/js/ServiceFormIdentifiedWizardInputExtend.js");
104
105 $globalTpl->addJavascript("./Services/Form/js/ServiceFormMultiTextInputInit.js");
106 }
107
108 return $tpl->get();
109 }
110}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static get(string $a_glyph, string $a_text="")
getMultiValuePosIndexedSubFieldId($identifier, $subFieldIndex, $positionIndex)
buildMultiValueSubmitVar($identifier, $positionIndex, $submitCommand)
static prepareFormOutput($a_str, bool $a_strip=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:41