33 string $a_container =
"",
34 string $a_my =
"bottom center",
35 string $a_at =
"top center",
36 bool $a_use_htmlspecialchars =
true 45 $code = self::getToolTip(
51 $a_use_htmlspecialchars
53 $tpl->addOnLoadCode($code);
62 string $a_container =
"",
63 string $a_my =
"bottom center",
64 string $a_at =
"top center",
65 bool $a_use_htmlspecialchars =
true 72 if ($a_container !==
"") {
73 $addstr .=
", container: '" . $a_container .
"'";
76 if ($a_use_htmlspecialchars) {
77 $a_text = htmlspecialchars(str_replace(array(
"\n",
"\r"),
"", $a_text));
79 $a_text = str_replace(array(
"\n",
"\r",
"'",
'"'), array(
"",
"",
"\'",
'\"'), $a_text);
81 return 'il.Tooltip.add("' . $a_el_id .
'", {' .
82 ' context:"' . $a_el_id .
'",' .
83 ' my:"' . $a_my .
'",' .
84 ' at:"' . $a_at .
'",' .
85 ' text:"' . $a_text .
'" ' . $addstr .
'} );';
91 public static function init(): void
96 if (!self::$initialized) {
97 $tpl->addCss(
"./node_modules/qtip2/dist/jquery.qtip.min.css");
98 $tpl->addJavascript(
"./node_modules/qtip2/dist/jquery.qtip.min.js");
99 $tpl->addJavascript(
"./Services/UIComponent/Tooltip/js/ilTooltip.js");
102 $tpl->addOnLoadCode(
'setTimeout(function() {il.Tooltip.init();}, 500);', 3);
103 self::$initialized =
true;