19declare(strict_types=1);
24use ILIAS\GlobalScreen\Collector\Renderer\isSupportedTrait;
54 $this->gs =
$DIC->globalScreen();
55 $this->lng =
$DIC->language();
65 $f = $this->
ui->factory();
67 $center =
$f->mainControls()->slate()->combined($this->lng->txt(
"noc"), $this->buildIcon($item))
70 foreach ($this->gs->collector()->notifications()->getNotifications() as $notification) {
71 $center = $center->withAdditionalEntry($notification->getRenderer($this->ui->factory())->getNotificationComponentForItem($notification));
92 function ($id) use ($toggle_signal,
$url) {
94 $(document).on('$toggle_signal', function(event, signalData) {
95 $.ajax({url: '$url'});
112 function (
string $id) use (
$url) :
string {
113 return "document.addEventListener('rerenderNotificationCenter', () => {
114 let xhr = new XMLHttpRequest();
115 xhr.open('GET', '$url');
117 if (xhr.status === 200) {
118 let response = JSON.parse(xhr.responseText);
119 $id.querySelector('.il-maincontrols-slate-content').innerHTML = response.html;
120 $id.querySelectorAll('.il-maincontrols-slate-content script').forEach( element => {
121 eval(element.innerHTML);
123 $id.parentNode.previousElementSibling.querySelector('.glyph').outerHTML = response.symbol;
125 console.error(xhr.status + ': ' + xhr.responseText);
139 return http_build_query([
140 ClientNotifications::MODE => ClientNotifications::MODE_OPENED,
141 ClientNotifications::NOTIFICATION_IDENTIFIERS => $this->gs->collector()->notifications()->getNotificationsIdentifiersAsArray(
true),
147 return http_build_query([ClientNotifications::MODE => ClientNotifications::MODE_RERENDER]);
An exception for terminatinating execution or to throw for unit testing.
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.
This describes the Combined Slate.
getToggleSignal()
Signal that toggles the slate when triggered.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.