X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FBaseNotifications.php;h=a6a2ea8d1e8eeecc69128a7933b4d0aa4c23579d;hb=3bca4fe2a64671d09e08346456cdfa6c12f996e9;hp=bea0147dd9c11c510dd6c709990f5708c818130b;hpb=8bdd90066f82a7ff1be36be3c6c3b49800a078c8;p=friendica.git diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php index bea0147dd9..a6a2ea8d1e 100644 --- a/src/Module/BaseNotifications.php +++ b/src/Module/BaseNotifications.php @@ -1,6 +1,6 @@ 'network', - FormattedNotification::SYSTEM => 'system', - FormattedNotification::HOME => 'home', - FormattedNotification::PERSONAL => 'personal', - FormattedNotification::INTRO => 'intros', + FormattedNotify::NETWORK => 'network', + FormattedNotify::SYSTEM => 'system', + FormattedNotify::HOME => 'home', + FormattedNotify::PERSONAL => 'personal', + FormattedNotify::INTRO => 'intros', ]; /** @var array Array of the allowed notifications and their printable name */ const PRINT_TYPES = [ - FormattedNotification::NETWORK => 'Network', - FormattedNotification::SYSTEM => 'System', - FormattedNotification::HOME => 'Home', - FormattedNotification::PERSONAL => 'Personal', - FormattedNotification::INTRO => 'Introductions', + FormattedNotify::NETWORK => 'Network', + FormattedNotify::SYSTEM => 'System', + FormattedNotify::HOME => 'Home', + FormattedNotify::PERSONAL => 'Personal', + FormattedNotify::INTRO => 'Introductions', ]; /** @var array The array of access keys for notification pages */ const ACCESS_KEYS = [ - FormattedNotification::NETWORK => 'w', - FormattedNotification::SYSTEM => 'y', - FormattedNotification::HOME => 'h', - FormattedNotification::PERSONAL => 'r', - FormattedNotification::INTRO => 'i', + FormattedNotify::NETWORK => 'w', + FormattedNotify::SYSTEM => 'y', + FormattedNotify::HOME => 'h', + FormattedNotify::PERSONAL => 'r', + FormattedNotify::INTRO => 'i', ]; /** @var int The default count of items per page */ @@ -89,11 +90,11 @@ abstract class BaseNotifications extends BaseModule */ abstract public function getNotifications(); - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = []) + public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = []) { - parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters); + parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); - if (!local_user()) { + if (!$session->getLocalUserId()) { throw new ForbiddenException($this->t('Permission denied.')); } @@ -120,7 +121,7 @@ abstract class BaseNotifications extends BaseModule 'page' => $pager->getPage(), ]; - System::jsonExit($notifications); + $this->jsonExit($notifications); } /** @@ -157,7 +158,7 @@ abstract class BaseNotifications extends BaseModule /** * List of pages for the Notifications TabBar * - * @return array with with notifications TabBar data + * @return array with notifications TabBar data * @throws Exception */ private function getTabs()