19declare(strict_types=1);
26use ILIAS\GlobalScreen\Collector\Renderer\isSupportedTrait;
50 $this->gs =
$DIC->globalScreen();
51 $this->
lng = $DIC->language();
61 $f = $this->
ui->factory();
63 $center =
$f->mainControls()->slate()->combined($this->
lng->txt(
"noc"), $this->buildIcon($item))
66 foreach ($this->gs->collector()->notifications()->getNotifications() as $notification) {
67 $center = $center->withAdditionalEntry($notification->getRenderer($this->ui->factory())->getNotificationComponentForItem($notification));
90 $(document).on('$toggle_signal', function(event, signalData) {
91 $.ajax({url: '$url'});
109 fn(
string $id):
string =>
"document.addEventListener('rerenderNotificationCenter', () => {
110 let xhr = new XMLHttpRequest();
111 xhr.open('GET', '$url');
113 if (xhr.status === 200) {
114 let response = JSON.parse(xhr.responseText);
115 $id.querySelector('.il-maincontrols-slate-content').innerHTML = response.html;
116 $id.querySelectorAll('.il-maincontrols-slate-content script').forEach( element => {
117 eval(element.innerHTML);
119 $id.parentNode.previousElementSibling.querySelector('.glyph').outerHTML = response.symbol;
121 console.error(xhr.status + ': ' + xhr.responseText);
134 return http_build_query([
135 ClientNotifications::MODE => ClientNotifications::MODE_OPENED,
136 ClientNotifications::NOTIFICATION_IDENTIFIERS => $this->gs->collector()->notifications()->getNotificationsIdentifiersAsArray(
true),
142 return http_build_query([ClientNotifications::MODE => ClientNotifications::MODE_RERENDER]);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.