ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilCustomInputGUI.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2007 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24require_once('./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php');
35{
36 protected $html;
37
44 function __construct($a_title = "", $a_postvar = "")
45 {
46 parent::__construct($a_title, $a_postvar);
47 $this->setType("custom");
48 }
49
55 function setHtml($a_html)
56 {
57 $this->html = $a_html;
58 }
59
65 function getHtml()
66 {
67 return $this->html;
68 }
69
75 function setValueByArray($a_values)
76 {
77 foreach($this->getSubItems() as $item)
78 {
79 $item->setValueByArray($a_values);
80 }
81 }
82
87 function insert(&$a_tpl)
88 {
89 $a_tpl->setCurrentBlock("prop_custom");
90 $a_tpl->setVariable("CUSTOM_CONTENT", $this->getHtml());
91 $a_tpl->parseCurrentBlock();
92 }
93
99 function checkInput()
100 {
101 global $lng;
102
103 if($this->getPostVar())
104 {
106 if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "")
107 {
108 $this->setAlert($lng->txt("msg_input_is_required"));
109 return false;
110 }
111 }
112 return $this->checkSubItemsInput();
113 }
114}
This class represents a custom property in a property form.
checkInput()
Check input, strip slashes etc.
insert(&$a_tpl)
Insert property html.
__construct($a_title="", $a_postvar="")
Constructor.
setHtml($a_html)
Set Html.
setValueByArray($a_values)
Set value by array.
setType($a_type)
Set Type.
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
This class represents a property that may include a sub form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40