3 declare(strict_types=1);
34 protected $get_template
36 if (!is_callable($this->get_template)) {
37 throw new \InvalidArgumentException(
"\$get_template should be callable.");
55 if (count($topics) === 0) {
59 $tooltips = $this->help_text_retriever->getHelpText(Help\Purpose::Tooltip(), ...$topics);
60 if (count($tooltips) === 0) {
64 $get_template = $this->get_template;
65 $embed_html =
static function (
string $tooltip_id,
string $component_html) use ($tooltips, $get_template):
string {
66 $tpl = $get_template(
"components/ILIAS/UI/src/templates/default/tpl.tooltip.html",
true,
true);
67 $tpl->setVariable(
"ELEMENT", $component_html);
68 $tpl->setVariable(
"TOOLTIP_ID", $tooltip_id);
70 foreach ($tooltips as $tooltip) {
71 $tpl->setCurrentBlock(
"tooltip");
72 $tpl->setVariable(
"TOOLTIP", $tooltip);
73 $tpl->parseCurrentBlock();
79 $embed_js =
static function (
$id) {
80 return "new il.UI.core.Tooltip(document.getElementById('$id'));";
83 return [$embed_html, $embed_js];
This is just a class that marks a string as a help topic.
This describes a facility that the UI framework can use to retrieve some help text.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...