49 $this->overlay_el_id = $a_overlay_el_id;
58 string $a_anchor_el_id,
59 string $a_ov_corner =
"tl",
60 string $a_anch_corner =
"bl" 62 $this->anchor_el_id = $a_anchor_el_id;
63 $this->anchor_ov_corner = $a_ov_corner;
64 $this->anchor_anch_corner = $a_anch_corner;
71 $this->width = $a_width;
72 $this->height = $a_height;
77 $this->fixed_center = $a_fixed_center;
82 $this->visible = $a_visible;
87 string $a_event =
"click",
88 ?
string $a_trigger_anchor_el_id = null
90 $this->trigger_el_id = $a_el_id;
91 $this->trigger_event = $a_event;
92 $this->trigger_anchor_el_id = $a_trigger_anchor_el_id;
97 $this->auto_hide = $a_val;
107 $this->close_el = $a_val;
120 if ($this->width !==
"") {
124 if ($this->height !==
"") {
128 if ($this->anchor_el_id !==
"") {
129 $yuicfg[
"context"] = array($this->anchor_el_id, $this->anchor_ov_corner,
130 $this->anchor_anch_corner, array(
"beforeShow",
"windowResize"));
133 $cfg[
"yuicfg"] = $yuicfg;
141 return 'il.Overlay.add("' . $this->overlay_el_id .
'", ' .
142 json_encode($cfg, JSON_THROW_ON_ERROR) .
'); ';
145 public function add(): void
148 self::initJavascript();
152 public static function initJavascript():
void 157 $tpl = $DIC->ui()->mainTemplate();
160 $tpl->
addJavaScript(
"./Services/UIComponent/Overlay/js/ilOverlay.js");
166 string $a_anchor_el_id,
167 bool $a_center =
false,
168 string $a_ov_corner =
"tl",
169 string $a_anch_corner =
"bl" 171 $center = ($a_center) ?
"true" :
"false";
172 return 'il.Overlay.addTrigger("' . $a_tr_id .
'","' . $a_tr_event .
'","' . $this->overlay_el_id .
'","' .
173 $a_anchor_el_id .
'", ' . $center .
',"' . $a_ov_corner .
'","' . $a_anch_corner .
'"); ';
179 string $a_anchor_el_id,
180 bool $a_center =
false,
181 string $a_ov_corner =
"tl",
182 string $a_anch_corner =
"bl" 186 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...
__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.