19declare(strict_types=1);
35 if (!$component instanceof
Glyph) {
39 $tpl = $this->
getTemplate(
"tpl.glyph.standard.html",
true,
true);
41 if ($component->isHighlighted()) {
42 $tpl->touchBlock(
"highlighted");
45 $label = $component->getLabel();
47 $tpl->touchBlock(
'with_aria_label');
49 $tpl->setVariable(
"LABEL", $this->
txt($label));
50 $tpl->touchBlock(
'with_role');
53 $tpl->touchBlock(
'with_aria_hidden');
59 $tpl->setCurrentBlock(
"with_id");
60 $tpl->setVariable(
"ID",
$id);
61 $tpl->parseCurrentBlock();
63 $tpl->setVariable(
"GLYPH", $this->
getInnerGlyphHTML($component, $default_renderer));
69 $tpl = $this->
getTemplate(
'tpl.glyph.html',
true,
true);
71 $tpl->touchBlock($component->getType());
74 foreach ($component->getCounters() as
$counter) {
75 if ($largest_counter < $counter->getNumber()) {
76 $largest_counter =
$counter->getNumber();
78 $n =
"counter_" .
$counter->getType();
79 $tpl->setCurrentBlock($n);
80 $tpl->setVariable(strtoupper($n), $default_renderer->render(
$counter));
81 $tpl->parseCurrentBlock();
84 if ($largest_counter) {
85 $tpl->setCurrentBlock(
"counter_spacer");
86 $tpl->setVariable(
"COUNTER_SPACER", $largest_counter);
87 $tpl->parseCurrentBlock();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
render(Component\Component $component, RendererInterface $default_renderer)
@inheritdocs
getInnerGlyphHTML(Component\Component $component, RendererInterface $default_renderer)
Base class for all component renderers.
cannotHandleComponent(Component $component)
This method MUST be called by derived component renderers, if.
txt(string $id)
Get a text from the language file.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
Interface to templating as it is used in the UI framework.
An entity that renders components to a string output.