ILIAS  release_8 Revision v8.24
NotificationCenterProvider.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
25
30{
34 public function getMetaBarItems(): array
35 {
36 $mb = $this->globalScreen()->metaBar();
37
38 $id = function (string $id): IdentificationInterface {
39 return $this->if->identifier($id);
40 };
41
42 $nc = $this->dic->globalScreen()->collector()->notifications();
43
44 $new = $nc->getAmountOfNewNotifications();
45 $old = $nc->getAmountOfOldNotifications();
46
47 return [
48 $mb->notificationCenter($id('notification_center'))
49 ->withAmountOfOldNotifications($new + $old)
50 ->withAmountOfNewNotifications($new)
51 ->withNotifications($nc->getNotifications())
52 ->withAvailableCallable(function (): bool {
53 return $this->dic->ctrl()->getCmd() !== "showLogout";
54 })
55 ->withVisibilityCallable(
56 function (): bool {
57 return (
58 !$this->dic->user()->isAnonymous() &&
59 $this->dic->globalScreen()->collector()->notifications()->hasItems()
60 );
61 }
62 ),
63 ];
64 }
65}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...