ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilPanelGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
16
19
21
22 protected $heading = "";
23 protected $body = "";
24 protected $footer = "";
25 protected $panel_style = 0;
26 protected $heading_style = 0;
27 protected $footer_style = 0;
28
32 protected function __construct()
33 {
34
35 }
36
42 static function getInstance()
43 {
44 return new ilPanelGUI();
45 }
46
52 function setHeading($a_val)
53 {
54 $this->heading = $a_val;
55 }
56
62 function getHeading()
63 {
64 return $this->heading;
65 }
66
72 function setBody($a_val)
73 {
74 $this->body = $a_val;
75 }
76
82 function getBody()
83 {
84 return $this->body;
85 }
86
92 function setFooter($a_val)
93 {
94 $this->footer = $a_val;
95 }
96
102 function getFooter()
103 {
104 return $this->footer;
105 }
106
112 function setPanelStyle($a_val)
113 {
114 $this->panel_style = $a_val;
115 }
116
122 function getPanelStyle()
123 {
124 return $this->panel_style;
125 }
126
132 function setHeadingStyle($a_val)
133 {
134 $this->heading_style = $a_val;
135 }
136
143 {
145 }
146
152 function setFooterStyle($a_val)
153 {
154 $this->footer_style = $a_val;
155 }
156
162 function getFooterStyle()
163 {
164 return $this->footer_style;
165 }
166
172 function getHTML()
173 {
174 $tpl = new ilTemplate("tpl.panel.html", true, true, "Services/UIComponent/Panel");
175
176 $head_outer_div_style = "";
177 if ($this->getHeading() != "")
178 {
179 $tpl->setCurrentBlock("heading");
180 $tpl->setVariable("HEADING", $this->getHeading());
181
182 switch ($this->getHeadingStyle())
183 {
185 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilBlockHeader");
186 $tpl->setVariable("HEAD_H3_STYLE", "ilBlockHeader");
187 $head_outer_div_style = "il_Block";
188 break;
189
191 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilHeader");
192 $tpl->setVariable("HEAD_H3_STYLE", "ilHeader");
193 break;
194 }
195
196 $tpl->parseCurrentBlock();
197 }
198
199 $tpl->setVariable("BODY", $this->getBody());
200
201 if ($this->getFooter() != "")
202 {
203 $tpl->setCurrentBlock("footer");
204 $tpl->setVariable("FOOTER", $this->getFooter());
205
206 switch ($this->getFooterStyle())
207 {
209 $tpl->setVariable("FOOT_DIV_STYLE", "panel-footer ilBlockInfo");
210 break;
211 }
212
213 $tpl->parseCurrentBlock();
214 }
215
216 switch ($this->getPanelStyle())
217 {
219 $tpl->setVariable("PANEL_STYLE", "panel panel-default ".$head_outer_div_style);
220 break;
221
222 default:
223 $tpl->setVariable("PANEL_STYLE", "panel panel-primary ".$head_outer_div_style);
224 break;
225 }
226
227 return $tpl->get();
228 }
229
230
231}
232
233?>
global $tpl
Definition: ilias.php:8
Simple panel class.
getPanelStyle()
Get panel style.
getHeadingStyle()
Get heading style.
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_SUBHEADING
getHTML()
Get HTML.
setHeading($a_val)
Set heading.
setBody($a_val)
Set body.
setFooterStyle($a_val)
Set footer style.
getBody()
Get body.
const HEADING_STYLE_BLOCK
__construct()
Constructor.
getFooterStyle()
Get footer style.
setPanelStyle($a_val)
Set panel style.
static getInstance()
Get instance.
getFooter()
Get body.
setHeadingStyle($a_val)
Set heading style.
setFooter($a_val)
Set footer.
const FOOTER_STYLE_BLOCK
const PANEL_STYLE_PRIMARY
getHeading()
Get heading.
special template class to simplify handling of ITX/PEAR