]> git.mxchange.org Git - friendica.git/blob - src/Module/Apps.php
a23ac0a77b939d70b1beac6af7f1f6c7c3ef8e7d
[friendica.git] / src / Module / Apps.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\Content\Nav;
7 use Friendica\Core\Config;
8 use Friendica\Core\L10n;
9 use Friendica\Core\Renderer;
10
11 /**
12  * Shows the App menu
13  */
14 class Apps extends BaseModule
15 {
16         public static function init()
17         {
18                 $privateaddons = Config::get('config', 'private_addons');
19                 if ($privateaddons === "1") {
20                         if (!local_user()) {
21                                 self::getApp()->internalRedirect();
22                         };
23                 }
24         }
25
26         public static function content()
27         {
28                 $apps = Nav::getAppMenu();
29
30                 if (count($apps) == 0) {
31                         notice(L10n::t('No installed applications.') . EOL);
32                 }
33
34                 $tpl = Renderer::getMarkupTemplate('apps.tpl');
35                 return Renderer::replaceMacros($tpl, [
36                         '$title' => L10n::t('Applications'),
37                         '$apps'  => $apps,
38                 ]);
39         }
40 }