ILIAS  release_8 Revision v8.24
ilOverlayGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilOverlayGUI:

Public Member Functions

 __construct (string $a_overlay_el_id)
 
 setAnchor (string $a_anchor_el_id, string $a_ov_corner="tl", string $a_anch_corner="bl")
 
 setSize (string $a_width="", string $a_height="")
 
 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)
 
 setAutoHide (bool $a_val)
 
 getAutoHide ()
 
 setCloseElementId (string $a_val)
 
 getCloseElementId ()
 
 getOnLoadCode ()
 
 add ()
 
 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")
 
 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")
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
string $width = ""
 
string $height = ""
 
bool $fixed_center = false
 
bool $visible = false
 
string $anchor_el_id = ""
 
string $anchor_ov_corner = ""
 
string $anchor_anch_corner = ""
 
bool $auto_hide = false
 
string $close_el = null
 
string $trigger_el_id = ''
 
string $trigger_event = ''
 
string $trigger_anchor_el_id = null
 
string $overlay_el_id = ''
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning This is a utility class for the yui overlays. this only works, if a parent has class="yui-skin-sam" attached.

Definition at line 23 of file class.ilOverlayGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilOverlayGUI::__construct ( string  $a_overlay_el_id)

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

41 {
42 global $DIC;
43
44 // please check learning modules (e.g. rating) before removing this globals
45 // use (they do not use standard template)
46 $this->tpl = $GLOBALS["tpl"];
47 $this->overlay_el_id = $a_overlay_el_id;
48 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
global $DIC
Definition: feed.php:28

References $DIC, and $GLOBALS.

Member Function Documentation

◆ add()

ilOverlayGUI::add ( )

Definition at line 143 of file class.ilOverlayGUI.php.

143 : void
144 {
146 self::initJavascript();
148 }
ilGlobalTemplateInterface $tpl
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.

References $tpl, and ILIAS\UI\Implementation\Component\getOnLoadCode().

+ Here is the call graph for this function:

◆ addTrigger()

ilOverlayGUI::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" 
)

Definition at line 174 of file class.ilOverlayGUI.php.

181 : void {
183
184 self::initJavascript();
186 $a_tr_id,
187 $a_tr_event,
188 $a_anchor_el_id,
189 $a_center,
190 $a_ov_corner,
191 $a_anch_corner
192 ));
193 }
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")

◆ getAutoHide()

ilOverlayGUI::getAutoHide ( )

Definition at line 98 of file class.ilOverlayGUI.php.

98 : bool
99 {
100 return $this->auto_hide;
101 }

◆ getCloseElementId()

ilOverlayGUI::getCloseElementId ( )

Definition at line 108 of file class.ilOverlayGUI.php.

108 : string
109 {
110 return $this->close_el;
111 }

◆ getOnLoadCode()

ilOverlayGUI::getOnLoadCode ( )

Definition at line 113 of file class.ilOverlayGUI.php.

113 : string
114 {
115 // yui cfg string
116 $yuicfg["visible"] = $this->visible;
117
118 if ($this->width !== "") {
119 $yuicfg["width"] = $this->width;
120 }
121
122 if ($this->height !== "") {
123 $yuicfg["height"] = $this->height;
124 }
125 $yuicfg["fixedcenter"] = $this->fixed_center;
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"));
129 }
130 // general cfg string
131 $cfg["yuicfg"] = $yuicfg;
132 $cfg["trigger"] = $this->trigger_el_id;
133 $cfg["trigger_event"] = $this->trigger_event;
134 $cfg["anchor_id"] = $this->trigger_anchor_el_id;
135 $cfg["auto_hide"] = $this->auto_hide;
136 $cfg["close_el"] = $this->close_el;
137
138 //var_dump(json_encode($cfg, JSON_THROW_ON_ERROR));
139 return 'il.Overlay.add("' . $this->overlay_el_id . '", ' .
140 json_encode($cfg, JSON_THROW_ON_ERROR) . '); ';
141 }
string $trigger_anchor_el_id

◆ getTriggerOnLoadCode()

ilOverlayGUI::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" 
)

