47 $this->overlay_el_id = $a_overlay_el_id;
56 string $a_anchor_el_id,
57 string $a_ov_corner =
"tl",
58 string $a_anch_corner =
"bl" 60 $this->anchor_el_id = $a_anchor_el_id;
61 $this->anchor_ov_corner = $a_ov_corner;
62 $this->anchor_anch_corner = $a_anch_corner;
69 $this->width = $a_width;
70 $this->height = $a_height;
75 $this->fixed_center = $a_fixed_center;
80 $this->visible = $a_visible;
85 string $a_event =
"click",
86 ?
string $a_trigger_anchor_el_id = null
88 $this->trigger_el_id = $a_el_id;
89 $this->trigger_event = $a_event;
90 $this->trigger_anchor_el_id = $a_trigger_anchor_el_id;
95 $this->auto_hide = $a_val;
105 $this->close_el = $a_val;
118 if ($this->width !==
"") {
122 if ($this->height !==
"") {
126 if ($this->anchor_el_id !==
"") {
127 $yuicfg[
"context"] = array($this->anchor_el_id, $this->anchor_ov_corner,
128 $this->anchor_anch_corner, array(
"beforeShow",
"windowResize"));
131 $cfg[
"yuicfg"] = $yuicfg;
139 return 'il.Overlay.add("' . $this->overlay_el_id .
'", ' .
140 json_encode($cfg, JSON_THROW_ON_ERROR) .
'); ';
143 public function add(): void
146 self::initJavascript();
150 public static function initJavascript():
void 155 $tpl = $DIC->ui()->mainTemplate();
158 $tpl->
addJavaScript(
"./Services/UIComponent/Overlay/js/ilOverlay.js");
164 string $a_anchor_el_id,
165 bool $a_center =
false,
166 string $a_ov_corner =
"tl",
167 string $a_anch_corner =
"bl" 169 $center = ($a_center) ?
"true" :
"false";
170 return 'il.Overlay.addTrigger("' . $a_tr_id .
'","' . $a_tr_event .
'","' . $this->overlay_el_id .
'","' .
171 $a_anchor_el_id .
'", ' . $center .
',"' . $a_ov_corner .
'","' . $a_anch_corner .
'"); ';
177 string $a_anchor_el_id,
178 bool $a_center =
false,
179 string $a_ov_corner =
"tl",
180 string $a_anch_corner =
"bl" 184 self::initJavascript();
getTriggerOnLoadCode(string $a_tr_id, string $a_tr_event, string $a_anchor_el_id, bool $a_center=false, string $a_ov_corner="tl", string $a_anch_corner="bl")
setFixedCenter(bool $a_fixed_center=true)
setVisible(bool $a_visible=true)
setTrigger(string $a_el_id, string $a_event="click", ?string $a_trigger_anchor_el_id=null)
ilGlobalTemplateInterface $tpl
setAnchor(string $a_anchor_el_id, string $a_ov_corner="tl", string $a_anch_corner="bl")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
__construct(string $a_overlay_el_id)
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.
string $anchor_anch_corner
setCloseElementId(string $a_val)
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
setSize(string $a_width="", string $a_height="")
addTrigger(string $a_tr_id, string $a_tr_event, string $a_anchor_el_id, bool $a_center=false, string $a_ov_corner="tl", string $a_anch_corner="bl")
string $trigger_anchor_el_id
static initOverlay(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Overlay module used in Modules/Test, Services/TermsOfService, Services/Tracking, Services/UIComponent.