3 declare(strict_types=1);
45 return $this->renderNotification($component, $default_renderer);
46 } elseif ($component instanceof
Group) {
47 return $this->
renderGroup($component, $default_renderer);
48 } elseif ($component instanceof
Standard) {
50 } elseif ($component instanceof
Shy) {
51 return $this->
renderShy($component, $default_renderer);
63 foreach ($items as $item) {
64 $tpl->setCurrentBlock(
"item");
65 $tpl->setVariable(
"ITEM", $default_renderer->render($item));
66 $tpl->parseCurrentBlock();
70 $tpl->setCurrentBlock(
"title");
71 $tpl->setVariable(
"TITLE", $title);
72 $tpl->parseCurrentBlock();
77 if ($actions !== null) {
78 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
80 $tpl->setVariable(
"ACTIONS",
"");
95 $color = $component->getColor();
96 if ($color !== null) {
97 $tpl->setCurrentBlock(
"color");
98 $tpl->setVariable(
"COLOR", $color->asHex());
99 $tpl->parseCurrentBlock();
103 $lead = $component->getLead();
104 $progress = $component->getProgress();
106 if (is_string($lead)) {
107 if ($progress != null) {
108 $tpl->setCurrentBlock(
"lead_text_with_progress");
109 $tpl->touchBlock(
"item_with_lead_and_progress");
111 $tpl->setCurrentBlock(
"lead_text");
112 $tpl->touchBlock(
"item_with_lead_only");
114 $tpl->setVariable(
"LEAD_TEXT", $lead);
115 $tpl->parseCurrentBlock();
117 if ($lead instanceof
Image) {
118 if ($progress != null) {
119 $tpl->setCurrentBlock(
"lead_image_with_progress");
120 $tpl->touchBlock(
"item_with_lead_and_progress");
122 $tpl->setCurrentBlock(
"lead_image");
123 $tpl->touchBlock(
"item_with_lead_only");
125 $tpl->setVariable(
"LEAD_IMAGE", $default_renderer->render($lead));
126 $tpl->parseCurrentBlock();
128 if ($lead instanceof
Icon || $lead instanceof
Avatar) {
129 $tpl->setCurrentBlock(
"lead_icon");
130 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($lead));
131 $tpl->parseCurrentBlock();
132 $tpl->setCurrentBlock(
"lead_start_icon");
133 $tpl->parseCurrentBlock();
135 $tpl->setCurrentBlock(
"lead_start");
136 $tpl->parseCurrentBlock();
138 if ($progress != null && ($lead instanceof
Icon || $lead instanceof Avatar)) {
139 $tpl->setCurrentBlock(
"progress_end_with_lead_icon");
140 $tpl->setVariable(
"PROGRESS", $default_renderer->render($progress));
141 $tpl->parseCurrentBlock();
142 } elseif ($progress != null) {
143 $tpl->setCurrentBlock(
"progress_end");
144 $tpl->setVariable(
"PROGRESS", $default_renderer->render($progress));
145 $tpl->parseCurrentBlock();
147 $tpl->touchBlock(
"lead_end");
149 } elseif ($progress != null) {
150 $tpl->touchBlock(
"item_with_progress_only");
151 $tpl->setCurrentBlock(
"progress_end");
152 $tpl->setVariable(
"PROGRESS", $default_renderer->render($progress));
153 $tpl->parseCurrentBlock();
157 $actions = $component->getActions();
158 if ($actions !== null) {
159 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
172 if ($component->getProperties() !== []) {
173 foreach ($component->getProperties() as
$name => $value) {
174 $name = htmlentities($name);
176 $value = $default_renderer->render($value);
178 $value = htmlentities($value);
180 $tpl->setCurrentBlock(
"property_row");
181 $tpl->setVariable(
"PROP_NAME_A", $name);
182 $tpl->setVariable(
"PROP_VAL_A", $value);
183 $tpl->parseCurrentBlock();
185 $tpl->setCurrentBlock(
"properties");
186 $tpl->parseCurrentBlock();
189 if ($component->getLeadIcon() !== null) {
190 $tpl->setCurrentBlock(
"lead_icon");
191 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($component->getLeadIcon()));
192 $tpl->parseCurrentBlock();
195 if ($component->getClose() !== null) {
196 $tpl->setCurrentBlock(
"close");
197 $tpl->setVariable(
"CLOSE", $default_renderer->render($component->getClose()));
198 $tpl->parseCurrentBlock();
202 $tpl->setCurrentBlock(
"id");
204 $tpl->parseCurrentBlock();
215 if (!is_null($desc) && trim($desc) !=
"") {
216 $tpl->setCurrentBlock(
"desc");
217 $tpl->setVariable(
"DESC", $desc);
218 $tpl->parseCurrentBlock();
221 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($component->
getLeadIcon()));
225 if ($actions !== null) {
226 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
231 $tpl->setCurrentBlock(
"additional_content");
233 $tpl->parseCurrentBlock();
238 $aggregates_html = $default_renderer->render(
250 $component = $component->withAdditionalOnLoadCode(
251 fn (
$id) =>
"il.UI.item.notification.getNotificationItemObject($($id)).registerAggregates($toggleable);" 257 $tpl->setCurrentBlock(
"aggregate_notifications");
258 $tpl->setVariable(
"AGGREGATES", $aggregates_html);
259 $tpl->setVariable(
"PARENT_ID", $item_id);
260 $tpl->parseCurrentBlock();
268 $close_action = $this->
getUIFactory()->button()->close()->withAdditionalOnLoadCode(
269 fn (
$id) =>
"il.UI.item.notification.getNotificationItemObject($($id)).registerCloseAction('$url',1);" 271 $tpl->setVariable(
"CLOSE_ACTION", $default_renderer->render($close_action));
274 $tpl->setCurrentBlock(
"id");
275 $tpl->setVariable(
'ID', $item_id);
276 $tpl->parseCurrentBlock();
284 if ($title instanceof
Button\
Shy || $title instanceof
Link) {
285 $title = $default_renderer->render($title);
287 $title = htmlentities($title);
296 if (!is_null($desc) && trim($desc) !=
"") {
309 $audio = $component->getAudioPlayer();
310 if (!is_null($audio)) {
312 $tpl->
setVariable(
"AUDIO", $default_renderer->render($audio));
320 if (count($props) > 0) {
322 foreach ($props as
$name => $value) {
325 $value = $default_renderer->render($value);
355 parent::registerResources($registry);
356 $registry->
register(
'./src/UI/templates/js/Item/dist/notification.js');
Registry for resources required by rendered output like Javascript or CSS.
getTitle()
Gets the title of the item.
getActions()
Get the actions of the item.
renderGroup(Group $component, RendererInterface $default_renderer)
getAggregateNotifications()
Get the list of Notification Items, this Notification Item aggregates or an empty list...
getTitle()
Gets the title of the group.
getAdditionalContent()
Get the additional content of the item or null.
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
renderShy(Shy $component, RendererInterface $default_renderer)
Class ChatMainBarProvider .
This describes how an icon could be modified during construction of UI.
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.
Common interface to item groups.
renderAudioPlayer(Item $component, RendererInterface $default_renderer, Template $tpl)
renderTitle(Item $component, RendererInterface $default_renderer, Template $tpl)
setCurrentBlock(string $name)
Set the block to work on.
setVariable(string $name, $value)
Set a variable in the current block.
This describes how a letter or a picture avatar could be modified during construction of UI...
render(Component $component, RendererInterface $default_renderer)
Common interface to all items.
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
getActions()
Get the actions Dropdown of the group.
getOnLoadCode()
Get the currently bound on load code.
getItems()
Gets item of the group.
renderStandard(Item $component, RendererInterface $default_renderer)
getDescription()
Get the description of the item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.
register(string $name)
Add a dependency.
renderDescription(Item $component, Template $tpl)
getComponentInterfaceName()
parseCurrentBlock()
Parse the block that is currently worked on.
getProperties()
Get the properties of the appointment.
renderProperties(Item $component, RendererInterface $default_renderer, Template $tpl)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getCloseAction()
Get the url attached to this Notification Item.
getUIFactory()
Get a UI factory.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Base class for all component renderers.
getLeadIcon()
Get icon as lead.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.