Definition at line 161 of file class.ilOverlayGUI.php.

168 : string {
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 . '"); ';
172 }

◆ setAnchor()

ilOverlayGUI::setAnchor ( string  $a_anchor_el_id,
string  $a_ov_corner = "tl",
string  $a_anch_corner = "bl" 
)
Parameters
string$a_anchor_el_idanchor element id
string$a_ov_corneroverlay corner ("tl", "tr", "bl", "br") aligned to...
string$a_anch_corneranchor corner ("tl", "tr", "bl", "br")

Definition at line 55 of file class.ilOverlayGUI.php.

59 : void {
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;
63 }

◆ setAutoHide()

ilOverlayGUI::setAutoHide ( bool  $a_val)

Definition at line 93 of file class.ilOverlayGUI.php.

93 : void
94 {
95 $this->auto_hide = $a_val;
96 }

◆ setCloseElementId()

ilOverlayGUI::setCloseElementId ( string  $a_val)

Definition at line 103 of file class.ilOverlayGUI.php.

103 : void
104 {
105 $this->close_el = $a_val;
106 }

◆ setFixedCenter()

ilOverlayGUI::setFixedCenter ( bool  $a_fixed_center = true)

Definition at line 73 of file class.ilOverlayGUI.php.

73 : void
74 {
75 $this->fixed_center = $a_fixed_center;
76 }

◆ setSize()

ilOverlayGUI::setSize ( string  $a_width = "",
string  $a_height = "" 
)

Definition at line 65 of file class.ilOverlayGUI.php.

68 : void {
69 $this->width = $a_width;
70 $this->height = $a_height;
71 }

◆ setTrigger()

ilOverlayGUI::setTrigger ( string  $a_el_id,
string  $a_event = "click",
?string  $a_trigger_anchor_el_id = null 
)

Definition at line 83 of file class.ilOverlayGUI.php.

87 : void {
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;
91 }

◆ setVisible()

ilOverlayGUI::setVisible ( bool  $a_visible = true)

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

78 : void
79 {
80 $this->visible = $a_visible;
81 }

Field Documentation

◆ $anchor_anch_corner

string ilOverlayGUI::$anchor_anch_corner = ""
protected

Definition at line 32 of file class.ilOverlayGUI.php.

◆ $anchor_el_id

string ilOverlayGUI::$anchor_el_id = ""
protected

Definition at line 30 of file class.ilOverlayGUI.php.

◆ $anchor_ov_corner

string ilOverlayGUI::$anchor_ov_corner = ""
protected

Definition at line 31 of file class.ilOverlayGUI.php.

◆ $auto_hide

bool ilOverlayGUI::$auto_hide = false
protected

Definition at line 33 of file class.ilOverlayGUI.php.

◆ $close_el

string ilOverlayGUI::$close_el = null
protected

Definition at line 34 of file class.ilOverlayGUI.php.

◆ $fixed_center

bool ilOverlayGUI::$fixed_center = false
protected

Definition at line 28 of file class.ilOverlayGUI.php.

◆ $height

string ilOverlayGUI::$height = ""
protected

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

◆ $overlay_el_id

string ilOverlayGUI::$overlay_el_id = ''
protected

Definition at line 38 of file class.ilOverlayGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilOverlayGUI::$tpl
protected

Definition at line 25 of file class.ilOverlayGUI.php.

◆ $trigger_anchor_el_id

string ilOverlayGUI::$trigger_anchor_el_id = null
protected

Definition at line 37 of file class.ilOverlayGUI.php.

◆ $trigger_el_id

string ilOverlayGUI::$trigger_el_id = ''
protected

Definition at line 35 of file class.ilOverlayGUI.php.

◆ $trigger_event

string ilOverlayGUI::$trigger_event = ''
protected

Definition at line 36 of file class.ilOverlayGUI.php.

◆ $visible

bool ilOverlayGUI::$visible = false
protected

Definition at line 29 of file class.ilOverlayGUI.php.

◆ $width

string ilOverlayGUI::$width = ""
protected

Definition at line 26 of file class.ilOverlayGUI.php.


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