-
- // Get the network notifications
- if ((DI::args()->get(1) == 'network')) {
- $notificationHeader = DI::l10n()->t('Network Notifications');
- $notifications = $nm->getNetworkList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE);
-
- // Get the system notifications
- } elseif ((DI::args()->get(1) == 'system')) {
- $notificationHeader = DI::l10n()->t('System Notifications');
- $notifications = $nm->getSystemList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE);
-
- // Get the personal notifications
- } elseif ((DI::args()->get(1) == 'personal')) {
- $notificationHeader = DI::l10n()->t('Personal Notifications');
- $notifications = $nm->getPersonalList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE);
-
- // Get the home notifications
- } elseif ((DI::args()->get(1) == 'home')) {
- $notificationHeader = DI::l10n()->t('Home Notifications');
- $notifications = $nm->getHomeList(self::$showAll, self::$firstItemNum, self::ITEMS_PER_PAGE);
- // fallback - redirect to main page
+ $notifications = [];
+
+ $factory = $this->formattedNotifyFactory;
+
+ if (($this->args->get(1) == 'network')) {
+ $notificationHeader = $this->t('Network Notifications');
+ $notifications = [
+ 'ident' => FormattedNotify::NETWORK,
+ 'notifications' => $factory->getNetworkList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE),
+ ];
+ } elseif (($this->args->get(1) == 'system')) {
+ $notificationHeader = $this->t('System Notifications');
+ $notifications = [
+ 'ident' => FormattedNotify::SYSTEM,
+ 'notifications' => $factory->getSystemList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE),
+ ];
+ } elseif (($this->args->get(1) == 'personal')) {
+ $notificationHeader = $this->t('Personal Notifications');
+ $notifications = [
+ 'ident' => FormattedNotify::PERSONAL,
+ 'notifications' => $factory->getPersonalList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE),
+ ];
+ } elseif (($this->args->get(1) == 'home')) {
+ $notificationHeader = $this->t('Home Notifications');
+ $notifications = [
+ 'ident' => FormattedNotify::HOME,
+ 'notifications' => $factory->getHomeList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE),
+ ];