]> git.mxchange.org Git - friendica.git/blob - mod/apps.php
Docs: add a note on adding `use` on theme.php
[friendica.git] / mod / apps.php
1 <?php
2 /**
3  * @file mod/apps.php
4  */
5 use Friendica\App;
6 use Friendica\Core\Config;
7 use Friendica\Core\L10n;
8
9 function apps_content(App $a)
10 {
11         $privateaddons = Config::get('config', 'private_addons');
12         if ($privateaddons === "1") {
13                 if (! local_user()) {
14                         info(L10n::t('You must be logged in to use addons. '));
15                         return;
16                 };
17         }
18
19         $title = L10n::t('Applications');
20
21         if (count($a->apps) == 0) {
22                 notice(L10n::t('No installed applications.') . EOL);
23         }
24
25         $tpl = get_markup_template('apps.tpl');
26         return replace_macros($tpl, [
27                 '$title' => $title,
28                 '$apps' => $a->apps,
29         ]);
30 }