ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilFormSectionHeaderGUI.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
32{
33 protected $type;
34 protected $title;
35 protected $info;
36 protected $section_icon;
37 protected $section_anchor;
38
44 public function __construct()
45 {
46 $this->setType("section_header");
47 }
48
49 public function checkInput()
50 {
51 return true;
52 }
53
59 public function setType($a_type)
60 {
61 $this->type = $a_type;
62 }
63
69 public function getType()
70 {
71 return $this->type;
72 }
73
82 public function setSectionIcon($a_file, $a_alt)
83 {
84 $this->section_icon['file'] = $a_file;
85 $this->section_icon['alt'] = $a_alt;
86 }
87
94 public function getSectionIcon()
95 {
96 return $this->section_icon ? $this->section_icon : array();
97 }
98
104 public function setTitle($a_title)
105 {
106 $this->title = $a_title;
107 }
108
114 public function getTitle()
115 {
116 return $this->title;
117 }
118
124 public function setInfo($a_info)
125 {
126 $this->info = $a_info;
127 }
128
134 public function getInfo()
135 {
136 return $this->info;
137 }
138
144 public function setParentForm($a_parentform)
145 {
146 $this->parentform = $a_parentform;
147 }
148
154 public function getParentForm()
155 {
156 return $this->parentform;
157 }
158
164 public function setSectionAnchor($value)
165 {
166 $this->section_anchor = $value;
167 }
168
173 public function insert($a_tpl)
174 {
175 $section_icon = $this->getSectionIcon();
176
177 if (isset($section_icon['file']) && is_file($section_icon['file'])) {
178 $a_tpl->setCurrentBlock("title_icon");
179 $a_tpl->setVariable("IMG_ICON", $section_icon['file']);
180 $a_tpl->setVariable('IMG_ALT', $section_icon['alt']);
181 $a_tpl->parseCurrentBlock();
182 }
183
184 $a_tpl->setCurrentBlock("header");
185 $a_tpl->setVariable("TXT_TITLE", $this->getTitle());
186 $a_tpl->setVariable("TXT_DESCRIPTION", $this->getInfo());
187 $a_tpl->setVariable('HEAD_COLSPAN', 2);
188 if (isset($this->section_anchor)) {
189 $a_tpl->setVariable('LABEL', $this->section_anchor);
190 }
191 $a_tpl->parseCurrentBlock();
192 }
193
199 public function setValueByArray($a_values)
200 {
201 // nothing to do since is a header
202 }
203
204 public function getPostVar()
205 {
206 // nothing to do since is a header
207 }
208}
An exception for terminatinating execution or to throw for unit testing.
This class represents a section header in a property form.
setParentForm($a_parentform)
Set Parent Form.
insert($a_tpl)
Insert property html.
setSectionAnchor($value)
set section label;
setSectionIcon($a_file, $a_alt)
Set section icon.
setInfo($a_info)
Set Information Text.
setValueByArray($a_values)
Set value by array.
info()
Definition: info.php:2
$a_type
Definition: workflow.php:92