19 declare(strict_types=1);
43 return $this->
renderBulky($component, $default_renderer);
45 throw new LogicException(
"Cannot render: " . get_class($component));
53 $action = $component->getAction();
54 $label = $component->getLabel();
55 if ($component->getOpenInNewViewport()) {
56 $tpl->touchBlock(
"open_in_new_viewport");
58 if (null !== $component->getContentLanguage()) {
59 $tpl->setVariable(
"CONTENT_LANGUAGE", $component->getContentLanguage());
61 if (null !== $component->getLanguageOfReferencedResource()) {
62 $tpl->setVariable(
"HREF_LANGUAGE", $component->getLanguageOfReferencedResource());
66 foreach ($component->getRelationshipsToReferencedResource() as $rel) {
67 $rel_strings[] = $rel->value;
69 if (!empty($rel_strings)) {
70 $tpl->setVariable(
"RELS", implode(
' ', $rel_strings));
73 $tpl->setVariable(
"LABEL", $label);
74 $tpl->setVariable(
"HREF", $action);
80 $tooltip_embedding = $this->
getTooltipRenderer()->maybeGetTooltipEmbedding(...$component->getHelpTopics());
81 if (! $tooltip_embedding) {
86 $component = $component->withAdditionalOnLoadCode($tooltip_embedding[1]);
89 $tpl->
setVariable(
"ARIA_DESCRIBED_BY", $tooltip_id);
93 return $tooltip_embedding[0]($tooltip_id, $tpl->
get());
99 $tpl_name =
"tpl.standard.html";
108 $tpl_name =
"tpl.bulky.html";
110 $renderer = $default_renderer->withAdditionalContext($component);
111 $tpl->setVariable(
"SYMBOL", $renderer->render($component->getSymbol()));
113 $aria_role = $component->getAriaRole();
114 if ($aria_role != null) {
115 $tpl->setCurrentBlock(
"with_aria_role");
116 $tpl->setVariable(
"ARIA_ROLE", $aria_role);
117 $tpl->parseCurrentBlock();
128 Component\Link\Standard::class,
129 Component\Link\Bulky::class
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setStandardVars(string $tpl_name, Component\Link\Link $component)
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $name)
Set the block to work on.
createId()
Get a fresh unique id.
render(Component\Component $component, RendererInterface $default_renderer)
setVariable(string $name, $value)
Set a variable in the current block.
This implements commonalities between Links.
getComponentInterfaceName()
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
maybeRenderWithTooltip(Component\Link\Link $component, Template $tpl)
get(string $block=null)
Get the rendered template or a specific block.
renderBulky(Component\Link\Bulky $component, RendererInterface $default_renderer)
parseCurrentBlock()
Parse the block that is currently worked on.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
renderStandard(Component\Link\Standard $component)
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.