ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

 $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 26 of file class.ilOverlayGUI.php.

27  {
28  $this->overlay_el_id = $a_overlay_el_id;
29  }

Member Function Documentation

◆ add()

ilOverlayGUI::add ( )

Makes an existing HTML element an overlay.

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

References $tpl, and getOnLoadCode().

Referenced by ilAssLacLegendGUI\initOverlay().

171  {
172  global $tpl;
173  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
174 
175  self::initJavascript();
176  $tpl->addOnLoadCode($this->getOnLoadCode());
177  }
global $tpl
Definition: ilias.php:8
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 212 of file class.ilOverlayGUI.php.

References $tpl, and getTriggerOnLoadCode().

214  {
215  global $tpl;
216  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
217 //echo "-".$a_tr_id."-".$a_tr_event."-".$a_anchor_el_id."-";
218  self::initJavascript();
219  $tpl->addOnLoadCode($this->getTriggerOnLoadCode($a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center,
220  $a_ov_corner, $a_anch_corner));
221  }
global $tpl
Definition: ilias.php:8
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 105 of file class.ilOverlayGUI.php.

References $auto_hide.

106  {
107  return $this->auto_hide;
108  }

◆ getCloseElementId()

ilOverlayGUI::getCloseElementId ( )

Get close element id.

Returns
string clos element id

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

References $close_el.

126  {
127  return $this->close_el;
128  }

◆ getOnLoadCode()

ilOverlayGUI::getOnLoadCode ( )

Makes an existing HTML element an overlay.

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

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

Referenced by add().

134  {
135  // yui cfg string
136  $yuicfg["visible"] = $this->visible ? true : false;
137 
138  if ($this->width != "")
139  {
140  $yuicfg["width"] = $this->width;
141  }
142 
143  if ($this->height != "")
144  {
145  $yuicfg["height"] = $this->height;
146  }
147  $yuicfg["fixedcenter"] = $this->fixed_center ? true : false;
148  if ($this->anchor_el_id != "")
149  {
150  $yuicfg["context"] = array($this->anchor_el_id, $this->anchor_ov_corner,
151  $this->anchor_anch_corner, array("beforeShow", "windowResize"));
152  }
153  // general cfg string
154  $cfg["yuicfg"] = $yuicfg;
155  $cfg["trigger"] = $this->trigger_el_id;
156  $cfg["trigger_event"] = $this->trigger_event;
157  $cfg["anchor_id"] = $this->trigger_anchor_el_id;
158  $cfg["auto_hide"] = $this->auto_hide;
159  $cfg["close_el"] = $this->close_el;
160 
161  include_once("./Services/JSON/classes/class.ilJsonUtil.php");
162 //var_dump(ilJsonUtil::encode($cfg));
163  return 'il.Overlay.add("'.$this->overlay_el_id.'", '.
164  ilJsonUtil::encode($cfg).'); ';
165  }
static encode($mixed, $suppress_native=false)
Create styles array
The data for the language used.
+ 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 201 of file class.ilOverlayGUI.php.

Referenced by addTrigger().

203  {
204  $center = ($a_center) ? "true" : "false";
205  return 'il.Overlay.addTrigger("'.$a_tr_id.'","'.$a_tr_event.'","'.$this->overlay_el_id.'","'.
206  $a_anchor_el_id.'", '.$center.',"'.$a_ov_corner.'","'.$a_anch_corner.'"); ';
207  }
+ Here is the caller graph for this function:

◆ initJavascript()

static ilOverlayGUI::initJavascript ( )
static

Init javascript.

Parameters

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

References $tpl, and ilYuiUtil\initOverlay().

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

186  {
187  global $tpl;
188 
189  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
191  $tpl->addJavascript("./Services/UIComponent/Overlay/js/ilOverlay.js");
192  }
global $tpl
Definition: ilias.php:8
static initOverlay()
Init YUI Overlay module.
+ 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 38 of file class.ilOverlayGUI.php.

39  {
40  $this->anchor_el_id = $a_anchor_el_id;
41  $this->anchor_ov_corner = $a_ov_corner;
42  $this->anchor_anch_corner = $a_anch_corner;
43  }

◆ setAutoHide()

ilOverlayGUI::setAutoHide (   $a_val)

Set auto hiding.

Parameters
booleanauto hide

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

Referenced by ilAssLacLegendGUI\initOverlay().

96  {
97  $this->auto_hide = $a_val;
98  }
+ Here is the caller graph for this function:

◆ setCloseElementId()

ilOverlayGUI::setCloseElementId (   $a_val)

Set close element id.

Parameters
stringclose element id

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

116  {
117  $this->close_el = $a_val;
118  }

◆ setFixedCenter()

ilOverlayGUI::setFixedCenter (   $a_fixed_center = true)

Set fixed center.

Parameters
booleanfixed center

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

63  {
64  $this->fixed_center = $a_fixed_center;
65  }

◆ setSize()

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

Set size.

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

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

52  {
53  $this->width = $a_width;
54  $this->height = $a_height;
55  }

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

84  {
85  $this->trigger_el_id = $a_el_id;
86  $this->trigger_event = $a_event;
87  $this->trigger_anchor_el_id = $a_trigger_anchor_el_id;
88  }

◆ setVisible()

ilOverlayGUI::setVisible (   $a_visible = true)

Set visible.

Parameters
booleanvisible

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

Referenced by ilAssLacLegendGUI\initOverlay().

73  {
74  $this->visible = $a_visible;
75  }
+ Here is the caller graph for this function:

Field Documentation

◆ $anchor_anch_corner

ilOverlayGUI::$anchor_anch_corner = ""
protected

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

◆ $anchor_el_id

ilOverlayGUI::$anchor_el_id = ""
protected

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

◆ $anchor_ov_corner

ilOverlayGUI::$anchor_ov_corner = ""
protected

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

◆ $auto_hide

ilOverlayGUI::$auto_hide = false
protected

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

Referenced by getAutoHide(), and getOnLoadCode().

◆ $close_el

ilOverlayGUI::$close_el = null
protected

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

Referenced by getCloseElementId(), and getOnLoadCode().

◆ $fixed_center

ilOverlayGUI::$fixed_center = false
protected

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

◆ $height

ilOverlayGUI::$height = ""
protected

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

Referenced by getOnLoadCode().

◆ $visible

ilOverlayGUI::$visible = false
protected

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

◆ $width

ilOverlayGUI::$width = ""
protected

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

Referenced by getOnLoadCode().


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