ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilOverlayGUI Class Reference

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

+ Collaboration diagram for ilOverlayGUI:

Public Member Functions

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

Protected Attributes

 $width = ""
 $height = ""
 $fixed_center = false
 $visible = false
 $anchor_el_id = ""
 $anchor_ov_corner = ""
 $anchor_anch_corner = ""
 $auto_hide = true
 $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

ilOverlayGUI::__construct (   $a_overlay_el_id)

Constructor.

Parameters
@return

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

{
$this->overlay_el_id = $a_overlay_el_id;
}

Member Function Documentation

ilOverlayGUI::add ( )

Makes an existing HTML element an overlay.

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

References $tpl, getOnLoadCode(), and ilYuiUtil\initOverlay().

{
global $tpl;
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
$tpl->addJavascript("./Services/UIComponent/Overlay/js/ilOverlay.js");
$tpl->addOnLoadCode($this->getOnLoadCode());
}

+ Here is the call graph for this function:

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

References $tpl, getTriggerOnLoadCode(), and ilYuiUtil\initOverlay().

{
global $tpl;
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
//echo "-".$a_tr_id."-".$a_tr_event."-".$a_anchor_el_id."-";
$tpl->addJavascript("./Services/UIComponent/Overlay/js/ilOverlay.js");
$tpl->addOnLoadCode($this->getTriggerOnLoadCode($a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center,
$a_ov_corner, $a_anch_corner));
}

+ Here is the call graph for this function:

ilOverlayGUI::getAutoHide ( )

Get auto_hide.

Returns
boolean auto hide

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

References $auto_hide.

{
}
ilOverlayGUI::getCloseElementId ( )

Get close element id.

Returns
string clos element id

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

References $close_el.

{
}
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, and ilJsonUtil\encode().

Referenced by add().

{
// yui cfg string
$yuicfg["visible"] = $this->visible ? true : false;
if ($this->width != "")
{
$yuicfg["width"] = $this->width;
}
if ($this->height != "")
{
$yuicfg["height"] = $this->height;
}
$yuicfg["fixedcenter"] = $this->fixed_center ? true : false;
if ($this->anchor_el_id != "")
{
$yuicfg["context"] = array($this->anchor_el_id, $this->anchor_ov_corner,
$this->anchor_anch_corner, array("beforeShow", "windowResize"));
}
// general cfg string
$cfg["yuicfg"] = $yuicfg;
$cfg["trigger"] = $this->trigger_el_id;
$cfg["trigger_event"] = $this->trigger_event;
$cfg["anchor_id"] = $this->trigger_anchor_el_id;
$cfg["auto_hide"] = $this->auto_hide;
$cfg["close_el"] = $this->close_el;
include_once("./Services/JSON/classes/class.ilJsonUtil.php");
//var_dump(ilJsonUtil::encode($cfg));
return 'ilOverlay.add("'.$this->overlay_el_id.'", '.
ilJsonUtil::encode($cfg).'); ';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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
@return

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

Referenced by addTrigger().

{
$center = ($a_center) ? "true" : "false";
return 'ilOverlay.addTrigger("'.$a_tr_id.'","'.$a_tr_event.'","'.$this->overlay_el_id.'","'.
$a_anchor_el_id.'", '.$center.',"'.$a_ov_corner.'","'.$a_anch_corner.'"); ';
}

+ Here is the caller graph for this function:

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.

{
$this->anchor_el_id = $a_anchor_el_id;
$this->anchor_ov_corner = $a_ov_corner;
$this->anchor_anch_corner = $a_anch_corner;
}
ilOverlayGUI::setAutoHide (   $a_val)

Set auto hiding.

Parameters
booleanauto hide

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

{
$this->auto_hide = $a_val;
}
ilOverlayGUI::setCloseElementId (   $a_val)

Set close element id.

Parameters
stringclose element id

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

{
$this->close_el = $a_val;
}
ilOverlayGUI::setFixedCenter (   $a_fixed_center = true)

Set fixed center.

Parameters
booleanfixed center

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

{
$this->fixed_center = $a_fixed_center;
}
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.

{
$this->width = $a_width;
$this->height = $a_height;
}
ilOverlayGUI::setTrigger (   $a_el_id,
  $a_event = "onclick",
  $a_trigger_anchor_el_id = null 
)

Set trigger element.

Parameters
stringelement id
stringevent ("onclicke" or "onmouseover")

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

{
$this->trigger_el_id = $a_el_id;
$this->trigger_event = $a_event;
$this->trigger_anchor_el_id = $a_trigger_anchor_el_id;
}
ilOverlayGUI::setVisible (   $a_visible = true)

Set visible.

Parameters
booleanvisible

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

{
$this->visible = $a_visible;
}

Field Documentation

ilOverlayGUI::$anchor_anch_corner = ""
protected

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

ilOverlayGUI::$anchor_el_id = ""
protected

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

ilOverlayGUI::$anchor_ov_corner = ""
protected

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

ilOverlayGUI::$auto_hide = true
protected

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

Referenced by getAutoHide(), and getOnLoadCode().

ilOverlayGUI::$close_el = null
protected

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

Referenced by getCloseElementId(), and getOnLoadCode().

ilOverlayGUI::$fixed_center = false
protected

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

ilOverlayGUI::$height = ""
protected

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

Referenced by getOnLoadCode().

ilOverlayGUI::$visible = false
protected

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

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: