ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NotificationCenterProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30{
31 public function getMetaBarItems(): array
32 {
33 $mb = $this->globalScreen()->metaBar();
34
35 $id = function (string $id): IdentificationInterface {
36 return $this->if->identifier($id);
37 };
38
39 $nc = $this->dic->globalScreen()->collector()->notifications();
40
41 $new = $nc->getAmountOfNewNotifications();
42 $old = $nc->getAmountOfOldNotifications();
43
44 return [
45 $mb->notificationCenter($id('notification_center'))
46 ->withAmountOfOldNotifications($new + $old)
47 ->withAmountOfNewNotifications($new)
48 ->withNotifications($nc->getNotifications())
49 ->withAvailableCallable(function (): bool {
50 return $this->dic->ctrl()->getCmd() !== 'showLogout';
51 })
53 function (): bool {
54 return (
55 !$this->dic->user()->isAnonymous() &&
56 $this->dic->globalScreen()->collector()->notifications()->hasItems()
57 );
58 }
59 ),
60 ];
61 }
62}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
withAvailableCallable(callable $is_available)
withVisibilityCallable(callable $is_visible)