ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLightboxGUI 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 ilLightboxGUI:

Public Member Functions

 __construct (string $a_id)
 
 setId (string $a_val)
 
 getId ()
 
 setWidth (string $a_val)
 
 getWidth ()
 
 addLightbox (\ilGlobalTemplateInterface $a_tpl=null)
 
 getHTML ()
 

Static Public Member Functions

static getLocalLightboxJsPath ()
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
string $id = ""
 
string $width
 

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 Lightbox handling

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

Definition at line 23 of file class.ilLightboxGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLightboxGUI::__construct ( string  $a_id)

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

References $DIC, and setId().

30  {
31  global $DIC;
32 
33  $this->tpl = $DIC->ui()->mainTemplate();
34  $this->setId($a_id);
35  }
global $DIC
Definition: feed.php:28
setId(string $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ addLightbox()

ilLightboxGUI::addLightbox ( \ilGlobalTemplateInterface  $a_tpl = null)

Definition at line 62 of file class.ilLightboxGUI.php.

References $tpl, ilGlobalTemplateInterface\addJavaScript(), getHTML(), and getId().

62  : void
63  {
64  $tpl = $this->tpl;
65 
66  if ($a_tpl === null) {
67  $a_tpl = $tpl;
68  }
69 
70  $a_tpl->addJavaScript(self::getLocalLightboxJsPath());
71  $a_tpl->addLightbox($this->getHTML(), $this->getId());
72  }
ilGlobalTemplateInterface $tpl
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 call graph for this function:

◆ getHTML()

ilLightboxGUI::getHTML ( )

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

References ilGlobalTemplateInterface\get(), getId(), getWidth(), and ilGlobalTemplateInterface\setVariable().

Referenced by addLightbox().

74  : string
75  {
76  $tpl = new ilTemplate("tpl.lightbox.html", true, true, "Services/UIComponent/Lightbox");
77  $tpl->setVariable("LIGHTBOX_CONTENT", "");
78  $tpl->setVariable("ID", $this->getId());
79  if ($this->getWidth() !== "") {
80  $tpl->setVariable("WIDTH", "width: " . $this->getWidth() . ";");
81  }
82  return $tpl->get();
83  }
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilLightboxGUI::getId ( )

Definition at line 42 of file class.ilLightboxGUI.php.

References $id.

Referenced by addLightbox(), and getHTML().

42  : string
43  {
44  return $this->id;
45  }
+ Here is the caller graph for this function:

◆ getLocalLightboxJsPath()

static ilLightboxGUI::getLocalLightboxJsPath ( )
static

Definition at line 57 of file class.ilLightboxGUI.php.

57  : string
58  {
59  return "./Services/UIComponent/Lightbox/js/Lightbox.js";
60  }

◆ getWidth()

ilLightboxGUI::getWidth ( )

Definition at line 52 of file class.ilLightboxGUI.php.

References $width.

Referenced by getHTML().

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

◆ setId()

ilLightboxGUI::setId ( string  $a_val)

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

Referenced by __construct().

37  : void
38  {
39  $this->id = $a_val;
40  }
+ Here is the caller graph for this function:

◆ setWidth()

ilLightboxGUI::setWidth ( string  $a_val)

Definition at line 47 of file class.ilLightboxGUI.php.

47  : void
48  {
49  $this->width = $a_val;
50  }

Field Documentation

◆ $id

string ilLightboxGUI::$id = ""
protected

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

Referenced by getId().

◆ $tpl

ilGlobalTemplateInterface ilLightboxGUI::$tpl
protected

Definition at line 25 of file class.ilLightboxGUI.php.

Referenced by addLightbox().

◆ $width

string ilLightboxGUI::$width
protected

Definition at line 27 of file class.ilLightboxGUI.php.

Referenced by getWidth().


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