ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  function __construct()
45  {
46  $this->setType("section_header");
47  }
48 
49  function checkInput()
50  {
51  return true;
52  }
53 
59  function setType($a_type)
60  {
61  $this->type = $a_type;
62  }
63 
69  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  function setTitle($a_title)
105  {
106  $this->title = $a_title;
107  }
108 
114  function getTitle()
115  {
116  return $this->title;
117  }
118 
124  function setInfo($a_info)
125  {
126  $this->info = $a_info;
127  }
128 
134  function getInfo()
135  {
136  return $this->info;
137  }
138 
144  function setParentForm($a_parentform)
145  {
146  $this->parentform = $a_parentform;
147  }
148 
154  function getParentForm()
155  {
156  return $this->parentform;
157  }
158 
164  function setSectionAnchor($value) {
165  $this->section_anchor = $value;
166  }
167 
172  function insert(&$a_tpl)
173  {
174  $section_icon = $this->getSectionIcon();
175 
176  if(isset($section_icon['file']) && is_file($section_icon['file']))
177  {
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('HEAD_COLSPAN',2);
187  if (isset($this->section_anchor))
188  $a_tpl->setVariable('LABEL', $this->section_anchor);
189  $a_tpl->parseCurrentBlock();
190  }
191 
197  function setValueByArray($a_values)
198  {
199  // nothing to do since is a header
200  }
201 
202 }