ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLightboxGUI Class Reference

Lighbox handling. More...

+ Collaboration diagram for ilLightboxGUI:

Public Member Functions

 __construct ($a_id)
 Constructor. More...
 
 setId ($a_val)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setWidth ($a_val)
 Set width. More...
 
 getWidth ()
 Get width. More...
 
 addLightbox ($a_tpl=null)
 Init lightbox. More...
 
 getHTML ()
 Get HTML. More...
 

Static Public Member Functions

static getLocalLightboxJsPath ()
 Get local path of jQuery file. More...
 

Protected Attributes

 $tpl
 
 $id = ""
 

Detailed Description

Lighbox handling.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilLightboxGUI::__construct (   $a_id)

Constructor.

Parameters

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

References $DIC, and setId().

28  {
29  global $DIC;
30 
31  $this->tpl = $DIC["tpl"];
32  $this->setId($a_id);
33  }
global $DIC
Definition: saml.php:7
setId($a_val)
Set Id.
+ Here is the call graph for this function:

Member Function Documentation

◆ addLightbox()

ilLightboxGUI::addLightbox (   $a_tpl = null)

Init lightbox.

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

References $tpl, getHTML(), and getId().

87  {
88  $tpl = $this->tpl;
89 
90  if ($a_tpl == null) {
91  $a_tpl = $tpl;
92  }
93 
94  $a_tpl->addJavaScript(self::getLocalLightboxJsPath());
95  $a_tpl->addLightbox($this->getHTML(), $this->getId());
96  }
+ Here is the call graph for this function:

◆ getHTML()

ilLightboxGUI::getHTML ( )

Get HTML.

Parameters

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

References $tpl, getId(), and getWidth().

Referenced by addLightbox().

105  {
106  $tpl = new ilTemplate("tpl.lightbox.html", true, true, "Services/UIComponent/Lightbox");
107  $tpl->setVariable("LIGHTBOX_CONTENT", "");
108  $tpl->setVariable("ID", $this->getId());
109  if ($this->getWidth() != "") {
110  $tpl->setVariable("WIDTH", "width: " . $this->getWidth() . ";");
111  }
112  return $tpl->get();
113  }
getWidth()
Get width.
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilLightboxGUI::getId ( )

Get Id.

Returns
string id

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

References $id.

Referenced by addLightbox(), and getHTML().

51  {
52  return $this->id;
53  }
+ Here is the caller graph for this function:

◆ getLocalLightboxJsPath()

static ilLightboxGUI::getLocalLightboxJsPath ( )
static

Get local path of jQuery file.

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

79  {
80  return "./Services/UIComponent/Lightbox/js/Lightbox.js";
81  }

◆ getWidth()

ilLightboxGUI::getWidth ( )

Get width.

Returns
string width

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

Referenced by getHTML().

71  {
72  return $this->width;
73  }
+ Here is the caller graph for this function:

◆ setId()

ilLightboxGUI::setId (   $a_val)

Set Id.

Parameters
string$a_valid

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

Referenced by __construct().

41  {
42  $this->id = $a_val;
43  }
+ Here is the caller graph for this function:

◆ setWidth()

ilLightboxGUI::setWidth (   $a_val)

Set width.

Parameters
string$a_valwidth

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

61  {
62  $this->width = $a_val;
63  }

Field Documentation

◆ $id

ilLightboxGUI::$id = ""
protected

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

Referenced by getId().

◆ $tpl

ilLightboxGUI::$tpl
protected

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

Referenced by addLightbox(), and getHTML().


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