19 static function addTooltip($a_el_id, $a_text, $a_container =
"")
23 if (!self::$initialized)
25 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
27 $tpl->addJavascript(
"./Services/UIComponent/Tooltip/js/ilTooltip.js");
28 $tpl->addOnLoadCode(
'ilTooltip.init();', 3);
29 self::$initialized =
true;
32 $code = self::getTooltip($a_el_id, $a_text, $a_container);
33 $tpl->addOnLoadCode($code);
43 static function getToolTip($a_el_id, $a_text, $a_container =
"")
46 if ($a_container !=
"")
48 $addstr.=
", container: '".$a_container.
"'";
51 return 'ilTooltip.add("'.$a_el_id.
'", { context:"'.$a_el_id.
52 '", text:"'.htmlspecialchars(str_replace(array(
"\n",
"\r"),
"", $a_text)).
'" '.$addstr.
'} );';