ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
NotificationCenterProvider.php
Go to the documentation of this file.
2
5
12{
13
17 public function getMetaBarItems() : array
18 {
19 $mb = $this->globalScreen()->metaBar();
21 $id = function ($id) : IdentificationInterface {
22 return $this->if->identifier($id);
23 };
24
25 $nc = $this->dic->globalScreen()->collector()->notifications();
26
27 $new = $nc->getAmountOfNewNotifications();
28 $old = $nc->getAmountOfOldNotifications();
29
30 return [
31 $mb->notificationCenter($id('notification_center'))
32 ->withAmountOfOldNotifications($new + $old)
33 ->withAmountOfNewNotifications($new)
34 ->withNotifications($nc->getNotifications())
35 ->withAvailableCallable(static function () {
36 //This is a heavily incomplete fix for: #26586
37 //This should be fixed by the auth service
38 global $DIC;
39 if ($DIC->ctrl()->getCmd() == "showLogout") {
40 return false;
41 }
42 return true;
43 })
44 ->withVisibilityCallable(
45 $access_checks->isUserLoggedIn(function () : bool {
46 return $this->dic->globalScreen()->collector()->notifications()->hasItems();
47 })
48 ),
49 ];
50 }
51}
An exception for terminatinating execution or to throw for unit testing.
$DIC
Definition: xapitoken.php:46