ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilHiddenInputGUI.php
Go to the documentation of this file.
1<?php
2
3/*
4 +-----------------------------------------------------------------------------+
5 | ILIAS open source |
6 +-----------------------------------------------------------------------------+
7 | Copyright (c) 1998-2007 ILIAS open source, University of Cologne |
8 | |
9 | This program is free software; you can redistribute it and/or |
10 | modify it under the terms of the GNU General Public License |
11 | as published by the Free Software Foundation; either version 2 |
12 | of the License, or (at your option) any later version. |
13 | |
14 | This program is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | GNU General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU General Public License |
20 | along with this program; if not, write to the Free Software |
21 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
22 +-----------------------------------------------------------------------------+
23*/
24
33 protected $value;
34
41 function __construct($a_postvar)
42 {
43 parent::__construct("", $a_postvar);
44 $this->setType("hidden");
45 }
46
52 function setValue($a_value)
53 {
54 $this->value = $a_value;
55 }
56
62 function getValue()
63 {
64 return $this->value;
65 }
66
67
73 function checkInput()
74 {
75 return true; // please overwrite
76 }
77
83 function setValueByArray($a_values)
84 {
85 $this->setValue($a_values[$this->getPostVar()]);
86 }
87
93 function insert(&$a_tpl)
94 {
95 $a_tpl->setCurrentBlock("hidden");
96 $a_tpl->setVariable('PROP_INPUT_TYPE','hidden');
97 $a_tpl->setVariable("POST_VAR", $this->getPostVar());
98 $a_tpl->setVariable("ID", $this->getFieldId());
99 $a_tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
100 $a_tpl->parseCurrentBlock();
101 }
102
106 function getToolbarHTML()
107 {
108 return "<input type=\"hidden\"".
109 " name=\"".$this->getPostVar()."\"".
110 " value=\"".ilUtil::prepareFormOutput($this->getValue())."\"".
111 " id=\"".$this->getFieldId()."\" />";
112 }
113}
114?>
This class represents a property in a property form.
setType($a_type)
Set Type.
getPostVar()
Get Post Variable.
getFieldId()
Get Post Variable.
This class represents a hidden form property in a property form.
checkInput()
Check input, strip slashes etc.
setValue($a_value)
Set Value.
insert(&$a_tpl)
Insert property html.
__construct($a_postvar)
Constructor.
setValueByArray($a_values)
Set value by array.
getToolbarHTML()
Get HTML for toolbar.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
Interface for property form input GUI classes that can be used in ilToolbarGUI.