X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FApps.php;h=ecc7b3ac62aa526a526ed4d76f9a4e2b4046fe1f;hb=3bca4fe2a64671d09e08346456cdfa6c12f996e9;hp=04c7d7b6acd03b43770395ee06357b4399e4e149;hpb=2c56d2f3360c08e312e5c167261af8e5d4b87af4;p=friendica.git diff --git a/src/Module/Apps.php b/src/Module/Apps.php index 04c7d7b6ac..ecc7b3ac62 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -1,6 +1,6 @@ get('config', 'private_addons'); - if ($privateaddons === "1" && !local_user()) { - DI::baseUrl()->redirect(); + parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); + + $this->nav = $nav; + $this->systemMessages = $systemMessages; + + $privateaddons = $config->get('config', 'private_addons'); + if ($privateaddons === "1" && !$session->getLocalUserId()) { + $baseUrl->redirect(); } } - public static function content(array $parameters = []) + protected function content(array $request = []): string { - $apps = Nav::getAppMenu(); - + $apps = $this->nav->getAppMenu(); if (count($apps) == 0) { - notice(DI::l10n()->t('No installed applications.') . EOL); + $this->systemMessages->addNotice($this->t('No installed applications.')); } $tpl = Renderer::getMarkupTemplate('apps.tpl'); return Renderer::replaceMacros($tpl, [ - '$title' => DI::l10n()->t('Applications'), + '$title' => $this->t('Applications'), '$apps' => $apps, ]); }