ILIAS  release_8 Revision v8.24
class.ilPanelGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 public const PANEL_STYLE_PRIMARY = 0;
27 public const PANEL_STYLE_SECONDARY = 1;
28 public const HEADING_STYLE_SUBHEADING = 0;
29 public const HEADING_STYLE_BLOCK = 1;
30 public const FOOTER_STYLE_BLOCK = 0;
31
32 protected string $heading = "";
33 protected string $body = "";
34 protected string $footer = "";
35 protected int $panel_style = 0;
36 protected int $heading_style = 0;
37 protected int $footer_style = 0;
38
39 protected function __construct()
40 {
41 }
42
43 public static function getInstance(): self
44 {
45 return new ilPanelGUI();
46 }
47
48 public function setHeading(string $a_val): void
49 {
50 $this->heading = $a_val;
51 }
52
53 public function getHeading(): string
54 {
55 return $this->heading;
56 }
57
58 public function setBody(string $a_val): void
59 {
60 $this->body = $a_val;
61 }
62
63 public function getBody(): string
64 {
65 return $this->body;
66 }
67
68 public function setFooter(string $a_val): void
69 {
70 $this->footer = $a_val;
71 }
72
73 public function getFooter(): string
74 {
75 return $this->footer;
76 }
77
78 public function setPanelStyle(int $a_val): void
79 {
80 $this->panel_style = $a_val;
81 }
82
83 public function getPanelStyle(): int
84 {
85 return $this->panel_style;
86 }
87
88 public function setHeadingStyle(int $a_val): void
89 {
90 $this->heading_style = $a_val;
91 }
92
93 public function getHeadingStyle(): int
94 {
96 }
97
98 public function setFooterStyle(int $a_val): void
99 {
100 $this->footer_style = $a_val;
101 }
102
103 public function getFooterStyle(): int
104 {
105 return $this->footer_style;
106 }
107
108 public function getHTML(): string
109 {
110 $tpl = new ilTemplate("tpl.panel.html", true, true, "Services/UIComponent/Panel");
111
112 $head_outer_div_style = "";
113 if ($this->getHeading() !== "") {
114 $tpl->setCurrentBlock("heading");
115 $tpl->setVariable("HEADING", $this->getHeading());
116
117 switch ($this->getHeadingStyle()) {
119 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilBlockHeader");
120 $tpl->setVariable("HEAD_H3_STYLE", "ilBlockHeader");
121 $head_outer_div_style = "il_Block";
122 break;
123
125 $tpl->setVariable("HEAD_DIV_STYLE", "panel-heading ilHeader");
126 $tpl->setVariable("HEAD_H3_STYLE", "ilHeader");
127 break;
128 }
129
130 $tpl->parseCurrentBlock();
131 }
132
133 $tpl->setVariable("BODY", $this->getBody());
134
135 if ($this->getFooter() !== "") {
136 $tpl->setCurrentBlock("footer");
137 $tpl->setVariable("FOOTER", $this->getFooter());
138
139 switch ($this->getFooterStyle()) {
141 $tpl->setVariable("FOOT_DIV_STYLE", "panel-footer ilBlockInfo");
142 break;
143 }
144
145 $tpl->parseCurrentBlock();
146 }
147
148 switch ($this->getPanelStyle()) {
150 $tpl->setVariable("PANEL_STYLE", "panel panel-default " . $head_outer_div_style);
151 break;
152
153 default:
154 $tpl->setVariable("PANEL_STYLE", "panel panel-primary " . $head_outer_div_style);
155 break;
156 }
157
158 return $tpl->get();
159 }
160}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFooter(string $a_val)
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_SUBHEADING
setFooterStyle(int $a_val)
setBody(string $a_val)
setPanelStyle(int $a_val)
setHeading(string $a_val)
const HEADING_STYLE_BLOCK
static getInstance()
const FOOTER_STYLE_BLOCK
setHeadingStyle(int $a_val)
const PANEL_STYLE_PRIMARY
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41