ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
41 public static function getInstance()
42 {
43 return new ilPanelGUI();
44 }
45
51 public function setHeading($a_val)
52 {
53 $this->heading = $a_val;
54 }
55
61 public function getHeading()
62 {
63 return $this->heading;
64 }
65
71 public function setBody($a_val)
72 {
73 $this->body = $a_val;
74 }
75
81 public function getBody()
82 {
83 return $this->body;
84 }
85
91 public function setFooter($a_val)
92 {
93 $this->footer = $a_val;
94 }
95
101 public function getFooter()
102 {
103 return $this->footer;
104 }
105
111 public function setPanelStyle($a_val)
112 {
113 $this->panel_style = $a_val;
114 }
115
121 public function getPanelStyle()
122 {
123 return $this->panel_style;
124 }
125
131 public function setHeadingStyle($a_val)
132 {
133 $this->heading_style = $a_val;
134 }
135
141 public function getHeadingStyle()
142 {
144 }
145
151 public function setFooterStyle($a_val)
152 {
153 $this->footer_style = $a_val;
154 }
155
161 public function getFooterStyle()
162 {
163 return $this->footer_style;
164 }
165
171 public function getHTML()
172 {
173 $tpl = new ilTemplate("tpl.panel.html", true, true, "Services/UIComponent/Panel");
174
175 $head_outer_div_style = "";
176 if ($this->getHeading() != "") {
177 $tpl->setCurrentBlock("heading");
178 $tpl->setVariable("HEADING", $this->getHeading());
179
180 switch ($this->getHeadingStyle()) {
182 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilBlockHeader");
183 $tpl->setVariable("HEAD_H3_STYLE", "ilBlockHeader");
184 $head_outer_div_style = "il_Block";
185 break;
186
188 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilHeader");
189 $tpl->setVariable("HEAD_H3_STYLE", "ilHeader");
190 break;
191 }
192
193 $tpl->parseCurrentBlock();
194 }
195
196 $tpl->setVariable("BODY", $this->getBody());
197
198 if ($this->getFooter() != "") {
199 $tpl->setCurrentBlock("footer");
200 $tpl->setVariable("FOOTER", $this->getFooter());
201
202 switch ($this->getFooterStyle()) {
204 $tpl->setVariable("FOOT_DIV_STYLE", "panel-footer ilBlockInfo");
205 break;
206 }
207
208 $tpl->parseCurrentBlock();
209 }
210
211 switch ($this->getPanelStyle()) {
213 $tpl->setVariable("PANEL_STYLE", "panel panel-default " . $head_outer_div_style);
214 break;
215
216 default:
217 $tpl->setVariable("PANEL_STYLE", "panel panel-primary " . $head_outer_div_style);
218 break;
219 }
220
221 return $tpl->get();
222 }
223}
$tpl
Definition: ilias.php:10
An exception for terminatinating execution or to throw for unit testing.
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