ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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.

Deprecated:
10

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

Constructor & Destructor Documentation

◆ __construct()

ilOverlayGUI::__construct ( string  $a_overlay_el_id)

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

References $DIC, and $GLOBALS.

43  {
44  global $DIC;
45 
46  // please check learning modules (e.g. rating) before removing this globals
47  // use (they do not use standard template)
48  $this->tpl = $GLOBALS["tpl"];
49  $this->overlay_el_id = $a_overlay_el_id;
50  }
global $DIC
Definition: feed.php:28
$GLOBALS["DIC"]
Definition: wac.php:31

Member Function Documentation

◆ add()

ilOverlayGUI::add ( )

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

References $DIC, $tpl, ilGlobalTemplateInterface\addJavaScript(), ilGlobalTemplateInterface\addOnLoadCode(), getOnLoadCode(), and ilYuiUtil\initOverlay().

145  : void
146  {
147  $tpl = $this->tpl;
148  self::initJavascript();
149  $tpl->addOnLoadCode($this->getOnLoadCode());
150  }
ilGlobalTemplateInterface $tpl
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
+ 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 176 of file class.ilOverlayGUI.php.

References $tpl, ilGlobalTemplateInterface\addOnLoadCode(), and getTriggerOnLoadCode().

183  : void {
184  $tpl = $this->tpl;
185 
186  self::initJavascript();
188  $a_tr_id,
189  $a_tr_event,
190  $a_anchor_el_id,
191  $a_center,
192  $a_ov_corner,
193  $a_anch_corner
194  ));
195  }
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")
ilGlobalTemplateInterface $tpl
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
+ Here is the call graph for this function:

◆ getAutoHide()

ilOverlayGUI::getAutoHide ( )

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

References $auto_hide.

100  : bool
101  {
102  return $this->auto_hide;
103  }

◆ getCloseElementId()

ilOverlayGUI::getCloseElementId ( )

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

References $close_el.

110  : string
111  {
112  return $this->close_el;
113  }

◆ getOnLoadCode()

ilOverlayGUI::getOnLoadCode ( )

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

References $auto_hide, $close_el, $fixed_center, $height, $trigger_anchor_el_id, $trigger_el_id, $trigger_event, $visible, and $width.

Referenced by add().

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

◆ 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 163 of file class.ilOverlayGUI.php.

Referenced by addTrigger().

170  : string {
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 . '"); ';
174  }
+ Here is the caller graph for this function:

◆ 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 57 of file class.ilOverlayGUI.php.

61  : void {
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;
65  }

◆ setAutoHide()

ilOverlayGUI::setAutoHide ( bool  $a_val)

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

95  : void
96  {
97  $this->auto_hide = $a_val;
98  }

◆ setCloseElementId()

ilOverlayGUI::setCloseElementId ( string  $a_val)

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

105  : void
106  {
107  $this->close_el = $a_val;
108  }

◆ setFixedCenter()

ilOverlayGUI::setFixedCenter ( bool  $a_fixed_center = true)

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

75  : void
76  {
77  $this->fixed_center = $a_fixed_center;
78  }

◆ setSize()

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

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

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

◆ setTrigger()

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

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

89  : void {
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;
93  }

◆ setVisible()

ilOverlayGUI::setVisible ( bool  $a_visible = true)

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

80  : void
81  {
82  $this->visible = $a_visible;
83  }

Field Documentation

◆ $anchor_anch_corner

string ilOverlayGUI::$anchor_anch_corner = ""
protected

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

◆ $anchor_el_id

string ilOverlayGUI::$anchor_el_id = ""
protected

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

◆ $anchor_ov_corner

string ilOverlayGUI::$anchor_ov_corner = ""
protected

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

◆ $auto_hide

bool ilOverlayGUI::$auto_hide = false
protected

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

Referenced by getAutoHide(), and getOnLoadCode().

◆ $close_el

string ilOverlayGUI::$close_el = null
protected

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

Referenced by getCloseElementId(), and getOnLoadCode().

◆ $fixed_center

bool ilOverlayGUI::$fixed_center = false
protected

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

Referenced by getOnLoadCode().

◆ $height

string ilOverlayGUI::$height = ""
protected

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

Referenced by getOnLoadCode().

◆ $overlay_el_id

string ilOverlayGUI::$overlay_el_id = ''
protected

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

◆ $tpl

ilGlobalTemplateInterface ilOverlayGUI::$tpl
protected

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

Referenced by add(), and addTrigger().

◆ $trigger_anchor_el_id

string ilOverlayGUI::$trigger_anchor_el_id = null
protected

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

Referenced by getOnLoadCode().

◆ $trigger_el_id

string ilOverlayGUI::$trigger_el_id = ''
protected

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

Referenced by getOnLoadCode().

◆ $trigger_event

string ilOverlayGUI::$trigger_event = ''
protected

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

Referenced by getOnLoadCode().

◆ $visible

bool ilOverlayGUI::$visible = false
protected

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

Referenced by getOnLoadCode().

◆ $width

string ilOverlayGUI::$width = ""
protected

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

Referenced by getOnLoadCode().


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