ILIAS  Release_4_4_x_branch Revision 61816
 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 initLibrary ()
 Initializes the needed tooltip libraries.

Static Protected Attributes

static $initialized = false
static $library_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 20 of file class.ilTooltipGUI.php.

References $tpl, and initLibrary().

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

{
global $tpl;
if (!self::$initialized)
{
$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 call graph for this function:

+ 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 45 of file class.ilTooltipGUI.php.

{
$addstr = "";
// not needed, just make sure the position plugin is included
// $addstr.= ", position: {viewport: $('#fixed_content')}";
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.'} );';
}
static ilTooltipGUI::initLibrary ( )
static

Initializes the needed tooltip libraries.

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

References $tpl.

Referenced by addTooltip(), and ilPreviewGUI\initPreview().

{
global $tpl;
if (self::$library_initialized)
return;
// include_once("./Services/YUI/classes/class.ilYuiUtil.php");
// ilYuiUtil::initTooltip();
$tpl->addCss("./Services/UIComponent/Tooltip/lib/qtip_2_1_1/jquery.qtip.min.css");
$tpl->addJavascript("./Services/UIComponent/Tooltip/lib/qtip_2_1_1/jquery.qtip.min.js");
self::$library_initialized = true;
}

+ Here is the caller graph for this function:

Field Documentation

ilTooltipGUI::$initialized = false
staticprotected

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

ilTooltipGUI::$library_initialized = false
staticprotected

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


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