ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilOverlayGUI Class Reference

This is a utility class for the yui overlays. More...

+ Inheritance diagram for ilOverlayGUI:
+ Collaboration diagram for ilOverlayGUI:

Public Member Functions

 __construct ($a_overlay_el_id)
 Constructor. More...
 
 setAnchor ($a_anchor_el_id, $a_ov_corner="tl", $a_anch_corner="bl")
 Set anchor element. More...
 
 setSize ($a_width="", $a_height="")
 Set size. More...
 
 setFixedCenter ($a_fixed_center=true)
 Set fixed center. More...
 
 setVisible ($a_visible=true)
 Set visible. More...
 
 setTrigger ($a_el_id, $a_event="click", $a_trigger_anchor_el_id=null)
 Set trigger element. More...
 
 setAutoHide ($a_val)
 Set auto hiding. More...
 
 getAutoHide ()
 Get auto_hide. More...
 
 setCloseElementId ($a_val)
 Set close element id. More...
 
 getCloseElementId ()
 Get close element id. More...
 
 getOnLoadCode ()
 Makes an existing HTML element an overlay. More...
 
 add ()
 Makes an existing HTML element an overlay. More...
 
 getTriggerOnLoadCode ( $a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center=false, $a_ov_corner="tl", $a_anch_corner="bl")
 Get trigger onload code. More...
 
 addTrigger ( $a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center=false, $a_ov_corner="tl", $a_anch_corner="bl")
 Add trigger. More...
 

Static Public Member Functions

static initJavascript ()
 Init javascript. More...
 

Protected Attributes

 $tpl
 
 $width = ""
 
 $height = ""
 
 $fixed_center = false
 
 $visible = false
 
 $anchor_el_id = ""
 
 $anchor_ov_corner = ""
 
 $anchor_anch_corner = ""
 
 $auto_hide = false
 
 $close_el = null
 

Detailed Description

This is a utility class for the yui overlays.

this only works, if a parent has class="yui-skin-sam" attached.

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

Constructor & Destructor Documentation

◆ __construct()

ilOverlayGUI::__construct (   $a_overlay_el_id)

Constructor.

Parameters

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

References $DIC, and $GLOBALS.

32  {
33  global $DIC;
34 
35  // please check learning modules (e.g. rating) before removing this globals
36  // use (they do not use standard template)
37  $this->tpl = $GLOBALS["tpl"];
38  $this->overlay_el_id = $a_overlay_el_id;
39  }
global $DIC
Definition: saml.php:7
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

Member Function Documentation

◆ add()

ilOverlayGUI::add ( )

Makes an existing HTML element an overlay.

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

References $tpl, and getOnLoadCode().

Referenced by ilAssLacLegendGUI\initOverlay().

178  {
179  $tpl = $this->tpl;
180  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
181 
182  self::initJavascript();
183  $tpl->addOnLoadCode($this->getOnLoadCode());
184  }
getOnLoadCode()
Makes an existing HTML element an overlay.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTrigger()

ilOverlayGUI::addTrigger (   $a_tr_id,
  $a_tr_event,
  $a_anchor_el_id,
  $a_center = false,
  $a_ov_corner = "tl",
  $a_anch_corner = "bl" 
)

Add trigger.

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

References $tpl, and getTriggerOnLoadCode().

233  {
234  $tpl = $this->tpl;
235  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
236  //echo "-".$a_tr_id."-".$a_tr_event."-".$a_anchor_el_id."-";
237  self::initJavascript();
238  $tpl->addOnLoadCode($this->getTriggerOnLoadCode(
239  $a_tr_id,
240  $a_tr_event,
241  $a_anchor_el_id,
242  $a_center,
243  $a_ov_corner,
244  $a_anch_corner
245  ));
246  }
getTriggerOnLoadCode( $a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center=false, $a_ov_corner="tl", $a_anch_corner="bl")
Get trigger onload code.
+ Here is the call graph for this function:

◆ getAutoHide()

ilOverlayGUI::getAutoHide ( )

Get auto_hide.

Returns
boolean auto hide

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

References $auto_hide.

116  {
117  return $this->auto_hide;
118  }

◆ getCloseElementId()

ilOverlayGUI::getCloseElementId ( )

Get close element id.

Returns
string clos element id

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

References $close_el.

136  {
137  return $this->close_el;
138  }

◆ getOnLoadCode()

ilOverlayGUI::getOnLoadCode ( )

Makes an existing HTML element an overlay.

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

References $auto_hide, $cfg, $close_el, $height, $width, and ilJsonUtil\encode().

Referenced by add().

144  {
145  // yui cfg string
146  $yuicfg["visible"] = $this->visible ? true : false;
147 
148  if ($this->width != "") {
149  $yuicfg["width"] = $this->width;
150  }
151 
152  if ($this->height != "") {
153  $yuicfg["height"] = $this->height;
154  }
155  $yuicfg["fixedcenter"] = $this->fixed_center ? true : false;
156  if ($this->anchor_el_id != "") {
157  $yuicfg["context"] = array($this->anchor_el_id, $this->anchor_ov_corner,
158  $this->anchor_anch_corner, array("beforeShow", "windowResize"));
159  }
160  // general cfg string
161  $cfg["yuicfg"] = $yuicfg;
162  $cfg["trigger"] = $this->trigger_el_id;
163  $cfg["trigger_event"] = $this->trigger_event;
164  $cfg["anchor_id"] = $this->trigger_anchor_el_id;
165  $cfg["auto_hide"] = $this->auto_hide;
166  $cfg["close_el"] = $this->close_el;
167 
168  include_once("./Services/JSON/classes/class.ilJsonUtil.php");
169  //var_dump(ilJsonUtil::encode($cfg));
170  return 'il.Overlay.add("' . $this->overlay_el_id . '", ' .
171  ilJsonUtil::encode($cfg) . '); ';
172  }
static encode($mixed, $suppress_native=false)
catch(Exception $e) if(isset($_POST['cancel'])) if(isset($_POST['continue'])) $cfg
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTriggerOnLoadCode()

ilOverlayGUI::getTriggerOnLoadCode (   $a_tr_id,
  $a_tr_event,
  $a_anchor_el_id,
  $a_center = false,
  $a_ov_corner = "tl",
  $a_anch_corner = "bl" 
)

Get trigger onload code.

Parameters

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

Referenced by addTrigger().

217  {
218  $center = ($a_center) ? "true" : "false";
219  return 'il.Overlay.addTrigger("' . $a_tr_id . '","' . $a_tr_event . '","' . $this->overlay_el_id . '","' .
220  $a_anchor_el_id . '", ' . $center . ',"' . $a_ov_corner . '","' . $a_anch_corner . '"); ';
221  }
+ Here is the caller graph for this function:

◆ initJavascript()

static ilOverlayGUI::initJavascript ( )
static

Init javascript.

Parameters

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

References $DIC, $GLOBALS, $tpl, and ilYuiUtil\initOverlay().

Referenced by ilTestPlayerDynamicQuestionSetGUI\executeCommand(), ilSCORM2004ScoGUI\sco_preview(), ilPageObjectGUI\showPage(), ilSearchGUI\showSearch(), ilLuceneUserSearchGUI\showSearchForm(), and ilLuceneSearchGUI\showSearchForm().

193  {
194  global $DIC;
195 
196  $tpl = $GLOBALS["tpl"];
197 
198  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
200  $tpl->addJavascript("./Services/UIComponent/Overlay/js/ilOverlay.js");
201  }
global $DIC
Definition: saml.php:7
static initOverlay(ilTemplate $a_main_tpl=null)
Init YUI Overlay module.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAnchor()

ilOverlayGUI::setAnchor (   $a_anchor_el_id,
  $a_ov_corner = "tl",
  $a_anch_corner = "bl" 
)

Set anchor element.

Parameters
stringanchor element id
stringoverlay corner ("tl", "tr", "bl", "br") aligned to...
stringanchor corner ("tl", "tr", "bl", "br")

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

49  {
50  $this->anchor_el_id = $a_anchor_el_id;
51  $this->anchor_ov_corner = $a_ov_corner;
52  $this->anchor_anch_corner = $a_anch_corner;
53  }

◆ setAutoHide()

ilOverlayGUI::setAutoHide (   $a_val)

Set auto hiding.

Parameters
booleanauto hide

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

Referenced by ilAssLacLegendGUI\initOverlay().

106  {
107  $this->auto_hide = $a_val;
108  }
+ Here is the caller graph for this function:

◆ setCloseElementId()

ilOverlayGUI::setCloseElementId (   $a_val)

Set close element id.

Parameters
stringclose element id

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

126  {
127  $this->close_el = $a_val;
128  }

◆ setFixedCenter()

ilOverlayGUI::setFixedCenter (   $a_fixed_center = true)

Set fixed center.

Parameters
booleanfixed center

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

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

◆ setSize()

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

Set size.

Parameters
stringwidth, e.g. 300px
stringheight, e.g. 300px

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

62  {
63  $this->width = $a_width;
64  $this->height = $a_height;
65  }

◆ setTrigger()

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

Set trigger element.

Parameters
stringelement id
stringevent ("click" or "mouseover")

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

94  {
95  $this->trigger_el_id = $a_el_id;
96  $this->trigger_event = $a_event;
97  $this->trigger_anchor_el_id = $a_trigger_anchor_el_id;
98  }

◆ setVisible()

ilOverlayGUI::setVisible (   $a_visible = true)

Set visible.

Parameters
booleanvisible

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

Referenced by ilAssLacLegendGUI\initOverlay().

83  {
84  $this->visible = $a_visible;
85  }
+ Here is the caller graph for this function:

Field Documentation

◆ $anchor_anch_corner

ilOverlayGUI::$anchor_anch_corner = ""
protected

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

◆ $anchor_el_id

ilOverlayGUI::$anchor_el_id = ""
protected

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

◆ $anchor_ov_corner

ilOverlayGUI::$anchor_ov_corner = ""
protected

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

◆ $auto_hide

ilOverlayGUI::$auto_hide = false
protected

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

Referenced by getAutoHide(), and getOnLoadCode().

◆ $close_el

ilOverlayGUI::$close_el = null
protected

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

Referenced by getCloseElementId(), and getOnLoadCode().

◆ $fixed_center

ilOverlayGUI::$fixed_center = false
protected

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

◆ $height

ilOverlayGUI::$height = ""
protected

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

Referenced by getOnLoadCode().

◆ $tpl

ilOverlayGUI::$tpl
protected

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

Referenced by add(), addTrigger(), and initJavascript().

◆ $visible

ilOverlayGUI::$visible = false
protected

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

◆ $width

ilOverlayGUI::$width = ""
protected

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

Referenced by getOnLoadCode().


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