ILIAS  release_7 Revision v7.30-3-g800a261c036
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
17 public function getValues()
18 {
20 }
21
22
23 public function setValue($value)
24 {
26 }
27
28
29 public function getValue()
30 {
32 }
33
34
35 public function setMultiValues(array $values)
36 {
37 $this->setIdentifiedMultiValues($values);
38 }
39
40
41 public function getMultiValues()
42 {
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 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
71 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
72 $tpl->parseCurrentBlock();
73 }
74 $tpl->setCurrentBlock("row");
75 $tpl->setVariable("POST_VAR", $this->getMultiValuePostVarPosIndexed($identifier, $i));
76 $tpl->setVariable("ID", $this->getMultiValuePosIndexedFieldId($identifier, $i));
77 $tpl->setVariable("SIZE", $this->getSize());
78 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
79
80 if ($this->getDisabled()) {
81 $tpl->setVariable(
82 "DISABLED",
83 " disabled=\"disabled\""
84 );
85 } elseif ($this->isEditElementOccuranceEnabled()) {
86 $tpl->setVariable("ID_ADD", $this->getMultiValuePosIndexedSubFieldId($identifier, 'add', $i));
87 $tpl->setVariable("ID_REMOVE", $this->getMultiValuePosIndexedSubFieldId($identifier, 'remove', $i));
88 $tpl->setVariable("CMD_ADD", $this->buildMultiValueSubmitVar($identifier, $i, 'add'));
89 $tpl->setVariable("CMD_REMOVE", $this->buildMultiValueSubmitVar($identifier, $i, 'remove'));
90 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
91 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
92 }
93
94 $tpl->parseCurrentBlock();
95 $i++;
96 }
97 $tpl->setVariable("ELEMENT_ID", $this->getFieldId());
98
99 if (!$this->getDisabled()) {
100 $tpl->setCurrentBlock('js_engine_initialisation');
101 $tpl->touchBlock('js_engine_initialisation');
102 $tpl->parseCurrentBlock();
103
104 $globalTpl = $GLOBALS['DIC'] ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
105 $globalTpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
106 $globalTpl->addJavascript("./Services/Form/js/ServiceFormIdentifiedWizardInputExtend.js");
107 }
108
109 return $tpl->get();
110 }
111}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:24