ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclMultiTextInputGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10{
11 public function setValues($values)
12 {
13 $this->setIdentifiedMultiValues($values);
14 }
15
16 public function getValues()
17 {
19 }
20
21 public function setValue($value)
22 {
24 }
25
26 public function getValue()
27 {
29 }
30
31 public function setMultiValues(array $values)
32 {
33 $this->setIdentifiedMultiValues($values);
34 }
35
36 public function getMultiValues()
37 {
39 }
40
41 // protected function getMultiValuePostVar($identifier)
42 // {
43 // return $this->getPostVar();
44 // }
45 public function render($a_mode = "")
46 {
47 $tpl = new ilTemplate("tpl.prop_multi_text_inp.html", true, true, "Services/Form");
48 $i = 0;
49 foreach ($this->getIdentifiedMultiValues() as $identifier => $value) {
50 if (is_array($value)) {
51 $value = array_shift($value);
52 }
53 if (strlen($value)) {
54 $tpl->setCurrentBlock("prop_text_propval");
55 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value));
56 $tpl->parseCurrentBlock();
57 }
58 if ($this->isEditElementOrderEnabled()) {
59 $tpl->setCurrentBlock("move");
60 $tpl->setVariable("ID_UP", $this->getMultiValuePosIndexedSubFieldId($identifier, 'up', $i));
61 $tpl->setVariable("ID_DOWN", $this->getMultiValuePosIndexedSubFieldId($identifier, 'down', $i));
62 $tpl->setVariable("CMD_UP", $this->buildMultiValueSubmitVar($identifier, $i, 'up'));
63 $tpl->setVariable("CMD_DOWN", $this->buildMultiValueSubmitVar($identifier, $i, 'down'));
64 $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
65 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
66 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
67 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
68 $tpl->parseCurrentBlock();
69 }
70 $tpl->setCurrentBlock("row");
71 $tpl->setVariable("POST_VAR", $this->getMultiValuePostVarPosIndexed($identifier, $i));
72 $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
73 $tpl->setVariable("SIZE", $this->getSize());
74 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
75
76 if ($this->getDisabled()) {
77 $tpl->setVariable(
78 "DISABLED",
79 " disabled=\"disabled\""
80 );
81 } elseif ($this->isEditElementOccuranceEnabled()) {
82 $tpl->setVariable("ID_ADD", $this->getMultiValuePosIndexedSubFieldId($identifier, 'add', $i));
83 $tpl->setVariable("ID_REMOVE", $this->getMultiValuePosIndexedSubFieldId($identifier, 'remove', $i));
84 $tpl->setVariable("CMD_ADD", $this->buildMultiValueSubmitVar($identifier, $i, 'add'));
85 $tpl->setVariable("CMD_REMOVE", $this->buildMultiValueSubmitVar($identifier, $i, 'remove'));
86 include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
87 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
88 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
89 }
90
91 $tpl->parseCurrentBlock();
92 $i++;
93 }
94 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
95
96 if (!$this->getDisabled()) {
97 $tpl->setCurrentBlock('js_engine_initialisation');
98 $tpl->touchBlock('js_engine_initialisation');
99 $tpl->parseCurrentBlock();
100
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
106 return $tpl->get();
107 }
108}
$tpl
Definition: ilias.php:10
An exception for terminatinating execution or to throw for unit testing.
Class ilDclMultiTextInputGUI.
setMultiValues(array $values)
Set multi values.
getFieldId()
Get Post Variable.
static get($a_glyph, $a_text="")
Get glyph html.
getMultiValuePosIndexedSubFieldId($identifier, $subFieldIndex, $positionIndex)
buildMultiValueSubmitVar($identifier, $positionIndex, $submitCommand)
special template class to simplify handling of ITX/PEAR
getMaxLength()
Get Max Length.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$i
Definition: disco.tpl.php:19
$GLOBALS['loaded']
Global hash that tracks already loaded includes.