ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilModalGUI.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
12
class
ilModalGUI
13
{
14
protected
$heading
=
""
;
15
protected
$body
=
""
;
16
protected
$id
=
""
;
17
const
TYPE_LARGE
=
"large"
;
18
const
TYPE_MEDIUM
=
"medium"
;
19
const
TYPE_SMALL
=
"small"
;
20
21
protected
$type
= self::TYPE_MEDIUM;
22
protected
$buttons
=
array
();
23
27
protected
function
__construct
()
28
{
29
30
}
31
37
static
function
getInstance
()
38
{
39
return
new
ilModalGUI
();
40
}
41
47
function
setId
($a_val)
48
{
49
$this->
id
= $a_val;
50
}
51
57
function
getId
()
58
{
59
return
$this->id
;
60
}
61
67
function
setHeading
($a_val)
68
{
69
$this->heading = $a_val;
70
}
71
77
function
getHeading
()
78
{
79
return
$this->heading
;
80
}
81
87
function
setBody
($a_val)
88
{
89
$this->body = $a_val;
90
}
91
97
function
getBody
()
98
{
99
return
$this->body
;
100
}
101
107
function
setType
($a_val)
108
{
109
$this->type = $a_val;
110
}
111
117
function
getType
()
118
{
119
return
$this->type
;
120
}
121
127
function
addButton
(
ilButtonBase
$but)
128
{
129
$this->buttons[] = $but;
130
}
131
137
function
getButtons
()
138
{
139
return
$this->buttons
;
140
}
141
142
148
function
getHTML
()
149
{
150
$tpl
=
new
ilTemplate
(
"tpl.modal.html"
,
true
,
true
,
"Services/UIComponent/Modal"
);
151
152
if
(count($this->
getButtons
()) > 0)
153
{
154
foreach
($this->
getButtons
() as $b)
155
{
156
$tpl
->setCurrentBlock(
"button"
);
157
$tpl
->setVariable(
"BUTTON"
, $b->render());
158
$tpl
->parseCurrentBlock();
159
}
160
$tpl
->setCurrentBlock(
"footer"
);
161
$tpl
->parseCurrentBlock();
162
}
163
164
$tpl
->setVariable(
"HEADING"
, $this->
getHeading
());
165
166
$tpl
->setVariable(
"MOD_ID"
, $this->
getId
());
167
$tpl
->setVariable(
"BODY"
, $this->
getBody
());
168
169
switch
($this->
getType
())
170
{
171
case
self::TYPE_LARGE:
172
$tpl
->setVariable(
"CLASS"
,
"modal-lg"
);
173
break
;
174
175
case
self::TYPE_SMALL:
176
$tpl
->setVariable(
"CLASS"
,
"modal-sm"
);
177
break
;
178
}
179
180
return
$tpl
->get();
181
}
182
186
static
function
initJS
()
187
{
188
global
$tpl
;
189
190
$tpl->addJavascript(
"./Services/UIComponent/Modal/js/Modal.js"
);
191
}
192
193
194
}
195
196
?>
ilModalGUI\getType
getType()
Get type.
Definition:
class.ilModalGUI.php:117
ilModalGUI\getHeading
getHeading()
Get heading.
Definition:
class.ilModalGUI.php:77
ilModalGUI\setBody
setBody($a_val)
Set body.
Definition:
class.ilModalGUI.php:87
ilModalGUI\$body
$body
Definition:
class.ilModalGUI.php:15
ilModalGUI\getBody
getBody()
Get body.
Definition:
class.ilModalGUI.php:97
ilModalGUI\TYPE_SMALL
const TYPE_SMALL
Definition:
class.ilModalGUI.php:19
ilModalGUI\getHTML
getHTML()
Get HTML.
Definition:
class.ilModalGUI.php:148
ilModalGUI\getButtons
getButtons()
Get buttons.
Definition:
class.ilModalGUI.php:137
ilModalGUI\$type
$type
Definition:
class.ilModalGUI.php:21
$tpl
global $tpl
Definition:
ilias.php:8
ilModalGUI\initJS
static initJS()
Init javascript.
Definition:
class.ilModalGUI.php:186
ilModalGUI\setType
setType($a_val)
Set type.
Definition:
class.ilModalGUI.php:107
ilModalGUI\__construct
__construct()
Constructor.
Definition:
class.ilModalGUI.php:27
ilModalGUI\$buttons
$buttons
Definition:
class.ilModalGUI.php:22
ilModalGUI\setId
setId($a_val)
Set id.
Definition:
class.ilModalGUI.php:47
ilModalGUI\addButton
addButton(ilButtonBase $but)
Add button.
Definition:
class.ilModalGUI.php:127
ilModalGUI\TYPE_LARGE
const TYPE_LARGE
Definition:
class.ilModalGUI.php:17
ilTemplate
special template class to simplify handling of ITX/PEAR
Definition:
class.ilTemplate.php:13
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilModalGUI\TYPE_MEDIUM
const TYPE_MEDIUM
Definition:
class.ilModalGUI.php:18
ilModalGUI\getInstance
static getInstance()
Get instance.
Definition:
class.ilModalGUI.php:37
ilModalGUI\$heading
$heading
Definition:
class.ilModalGUI.php:14
ilModalGUI\setHeading
setHeading($a_val)
Set heading.
Definition:
class.ilModalGUI.php:67
ilModalGUI\getId
getId()
Get id.
Definition:
class.ilModalGUI.php:57
ilButtonBase
Definition:
class.ilButtonBase.php:13
php
ilModalGUI
Modal class.
Definition:
class.ilModalGUI.php:12
ilModalGUI\$id
$id
Definition:
class.ilModalGUI.php:16
Services
UIComponent
Modal
classes
class.ilModalGUI.php
Generated on Fri Jan 17 2025 19:01:18 for ILIAS by
1.8.13 (using
Doxyfile
)