ILIAS  release_7 Revision v7.30-3-g800a261c036
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{
34 protected $value;
35
42 public function __construct($a_postvar)
43 {
44 parent::__construct("", $a_postvar);
45 $this->setType("hidden");
46 }
47
53 public function setValue($a_value)
54 {
55 $this->value = $a_value;
56 }
57
63 public function getValue()
64 {
65 return $this->value;
66 }
67
68
74 public function checkInput()
75 {
76 return true; // please overwrite
77 }
78
84 public function setValueByArray($a_values)
85 {
86 $this->setValue($a_values[$this->getPostVar()]);
87 }
88
94 public function insert($a_tpl)
95 {
96 $a_tpl->setCurrentBlock("hidden");
97 $a_tpl->setVariable('PROP_INPUT_TYPE', 'hidden');
98 $a_tpl->setVariable("POST_VAR", $this->getPostVar());
99 $a_tpl->setVariable("ID", $this->getFieldId());
100 $a_tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
101 $a_tpl->parseCurrentBlock();
102 }
103
107 public function getToolbarHTML()
108 {
109 return "<input type=\"hidden\"" .
110 " name=\"" . $this->getPostVar() . "\"" .
111 " value=\"" . ilUtil::prepareFormOutput($this->getValue()) . "\"" .
112 " id=\"" . $this->getFieldId() . "\" />";
113 }
114}
An exception for terminatinating execution or to throw for unit testing.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc