ILIAS  release_4-3 Revision
 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="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
 Adds a tooltip to an HTML element.
static getToolTip ($a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
 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 = "",
  $a_my = "bottom center",
  $a_at = "top center",
  $a_use_htmlspecialchars = true 
)
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.

Referenced by ilTabsGUI\__getHTML(), ilTable2GUI\fillHeader(), ilUsersOnlineBlockGUI\fillRow(), ilObjectListGUI\getHeaderAction(), ilGroupedListGUI\getHTML(), ilRatingGUI\getHTML(), ilAdvancedSelectionListGUI\getHTML(), ilPersonalSkillsGUI\getSkillHTML(), ilPageObjectGUI\getTinyMenu(), and ilMainMenuGUI\renderHelpButtons().

{
global $tpl;
if (!self::$initialized)
{
// include_once("./Services/YUI/classes/class.ilYuiUtil.php");
// ilYuiUtil::initTooltip();
$tpl->addCss("./Services/UIComponent/Tooltip/lib/qtip_2_0_nightly/jquery.qtip.min.css");
$tpl->addJavascript("./Services/UIComponent/Tooltip/lib/qtip_2_0_nightly/jquery.qtip.min.js");
$tpl->addJavascript("./Services/UIComponent/Tooltip/js/ilTooltip.js");
$tpl->addOnLoadCode('il.Tooltip.init();', 3);
self::$initialized = true;
}
$code = self::getTooltip($a_el_id, $a_text, $a_container, $a_my, $a_at,
$a_use_htmlspecialchars);
$tpl->addOnLoadCode($code);
}

+ Here is the caller graph for this function:

static ilTooltipGUI::getToolTip (   $a_el_id,
  $a_text,
  $a_container = "",
  $a_my = "bottom center",
  $a_at = "top center",
  $a_use_htmlspecialchars = true 
)
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 47 of file class.ilTooltipGUI.php.

{
$addstr = "";
if ($a_container != "")
{
$addstr.= ", container: '".$a_container."'";
}
if ($a_use_htmlspecialchars)
{
$a_text = htmlspecialchars(str_replace(array("\n", "\r"), "", $a_text));
}
else
{
$a_text = str_replace(array("\n", "\r", "'", '"'), array("", "", "\'", '\"'), $a_text);
}
return 'il.Tooltip.add("'.$a_el_id.'", {'.
' context:"'.$a_el_id.'",'.
' my:"'.$a_my.'",'.
' at:"'.$a_at.'",'.
' text:"'.$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: