ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

References $body.

Referenced by getHTML().

82  {
83  return $this->body;
84  }
+ 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.

References $footer.

Referenced by getHTML().

102  {
103  return $this->footer;
104  }
+ 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.

References $footer_style.

Referenced by getHTML().

162  {
163  return $this->footer_style;
164  }
+ 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.

References $heading.

Referenced by getHTML().

62  {
63  return $this->heading;
64  }
+ 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.

References $heading_style.

Referenced by getHTML().

142  {
143  return $this->heading_style;
144  }
+ 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.

References $tpl, getBody(), getFooter(), getFooterStyle(), getHeading(), getHeadingStyle(), and getPanelStyle().

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()) {
181  case self::HEADING_STYLE_BLOCK:
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 
187  case self::HEADING_STYLE_SUBHEADING:
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()) {
203  case self::FOOTER_STYLE_BLOCK:
204  $tpl->setVariable("FOOT_DIV_STYLE", "panel-footer ilBlockInfo");
205  break;
206  }
207 
208  $tpl->parseCurrentBlock();
209  }
210 
211  switch ($this->getPanelStyle()) {
212  case self::PANEL_STYLE_SECONDARY:
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
getHeadingStyle()
Get heading style.
special template class to simplify handling of ITX/PEAR
getFooter()
Get body.
getFooterStyle()
Get footer style.
getBody()
Get body.
getPanelStyle()
Get panel style.
getHeading()
Get heading.
+ 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.

References $panel_style.

Referenced by getHTML().

122  {
123  return $this->panel_style;
124  }
+ 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.

◆ HEADING_STYLE_BLOCK

◆ 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: