ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLightboxGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
14 protected $id = "";
15
22 function __construct($a_id)
23 {
24 $this->setId($a_id);
25 }
26
32 function setId($a_val)
33 {
34 $this->id = $a_val;
35 }
36
42 function getId()
43 {
44 return $this->id;
45 }
46
52 function setWidth($a_val)
53 {
54 $this->width = $a_val;
55 }
56
62 function getWidth()
63 {
64 return $this->width;
65 }
66
70 static function getLocalLightboxJsPath()
71 {
72 return "./Services/UIComponent/Lightbox/js/Lightbox.js";
73 }
74
78 public function addLightbox($a_tpl = null)
79 {
80 global $tpl;
81
82 if ($a_tpl == null)
83 {
84 $a_tpl = $tpl;
85 }
86
87 $a_tpl->addJavaScript(self::getLocalLightboxJsPath());
88 $a_tpl->addLightbox($this->getHTML(), $this->getId());
89 }
90
97 function getHTML()
98 {
99 $tpl = new ilTemplate("tpl.lightbox.html", true, true, "Services/UIComponent/Lightbox");
100 $tpl->setVariable("LIGHTBOX_CONTENT", "");
101 $tpl->setVariable("ID", $this->getId());
102 if ($this->getWidth() != "")
103 {
104 $tpl->setVariable("WIDTH", "width: ".$this->getWidth().";");
105 }
106 return $tpl->get();
107 }
108
109}
110
111?>
global $tpl
Definition: ilias.php:8
Lighbox handling.
getWidth()
Get width.
setId($a_val)
Set Id.
addLightbox($a_tpl=null)
Init lightbox.
__construct($a_id)
Constructor.
static getLocalLightboxJsPath()
Get local path of jQuery file.
setWidth($a_val)
Set width.
special template class to simplify handling of ITX/PEAR