19 declare(strict_types=1);
32 if ($component instanceof
Inline) {
33 return $this->
renderInline($component, $default_renderer);
35 throw new LogicException(
"Cannot render: " . get_class($component));
40 if ($result = $component->getResult()) {
41 $f = $component->getEvaluation();
42 $f($result, $component);
45 $tpl = $this->
getTemplate(
"tpl.launcher_inline.html",
true,
true);
48 $target = $component->getTarget()->getURL();
49 $label = $component->getButtonLabel();
50 $launchable = $component->isLaunchable();
52 $launch_glyph = $ui_factory->symbol()->glyph()->launch();
53 $start_button = $ui_factory->button()->bulky($launch_glyph, $label, (
string) $target);
55 if ($modal = $component->getModal()) {
56 if ($modal_submit_lable = $component->getModalSubmitLabel()) {
57 $modal = $modal->withSubmitLabel($modal_submit_lable);
60 if ($modal_cancel_label = $component->getModalCancelLabel()) {
61 $modal = $modal->withCancelButtonLabel($modal_cancel_label);
64 $tpl->setVariable(
"FORM", $default_renderer->render($modal));
65 $start_button = $start_button->withOnClick($modal->getShowSignal());
69 $start_button =$start_button->withUnavailableAction();
71 if ($status_icon = $component->getStatusIcon()) {
72 $tpl->setVariable(
"STATUS_ICON", $default_renderer->render($status_icon));
74 if ($status_message = $component->getStatusMessageBox()) {
75 $tpl->setVariable(
"STATUS_MESSAGE", $default_renderer->render($status_message));
77 $tpl->setVariable(
"DESCRIPTION", $component->getDescription());
78 $tpl->setVariable(
"BUTTON", $default_renderer->render($start_button));
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
getComponentInterfaceName()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
render(Component\Component $component, RendererInterface $default_renderer)
renderInline(Inline $component, RendererInterface $default_renderer)
getUIFactory()
Get a UI factory.
Base class for all component renderers.