23 return $this->renderNotification($component, $default_renderer);
25 return $this->
renderGroup($component, $default_renderer);
34 $title = $component->getTitle();
35 $items = $component->getItems();
38 foreach ($items as $item) {
39 $tpl->setCurrentBlock(
"item");
40 $tpl->setVariable(
"ITEM", $default_renderer->render($item));
41 $tpl->parseCurrentBlock();
45 $tpl->setCurrentBlock(
"title");
46 $tpl->setVariable(
"TITLE", $title);
47 $tpl->parseCurrentBlock();
51 $actions = $component->getActions();
52 if ($actions !==
null) {
53 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
55 $tpl->setVariable(
"ACTIONS",
"");
71 $color = $component->getColor();
72 if ($color !==
null) {
73 $tpl->setCurrentBlock(
"color");
74 $tpl->setVariable(
"COLOR", $color->asHex());
75 $tpl->parseCurrentBlock();
79 $lead = $component->getLead();
81 if (is_string($lead)) {
82 $tpl->setCurrentBlock(
"lead_text");
83 $tpl->setVariable(
"LEAD_TEXT", $lead);
84 $tpl->parseCurrentBlock();
86 if ($lead instanceof
Component\Image\Image) {
87 $tpl->setCurrentBlock(
"lead_image");
88 $tpl->setVariable(
"LEAD_IMAGE", $default_renderer->render($lead));
89 $tpl->parseCurrentBlock();
91 if ($lead instanceof
Component\Symbol\Icon\Icon) {
92 $tpl->setCurrentBlock(
"lead_icon");
93 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($lead));
94 $tpl->parseCurrentBlock();
95 $tpl->setCurrentBlock(
"lead_start_icon");
96 $tpl->parseCurrentBlock();
98 $tpl->setCurrentBlock(
"lead_start");
99 $tpl->parseCurrentBlock();
101 $tpl->touchBlock(
"lead_end");
104 $actions = $component->getActions();
105 if ($actions !==
null) {
106 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
111 protected function renderNotification(
Notification $component, RendererInterface $default_renderer)
117 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($component->
getLeadIcon()));
121 if ($actions !==
null) {
122 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
127 $tpl->setCurrentBlock(
"additional_content");
129 $tpl->parseCurrentBlock();
132 $aggregates_html =
"";
136 $aggregates_html = $default_renderer->render(
149 function ($id) use ($toggleable) {
150 return "il.UI.item.notification.getNotificationItemObject($($id)).registerAggregates($toggleable);";
157 $tpl->setCurrentBlock(
"aggregate_notifications");
158 $tpl->setVariable(
"AGGREGATES", $aggregates_html);
159 $tpl->setVariable(
"PARENT_ID", $item_id);
160 $tpl->parseCurrentBlock();
168 $close_action = $this->
getUIFactory()->button()->close()->withAdditionalOnLoadCode(
169 function ($id) use (
$url, $item_id) {
170 return "il.UI.item.notification.getNotificationItemObject($($id)).registerCloseAction('$url',1);";
173 $tpl->setVariable(
"CLOSE_ACTION", $default_renderer->render($close_action));
176 $tpl->setCurrentBlock(
"id");
177 $tpl->setVariable(
'ID', $item_id);
178 $tpl->parseCurrentBlock();
186 RendererInterface $default_renderer,
189 $title = $component->getTitle();
191 $title = $default_renderer->render($title);
193 $tpl->setVariable(
"TITLE", $title);
198 RendererInterface $default_renderer,
202 $desc = $component->getDescription();
203 if (trim($desc) !=
"") {
204 $tpl->setCurrentBlock(
"desc");
205 $tpl->setVariable(
"DESC", $desc);
206 $tpl->parseCurrentBlock();
212 RendererInterface $default_renderer,
216 $props = $component->getProperties();
217 if (count($props) > 0) {
219 foreach ($props as
$name => $value) {
221 $value = $default_renderer->render($value);
225 $tpl->setCurrentBlock(
"property_row");
227 $tpl->setVariable(
"PROP_VAL_A", $value);
230 $tpl->setVariable(
"PROP_VAL_B", $value);
231 $tpl->parseCurrentBlock();
235 $tpl->parseCurrentBlock();
237 $tpl->setCurrentBlock(
"properties");
238 $tpl->parseCurrentBlock();
247 parent::registerResources($registry);
248 $registry->register(
'./src/UI/templates/js/Item/notification.js');
An exception for terminatinating execution or to throw for unit testing.
Common interface to all items.
Common interface to all items.
getLeadIcon()
Get icon as lead.Note that Notifications only accept Icons as lead, this is different from the standa...
getAdditionalContent()
Get the additional content of the item or null.
getAggregateNotifications()
Get the list of Notification Items, this Notification Item aggregates or an empty list....
getCloseAction()
Get the url attached to this Notification Item.
getComponentInterfaceName()
Get the name of the component-interface this renderer is supposed to render.ATTENTION: Fully qualifie...
renderProperties(Component\Item\Item $component, RendererInterface $default_renderer, \ILIAS\UI\Implementation\Render\Template $tpl)
renderTitle(Component\Item\Item $component, RendererInterface $default_renderer, \ILIAS\UI\Implementation\Render\Template $tpl)
renderStandard(Component\Item\Item $component, RendererInterface $default_renderer)
renderGroup(Component\Item\Group $component, RendererInterface $default_renderer)
registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
render(Component\Component $component, RendererInterface $default_renderer)
renderDescription(Component\Item\Item $component, RendererInterface $default_renderer, \ILIAS\UI\Implementation\Render\Template $tpl)
Base class for all component renderers.
txt($id)
Get a text from the language file.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.
checkComponent(Component $component)
Check if a given component fits this renderer and throw \LogicError if that is not the case.
getUIFactory()
Get a UI factory.
A component is the most general form of an entity in the UI.
withAdditionalOnLoadCode(\Closure $binder)
Add some onload-code to the component instead of replacing the existing one.
An entity that renders components to a string output.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Class ChatMainBarProvider \MainMenu\Provider.