ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
35 }

Member Function Documentation

◆ getBody()

ilPanelGUI::getBody ( )

Get body.

Returns
string body

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

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

References $body.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getFooter()

ilPanelGUI::getFooter ( )

Get body.

Returns
string body

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

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

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 162 of file class.ilPanelGUI.php.

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

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 62 of file class.ilPanelGUI.php.

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

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 142 of file class.ilPanelGUI.php.

143 {
145 }

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 172 of file class.ilPanelGUI.php.

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 }
global $tpl
Definition: ilias.php:8
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 122 of file class.ilPanelGUI.php.

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

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 72 of file class.ilPanelGUI.php.

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

◆ setFooter()

ilPanelGUI::setFooter (   $a_val)

Set footer.

Parameters
string$a_valfooter

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

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

◆ setFooterStyle()

ilPanelGUI::setFooterStyle (   $a_val)

Set footer style.

Parameters
int$a_valfooter style

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

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

◆ setHeading()

ilPanelGUI::setHeading (   $a_val)

Set heading.

Parameters
string$a_valheading

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

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

◆ setHeadingStyle()

ilPanelGUI::setHeadingStyle (   $a_val)

Set heading style.

Parameters
int$a_valheading style

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

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

◆ setPanelStyle()

ilPanelGUI::setPanelStyle (   $a_val)

Set panel style.

Parameters
int$a_valpanel_style

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

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

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: