diff options
Diffstat (limited to 'lib/private/NavigationManager.php')
-rw-r--r-- | lib/private/NavigationManager.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 97bb8f85894..2ffd25df9b8 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -49,6 +49,8 @@ class NavigationManager implements INavigationManager { protected $entries = []; protected $closureEntries = []; protected $activeEntry; + protected $unreadCounters = []; + /** @var bool */ protected $init = false; /** @var IAppManager|AppManager */ @@ -97,7 +99,11 @@ class NavigationManager implements INavigationManager { if (!isset($entry['type'])) { $entry['type'] = 'link'; } - $this->entries[$entry['id']] = $entry; + + $id = $entry['id']; + $entry['unread'] = isset($this->unreadCounters[$id]) ? $this->unreadCounters[$id] : 0; + + $this->entries[$id] = $entry; } /** @@ -319,4 +325,8 @@ class NavigationManager implements INavigationManager { } return false; } + + public function setUnreadCounter(string $id, int $unreadCounter): void { + $this->unreadCounters[$id] = $unreadCounter; + } } |