ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
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
22
26 protected function __construct()
27 {
28
29 }
30
36 static function getInstance()
37 {
38 return new ilModalGUI();
39 }
40
46 function setId($a_val)
47 {
48 $this->id = $a_val;
49 }
50
56 function getId()
57 {
58 return $this->id;
59 }
60
66 function setHeading($a_val)
67 {
68 $this->heading = $a_val;
69 }
70
76 function getHeading()
77 {
78 return $this->heading;
79 }
80
86 function setBody($a_val)
87 {
88 $this->body = $a_val;
89 }
90
96 function getBody()
97 {
98 return $this->body;
99 }
100
106 function setType($a_val)
107 {
108 $this->type = $a_val;
109 }
110
116 function getType()
117 {
118 return $this->type;
119 }
120
126 function getHTML()
127 {
128 $tpl = new ilTemplate("tpl.modal.html", true, true, "Services/UIComponent/Modal");
129
130 $tpl->setVariable("HEADING", $this->getHeading());
131
132 $tpl->setVariable("MOD_ID", $this->getId());
133 $tpl->setVariable("BODY", $this->getBody());
134
135 switch ($this->getType())
136 {
137 case self::TYPE_LARGE:
138 $tpl->setVariable("CLASS", "modal-lg");
139 break;
140
141 case self::TYPE_SMALL:
142 $tpl->setVariable("CLASS", "modal-sm");
143 break;
144 }
145
146 return $tpl->get();
147 }
148
152 static function initJS()
153 {
154 global $tpl;
155
156 $tpl->addJavascript("./Services/UIComponent/Modal/js/Modal.js");
157 }
158
159
160}
161
162?>
global $tpl
Definition: ilias.php:8
Modal class.
setBody($a_val)
Set body.
__construct()
Constructor.
setType($a_val)
Set type.
getHTML()
Get HTML.
getBody()
Get body.
setId($a_val)
Set id.
static initJS()
Init javascript.
getHeading()
Get heading.
getId()
Get id.
getType()
Get type.
setHeading($a_val)
Set heading.
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR