ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTooltipGUI Class Reference

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

+ Collaboration diagram for ilTooltipGUI:

Static Public Member Functions

static addTooltip ($a_el_id, $a_text, $a_container="")
 Adds a tooltip to an HTML element.
static getToolTip ($a_el_id, $a_text, $a_container="")
 Get tooltip js code.

Static Protected Attributes

static $initialized = false

Detailed Description

This is a utility class for the yui tooltips.

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

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

Member Function Documentation

static ilTooltipGUI::addTooltip (   $a_el_id,
  $a_text,
  $a_container = "" 
)
static

Adds a tooltip to an HTML element.

Parameters
string$a_el_idelement id
string$a_el_idtooltip text
string$a_el_idelement id of container the tooltip should be added to

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

References $tpl, and ilYuiUtil\initTooltip().

Referenced by ilTable2GUI\fillHeader(), ilObjectListGUI\getHeaderAction(), ilRatingGUI\getHTML(), ilPersonalSkillsGUI\getSkillHTML(), and ilPageObjectGUI\getTinyMenu().

{
global $tpl;
if (!self::$initialized)
{
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
$tpl->addJavascript("./Services/UIComponent/Tooltip/js/ilTooltip.js");
$tpl->addOnLoadCode('ilTooltip.init();', 3);
self::$initialized = true;
}
$code = self::getTooltip($a_el_id, $a_text, $a_container);
$tpl->addOnLoadCode($code);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilTooltipGUI::getToolTip (   $a_el_id,
  $a_text,
  $a_container = "" 
)
static

Get tooltip js code.

Parameters
string$a_el_idelement id
string$a_el_idtooltip text
string$a_el_idelement id of container the tooltip should be added to

Definition at line 43 of file class.ilTooltipGUI.php.

{
$addstr = "";
if ($a_container != "")
{
$addstr.= ", container: '".$a_container."'";
}
return 'ilTooltip.add("'.$a_el_id.'", { context:"'.$a_el_id.
'", text:"'.htmlspecialchars(str_replace(array("\n", "\r"), "", $a_text)).'" '.$addstr.'} );';
}

Field Documentation

ilTooltipGUI::$initialized = false
staticprotected

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


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