X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FBaseNotifications.php;h=117530d2567fd1df738e82578e27268a4d8b0b3a;hb=f0743e4e128dfcb5d6305f4ed09e969573ba6b15;hp=0e39eb651df33cf6a6e36e66e04bddc26c826110;hpb=e9b3a9426aec2259f19ae3d7adb2f18dcfc7b5e1;p=friendica.git diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php index 0e39eb651d..117530d256 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 */ @@ -86,11 +90,11 @@ abstract class BaseNotifications extends BaseModule */ abstract public function getNotifications(); - public function __construct(Arguments $args, L10n $l10n, 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, $parameters); + parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); - if (!local_user()) { + if (!$session->getLocalUserId()) { throw new ForbiddenException($this->t('Permission denied.')); } @@ -98,11 +102,9 @@ abstract class BaseNotifications extends BaseModule $this->firstItemNum = ($page * self::ITEMS_PER_PAGE) - self::ITEMS_PER_PAGE; $this->showAll = ($_REQUEST['show'] ?? '') === 'all'; - - $this->args = $args; } - public function rawContent() + protected function rawContent(array $request = []) { // If the last argument of the query is NOT json, return if ($this->args->get($this->args->getArgc() - 1) !== 'json') { @@ -156,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()