ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Notifications\Provider\NotificationCenterProvider Class Reference

Class NotificationCenterProvider. More...

+ Inheritance diagram for ILIAS\Notifications\Provider\NotificationCenterProvider:
+ Collaboration diagram for ILIAS\Notifications\Provider\NotificationCenterProvider:

Public Member Functions

 getMetaBarItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticMetaBarProvider
 __construct (Container $dic)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\MetaBarProviderInterface
 getProviderNameForPresentation ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticMetaBarProvider
 $dic
 
 $if
 
 $meta_bar
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Member Function Documentation

◆ getMetaBarItems()

ILIAS\Notifications\Provider\NotificationCenterProvider::getMetaBarItems ( )

Implements ILIAS\GlobalScreen\Scope\MetaBar\Provider\StaticMetaBarProvider.

Definition at line 16 of file NotificationCenterProvider.php.

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen().

16  : array
17  {
18  $mb = $this->globalScreen()->metaBar();
19 
20  $id = function (string $id) : IdentificationInterface {
21  return $this->if->identifier($id);
22  };
23 
24  $nc = $this->dic->globalScreen()->collector()->notifications();
25 
26  $new = $nc->getAmountOfNewNotifications();
27  $old = $nc->getAmountOfOldNotifications();
28 
29  return [
30  $mb->notificationCenter($id('notification_center'))
31  ->withAmountOfOldNotifications($new + $old)
32  ->withAmountOfNewNotifications($new)
33  ->withNotifications($nc->getNotifications())
34  ->withAvailableCallable(function () : bool {
35  //This is a heavily incomplete fix for: #26586
36  //This should be fixed by the auth service
37  if ($this->dic->ctrl()->getCmd() == "showLogout") {
38  return false;
39  }
40 
41  return true;
42  })
43  ->withVisibilityCallable(
44  function () : bool {
45  return (
46  !$this->dic->user()->isAnonymous() &&
47  $this->dic->globalScreen()->collector()->notifications()->hasItems()
48  );
49  }
50  ),
51  ];
52  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: