19 declare(strict_types=1);
44 $title = $component->getTitle();
45 if ($title instanceof
Shy) {
46 $image_alt = $title->getLabel();
47 $title = $default_renderer->render($title);
52 if ($component->isHighlighted()) {
53 $tpl->touchBlock(
"highlight");
55 $tpl->touchBlock(
"no_highlight");
62 if (!empty($component->getTitleAction())) {
63 if (is_string($component->getTitleAction())) {
64 $tpl->setCurrentBlock(
"title_action_begin");
65 $tpl->setVariable(
"HREF", $component->getTitleAction());
67 $tpl->parseCurrentBlock();
68 } elseif ($title instanceof Shy) {
69 $title = $default_renderer->render($title);
71 if (is_array($component->getTitleAction())) {
72 $tpl->setCurrentBlock(
"title_action_begin");
74 $tpl->parseCurrentBlock();
78 $tpl->setVariable(
"TITLE", $title);
80 if ($component->getImage()) {
81 $tpl->setVariable(
"IMAGE", $default_renderer->render(
82 $component->getImage()->withAlt($this->
txt(
"open").
" ".strip_tags($image_alt))
86 if (!empty($component->getTitleAction())) {
87 $tpl->touchBlock(
"title_action_end");
90 if (is_array($component->getSections())) {
91 foreach ($component->getSections() as $section) {
92 $tpl->setCurrentBlock(
"section");
93 $tpl->setVariable(
"SECTION", $default_renderer->render($section));
94 $tpl->parseCurrentBlock();
99 $tpl->setCurrentBlock(
"action");
101 $obj_icon = $component->getObjectIcon();
102 if ($obj_icon !== null) {
103 $tpl->setVariable(
"OBJECT_ICON", $default_renderer->render($obj_icon));
106 $progress = $component->getProgress();
107 if ($progress !== null) {
108 $tpl->setVariable(
"PROGRESS_STATUS", $default_renderer->render($progress));
111 $certificate = $component->getCertificateIcon();
112 if ($certificate !== null) {
113 $certificate_icon =
new StandardIcon(
"cert",
"Certificate",
"medium",
false);
114 $tpl->setVariable(
"PROGRESS_STATUS", $default_renderer->render($certificate_icon));
117 $dropdown = $component->getActions();
118 if ($dropdown !== null) {
119 $tpl->setVariable(
"DROPDOWN", $default_renderer->render($dropdown));
122 $tpl->parseCurrentBlock();
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...
txt(string $id)
Get a text from the language file.
createId()
Get a fresh unique id.
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
getComponentInterfaceName()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.