ILIAS
trunk Revision v11.0_alpha-1723-g8e69f309bab
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
TooltipRenderer.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\Implementation\Render
;
22
23
use
ILIAS\UI\HelpTextRetriever
;
24
use
ILIAS\UI\Help
;
25
30
class
TooltipRenderer
31
{
32
public
function
__construct
(
33
protected
HelpTextRetriever
$help_text_retriever,
34
protected
$get_template
35
) {
36
if
(!is_callable($this->get_template)) {
37
throw
new \InvalidArgumentException(
"\$get_template should be callable."
);
38
}
39
}
40
53
public
function
maybeGetTooltipEmbedding
(Help\
Topic
...
$topics
): ?array
54
{
55
if
(count($topics) === 0) {
56
return
null
;
57
}
58
59
$tooltips = $this->help_text_retriever->getHelpText(Help\Purpose::Tooltip(), ...$topics);
60
if
(count($tooltips) === 0) {
61
return
null
;
62
}
63
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);
69
70
foreach
($tooltips as $tooltip) {
71
$tpl->setCurrentBlock(
"tooltip"
);
72
$tpl->setVariable(
"TOOLTIP"
, $tooltip);
73
$tpl->parseCurrentBlock();
74
}
75
76
return
$tpl->get();
77
};
78
79
$embed_js =
static
function
(
$id
) {
80
return
"new il.UI.core.Tooltip(document.getElementById('$id'));"
;
81
};
82
83
return
[$embed_html, $embed_js];
84
}
85
}
ILIAS\UI\Help\Topic
This is just a class that marks a string as a help topic.
Definition:
Topic.php:26
ILIAS\UI\HelpTextRetriever
This describes a facility that the UI framework can use to retrieve some help text.
Definition:
HelpTextRetriever.php:39
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:142
ILIAS\UI\Implementation\Render
Definition:
AbstractComponentRenderer.php:21
ILIAS\GlobalScreen\Scope\$topics
array $topics
Definition:
ComponentDecoratorTrait.php:39
ILIAS\UI\Implementation\Render\TooltipRenderer
This class is supposed to unify rendering of tooltips over all components and should also be usable b...
Definition:
TooltipRenderer.php:30
ILIAS\UI\Implementation\Render\TooltipRenderer\__construct
__construct(protected HelpTextRetriever $help_text_retriever, protected $get_template)
Definition:
TooltipRenderer.php:32
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
HelpTextRetriever
ILIAS\UI\Implementation\Render\TooltipRenderer\maybeGetTooltipEmbedding
maybeGetTooltipEmbedding(Help\Topic ... $topics)
This will provide functions that can be used to embed a components html into some html required for t...
Definition:
TooltipRenderer.php:53
ILIAS\UI\Help
Definition:
Purpose.php:21
components
ILIAS
UI
src
Implementation
Render
TooltipRenderer.php
Generated on Sun Apr 6 2025 23:04:34 for ILIAS by
1.8.13 (using
Doxyfile
)