ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilModalGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilModalGUI:

Public Member Functions

 setId (string $a_val)
 
 getId ()
 
 setHeading (string $a_val)
 
 getHeading ()
 
 setBody (string $a_val)
 
 getBody ()
 
 setType (string $a_val)
 Set type. More...
 
 getType ()
 
 addButton (ilButtonBase $but)
 
 getButtons ()
 Get buttons. More...
 
 getHTML ()
 

Static Public Member Functions

static getInstance ()
 
static initJS (ilGlobalTemplateInterface $a_main_tpl=null)
 

Data Fields

const TYPE_LARGE = "large"
 
const TYPE_MEDIUM = "medium"
 
const TYPE_SMALL = "small"
 

Protected Member Functions

 __construct ()
 

Protected Attributes

string $heading = ""
 
string $body = ""
 
string $id = ""
 
string $type = self::TYPE_MEDIUM
 
array $buttons = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Modal class

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
10

Definition at line 26 of file class.ilModalGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilModalGUI::__construct ( )
protected

Definition at line 39 of file class.ilModalGUI.php.

40  {
41  }

Member Function Documentation

◆ addButton()

ilModalGUI::addButton ( ilButtonBase  $but)

Definition at line 94 of file class.ilModalGUI.php.

94  : void
95  {
96  $this->buttons[] = $but;
97  }

◆ getBody()

ilModalGUI::getBody ( )

Definition at line 74 of file class.ilModalGUI.php.

References $body.

Referenced by getHTML().

74  : string
75  {
76  return $this->body;
77  }
+ Here is the caller graph for this function:

◆ getButtons()

ilModalGUI::getButtons ( )

Get buttons.

Returns
ilButtonBase[]

Definition at line 103 of file class.ilModalGUI.php.

References $buttons.

Referenced by getHTML().

103  : array
104  {
105  return $this->buttons;
106  }
+ Here is the caller graph for this function:

◆ getHeading()

ilModalGUI::getHeading ( )

Definition at line 64 of file class.ilModalGUI.php.

References $heading.

Referenced by getHTML().

64  : string
65  {
66  return $this->heading;
67  }
+ Here is the caller graph for this function:

◆ getHTML()

ilModalGUI::getHTML ( )

Definition at line 108 of file class.ilModalGUI.php.

References Vendor\Package\$b, getBody(), getButtons(), getHeading(), getId(), and getType().

108  : string
109  {
110  $tpl = new ilTemplate("tpl.modal.html", true, true, "Services/UIComponent/Modal");
111 
112  if (count($this->getButtons()) > 0) {
113  foreach ($this->getButtons() as $b) {
114  $tpl->setCurrentBlock("button");
115  $tpl->setVariable("BUTTON", $b->render());
116  $tpl->parseCurrentBlock();
117  }
118  $tpl->setCurrentBlock("footer");
119  $tpl->parseCurrentBlock();
120  }
121 
122  $tpl->setVariable("HEADING", $this->getHeading());
123 
124  $tpl->setVariable("MOD_ID", $this->getId());
125  $tpl->setVariable("BODY", $this->getBody());
126 
127  switch ($this->getType()) {
128  case self::TYPE_LARGE:
129  $tpl->setVariable("CLASS", "modal-lg");
130  break;
131 
132  case self::TYPE_SMALL:
133  $tpl->setVariable("CLASS", "modal-sm");
134  break;
135  }
136 
137  return $tpl->get();
138  }
getButtons()
Get buttons.
+ Here is the call graph for this function:

◆ getId()

ilModalGUI::getId ( )

Definition at line 53 of file class.ilModalGUI.php.

References $id.

Referenced by getHTML().

53  : string
54  {
55  return $this->id;
56  }
+ Here is the caller graph for this function:

◆ getInstance()

◆ getType()

ilModalGUI::getType ( )

Definition at line 89 of file class.ilModalGUI.php.

References $type.

Referenced by getHTML().

89  : string
90  {
91  return $this->type;
92  }
+ Here is the caller graph for this function:

◆ initJS()

static ilModalGUI::initJS ( ilGlobalTemplateInterface  $a_main_tpl = null)
static

Definition at line 140 of file class.ilModalGUI.php.

References $DIC.

Referenced by ilObjForumGUI\doHistoryCheck(), ilPageObjectGUI\initEditing(), ILIAS\Notes\InternalGUIService\initJavascript(), and ilChatroomViewGUI\showRoom().

140  : void
141  {
142  global $DIC;
143 
144  $tpl = $a_main_tpl ?? $DIC["tpl"];
145 
146  $tpl->addJavaScript("./Services/UIComponent/Modal/js/Modal.js");
147  }
global $DIC
Definition: feed.php:28
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
+ Here is the caller graph for this function:

◆ setBody()

ilModalGUI::setBody ( string  $a_val)

Definition at line 69 of file class.ilModalGUI.php.

69  : void
70  {
71  $this->body = $a_val;
72  }

◆ setHeading()

ilModalGUI::setHeading ( string  $a_val)

Definition at line 58 of file class.ilModalGUI.php.

58  : void
59  {
60  $this->heading = $a_val;
61  }

◆ setId()

ilModalGUI::setId ( string  $a_val)

Definition at line 48 of file class.ilModalGUI.php.

48  : void
49  {
50  $this->id = $a_val;
51  }

◆ setType()

ilModalGUI::setType ( string  $a_val)

Set type.

Parameters
string$a_valtype const ilModalGUI::TYPE_SMALL|ilModalGUI::TYPE_MEDIUM|ilModalGUI::TYPE_LARGE

Definition at line 84 of file class.ilModalGUI.php.

84  : void
85  {
86  $this->type = $a_val;
87  }

Field Documentation

◆ $body

string ilModalGUI::$body = ""
protected

Definition at line 29 of file class.ilModalGUI.php.

Referenced by getBody().

◆ $buttons

array ilModalGUI::$buttons = array()
protected

Definition at line 37 of file class.ilModalGUI.php.

Referenced by getButtons().

◆ $heading

string ilModalGUI::$heading = ""
protected

Definition at line 28 of file class.ilModalGUI.php.

Referenced by getHeading().

◆ $id

string ilModalGUI::$id = ""
protected

Definition at line 30 of file class.ilModalGUI.php.

Referenced by getId().

◆ $type

string ilModalGUI::$type = self::TYPE_MEDIUM
protected

Definition at line 36 of file class.ilModalGUI.php.

Referenced by getType().

◆ TYPE_LARGE

◆ TYPE_MEDIUM

const ilModalGUI::TYPE_MEDIUM = "medium"

Definition at line 33 of file class.ilModalGUI.php.

◆ TYPE_SMALL

const ilModalGUI::TYPE_SMALL = "small"

Definition at line 34 of file class.ilModalGUI.php.


The documentation for this class was generated from the following file: