ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  {
14  }
15 
16 
17  public function getValues()
18  {
19  $this->getIdentifiedMultiValues();
20  }
21 
22 
23  public function setValue($value)
24  {
26  }
27 
28 
29  public function getValue()
30  {
31  $this->getIdentifiedMultiValues();
32  }
33 
34 
35  public function setMultiValues(array $values)
36  {
37  $this->setIdentifiedMultiValues($values);
38  }
39 
40 
41  public function getMultiValues()
42  {
43  $this->getIdentifiedMultiValues();
44  }
45 
46  // protected function getMultiValuePostVar($identifier)
47  // {
48  // return $this->getPostVar();
49  // }
50  public function render($a_mode = "")
51  {
52  $tpl = new ilTemplate("tpl.prop_multi_text_inp.html", true, true, "Services/Form");
53  $i = 0;
54  foreach ($this->getIdentifiedMultiValues() as $identifier => $value) {
55  if (is_array($value)) {
56  $value = array_shift($value);
57  }
58  if (strlen($value)) {
59  $tpl->setCurrentBlock("prop_text_propval");
60  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value));
61  $tpl->parseCurrentBlock();
62  }
63  if ($this->isEditElementOrderEnabled()) {
64  $tpl->setCurrentBlock("move");
65  $tpl->setVariable("ID_UP", $this->getMultiValuePosIndexedSubFieldId($identifier, 'up', $i));
66  $tpl->setVariable("ID_DOWN", $this->getMultiValuePosIndexedSubFieldId($identifier, 'down', $i));
67  $tpl->setVariable("CMD_UP", $this->buildMultiValueSubmitVar($identifier, $i, 'up'));
68  $tpl->setVariable("CMD_DOWN", $this->buildMultiValueSubmitVar($identifier, $i, 'down'));
69  $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
70  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
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  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
92  $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
93  $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
94  }
95 
96  $tpl->parseCurrentBlock();
97  $i++;
98  }
99  $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
100 
101  if (!$this->getDisabled()) {
102  $tpl->setCurrentBlock('js_engine_initialisation');
103  $tpl->touchBlock('js_engine_initialisation');
104  $tpl->parseCurrentBlock();
105 
106  $globalTpl = $GLOBALS['DIC'] ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
107  $globalTpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
108  $globalTpl->addJavascript("./Services/Form/js/ServiceFormIdentifiedWizardInputExtend.js");
109  }
110 
111  return $tpl->get();
112  }
113 }
Class ilDclMultiTextInputGUI.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
getMultiValuePosIndexedSubFieldId($identifier, $subFieldIndex, $positionIndex)
$tpl
Definition: ilias.php:10
static get($a_glyph, $a_text="")
Get glyph html.
buildMultiValueSubmitVar($identifier, $positionIndex, $submitCommand)
$values
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
$i
Definition: disco.tpl.php:19
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.