ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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{
17 protected $tpl;
18
19 protected $id = "";
20
27 public function __construct($a_id)
28 {
29 global $DIC;
30
31 $this->tpl = $DIC->ui()->mainTemplate();
32 $this->setId($a_id);
33 }
34
40 public function setId($a_val)
41 {
42 $this->id = $a_val;
43 }
44
50 public function getId()
51 {
52 return $this->id;
53 }
54
60 public function setWidth($a_val)
61 {
62 $this->width = $a_val;
63 }
64
70 public function getWidth()
71 {
72 return $this->width;
73 }
74
78 public static function getLocalLightboxJsPath()
79 {
80 return "./Services/UIComponent/Lightbox/js/Lightbox.js";
81 }
82
86 public function addLightbox(\ilGlobalTemplate $a_tpl = null)
87 {
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 }
97
104 public function getHTML()
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 }
114}
An exception for terminatinating execution or to throw for unit testing.
special template class to simplify handling of ITX/PEAR
Lighbox handling.
addLightbox(\ilGlobalTemplate $a_tpl=null)
Init lightbox.
getWidth()
Get width.
setId($a_val)
Set Id.
__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
$DIC
Definition: xapitoken.php:46