ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPanelGUI Class Reference

Simple panel class. More...

+ Collaboration diagram for ilPanelGUI:

Public Member Functions

 setHeading ($a_val)
 Set heading. More...
 
 getHeading ()
 Get heading. More...
 
 setBody ($a_val)
 Set body. More...
 
 getBody ()
 Get body. More...
 
 setFooter ($a_val)
 Set footer. More...
 
 getFooter ()
 Get body. More...
 
 setPanelStyle ($a_val)
 Set panel style. More...
 
 getPanelStyle ()
 Get panel style. More...
 
 setHeadingStyle ($a_val)
 Set heading style. More...
 
 getHeadingStyle ()
 Get heading style. More...
 
 setFooterStyle ($a_val)
 Set footer style. More...
 
 getFooterStyle ()
 Get footer style. More...
 
 getHTML ()
 Get HTML. More...
 

Static Public Member Functions

static getInstance ()
 Get instance. More...
 

Data Fields

const PANEL_STYLE_PRIMARY = 0
 
const PANEL_STYLE_SECONDARY = 1
 
const HEADING_STYLE_SUBHEADING = 0
 
const HEADING_STYLE_BLOCK = 1
 
const FOOTER_STYLE_BLOCK = 0
 

Protected Member Functions

 __construct ()
 Constructor. More...
 

Protected Attributes

 $heading = ""
 
 $body = ""
 
 $footer = ""
 
 $panel_style = 0
 
 $heading_style = 0
 
 $footer_style = 0
 

Detailed Description

Simple panel class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ /

Definition at line 12 of file class.ilPanelGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPanelGUI::__construct ( )
protected

Constructor.

Definition at line 32 of file class.ilPanelGUI.php.

33 {
34 }

Member Function Documentation

◆ getBody()

ilPanelGUI::getBody ( )

Get body.

Returns
string body

Definition at line 81 of file class.ilPanelGUI.php.

82 {
83 return $this->body;
84 }

References $body.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFooter()

ilPanelGUI::getFooter ( )

Get body.

Returns
string body

Definition at line 101 of file class.ilPanelGUI.php.

102 {
103 return $this->footer;
104 }

References $footer.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFooterStyle()

ilPanelGUI::getFooterStyle ( )

Get footer style.

Returns
int footer style

Definition at line 161 of file class.ilPanelGUI.php.

162 {
163 return $this->footer_style;
164 }

References $footer_style.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHeading()

ilPanelGUI::getHeading ( )

Get heading.

Returns
string heading

Definition at line 61 of file class.ilPanelGUI.php.

62 {
63 return $this->heading;
64 }

References $heading.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHeadingStyle()

ilPanelGUI::getHeadingStyle ( )

Get heading style.

Returns
int heading style

Definition at line 141 of file class.ilPanelGUI.php.

142 {
144 }

References $heading_style.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getHTML()

ilPanelGUI::getHTML ( )

Get HTML.

Returns
string html

Definition at line 171 of file class.ilPanelGUI.php.

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 }
$tpl
Definition: ilias.php:10
getPanelStyle()
Get panel style.
getHeadingStyle()
Get heading style.
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_SUBHEADING
getBody()
Get body.
const HEADING_STYLE_BLOCK
getFooterStyle()
Get footer style.
getFooter()
Get body.
const FOOTER_STYLE_BLOCK
getHeading()
Get heading.
special template class to simplify handling of ITX/PEAR

References $tpl, FOOTER_STYLE_BLOCK, getBody(), getFooter(), getFooterStyle(), getHeading(), getHeadingStyle(), getPanelStyle(), HEADING_STYLE_BLOCK, HEADING_STYLE_SUBHEADING, and PANEL_STYLE_SECONDARY.

+ Here is the call graph for this function:

◆ getInstance()

◆ getPanelStyle()

ilPanelGUI::getPanelStyle ( )

Get panel style.

Returns
int panel_style

Definition at line 121 of file class.ilPanelGUI.php.

122 {
123 return $this->panel_style;
124 }

References $panel_style.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ setBody()

ilPanelGUI::setBody (   $a_val)

Set body.

Parameters
string$a_valbody

Definition at line 71 of file class.ilPanelGUI.php.

72 {
73 $this->body = $a_val;
74 }

◆ setFooter()

ilPanelGUI::setFooter (   $a_val)

Set footer.

Parameters
string$a_valfooter

Definition at line 91 of file class.ilPanelGUI.php.

92 {
93 $this->footer = $a_val;
94 }

◆ setFooterStyle()

ilPanelGUI::setFooterStyle (   $a_val)

Set footer style.

Parameters
int$a_valfooter style

Definition at line 151 of file class.ilPanelGUI.php.

152 {
153 $this->footer_style = $a_val;
154 }

◆ setHeading()

ilPanelGUI::setHeading (   $a_val)

Set heading.

Parameters
string$a_valheading

Definition at line 51 of file class.ilPanelGUI.php.

52 {
53 $this->heading = $a_val;
54 }

◆ setHeadingStyle()

ilPanelGUI::setHeadingStyle (   $a_val)

Set heading style.

Parameters
int$a_valheading style

Definition at line 131 of file class.ilPanelGUI.php.

132 {
133 $this->heading_style = $a_val;
134 }

◆ setPanelStyle()

ilPanelGUI::setPanelStyle (   $a_val)

Set panel style.

Parameters
int$a_valpanel_style

Definition at line 111 of file class.ilPanelGUI.php.

112 {
113 $this->panel_style = $a_val;
114 }

Field Documentation

◆ $body

ilPanelGUI::$body = ""
protected

Definition at line 23 of file class.ilPanelGUI.php.

Referenced by getBody().

◆ $footer

ilPanelGUI::$footer = ""
protected

Definition at line 24 of file class.ilPanelGUI.php.

Referenced by getFooter().

◆ $footer_style

ilPanelGUI::$footer_style = 0
protected

Definition at line 27 of file class.ilPanelGUI.php.

Referenced by getFooterStyle().

◆ $heading

ilPanelGUI::$heading = ""
protected

Definition at line 22 of file class.ilPanelGUI.php.

Referenced by getHeading().

◆ $heading_style

ilPanelGUI::$heading_style = 0
protected

Definition at line 26 of file class.ilPanelGUI.php.

Referenced by getHeadingStyle().

◆ $panel_style

ilPanelGUI::$panel_style = 0
protected

Definition at line 25 of file class.ilPanelGUI.php.

Referenced by getPanelStyle().

◆ FOOTER_STYLE_BLOCK

const ilPanelGUI::FOOTER_STYLE_BLOCK = 0

Definition at line 20 of file class.ilPanelGUI.php.

Referenced by getHTML().

◆ HEADING_STYLE_BLOCK

const ilPanelGUI::HEADING_STYLE_BLOCK = 1

◆ HEADING_STYLE_SUBHEADING

const ilPanelGUI::HEADING_STYLE_SUBHEADING = 0

◆ PANEL_STYLE_PRIMARY

const ilPanelGUI::PANEL_STYLE_PRIMARY = 0

◆ PANEL_STYLE_SECONDARY


The documentation for this class was generated from the following file: