]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Notifications/Notifications.php
Allow the search for contacts on blocked servers via web
[friendica.git] / src / Module / Notifications / Notifications.php
index 269acb79db31fc38ab1c921d3acc563e2994189f..7852f81c2430e613ebb9cba837cf1e5ddd04ff59 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
 
 namespace Friendica\Module\Notifications;
 
+use Friendica\App;
 use Friendica\App\Arguments;
-use Friendica\App\BaseURL;
 use Friendica\Content\Nav;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
 use Friendica\Module\BaseNotifications;
-use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
+use Friendica\Module\Response;
+use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Prints all notification types except introduction:
@@ -38,18 +42,14 @@ use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
  */
 class Notifications extends BaseNotifications
 {
-       /** @var \Friendica\Navigation\Notifications\Factory\FormattedNotification */
-       protected $formattedNotificationFactory;
+       /** @var \Friendica\Navigation\Notifications\Factory\FormattedNotify */
+       protected $formattedNotifyFactory;
 
-       /** @var BaseURL */
-       protected $baseUrl;
-
-       public function __construct(BaseURL $baseUrl, \Friendica\Navigation\Notifications\Factory\FormattedNotification $formattedNotificationFactory, Arguments $args, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, \Friendica\Navigation\Notifications\Factory\FormattedNotify $formattedNotifyFactory, IHandleUserSessions $userSession, array $server, array $parameters = [])
        {
-               parent::__construct($args, $l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $userSession, $server, $parameters);
 
-               $this->formattedNotificationFactory = $formattedNotificationFactory;
-               $this->baseUrl                      = $baseUrl;
+               $this->formattedNotifyFactory = $formattedNotifyFactory;
        }
 
        /**
@@ -60,30 +60,30 @@ class Notifications extends BaseNotifications
                $notificationHeader = '';
                $notifications = [];
 
-               $factory = $this->formattedNotificationFactory;
+               $factory = $this->formattedNotifyFactory;
 
                if (($this->args->get(1) == 'network')) {
                        $notificationHeader = $this->t('Network Notifications');
                        $notifications      = [
-                               'ident'        => FormattedNotification::NETWORK,
+                               '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'        => FormattedNotification::SYSTEM,
+                               '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'        => FormattedNotification::PERSONAL,
+                               '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'        => FormattedNotification::HOME,
+                               'ident'        => FormattedNotify::HOME,
                                'notifications' => $factory->getHomeList($this->showAll, $this->firstItemNum, self::ITEMS_PER_PAGE),
                        ];
                } else {
@@ -96,7 +96,7 @@ class Notifications extends BaseNotifications
                ];
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                Nav::setSelected('notifications');
 
@@ -121,7 +121,7 @@ class Notifications extends BaseNotifications
                        ];
                        // Loop trough ever notification This creates an array with the output html for each
                        // notification and apply the correct template according to the notificationtype (label).
-                       /** @var FormattedNotification $Notification */
+                       /** @var FormattedNotify $Notification */
                        foreach ($notifications['notifications'] as $Notification) {
                                $notificationArray = $Notification->toArray();