ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
21  protected $type = self::TYPE_MEDIUM;
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 
149 
150 }
151 
152 ?>