X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fapps.php;h=85a3d9fe26cda9a87ad0dd790cdf921265f71fa6;hb=3e797547a37f8c8f22e88965b4a4d278bcc192e0;hp=199ce0f9188021b27e93d99391d5e2d9103d5774;hpb=61a01141d7e897c30b5931b66675cbb09d6368b8;p=friendica.git diff --git a/mod/apps.php b/mod/apps.php index 199ce0f918..85a3d9fe26 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,25 +1,30 @@ apps)==0) - notice( t('No installed applications.') . EOL); - - - $tpl = get_markup_template("apps.tpl"); - return replace_macros($tpl, array( +/** + * @file mod/apps.php + */ +use Friendica\App; +use Friendica\Core\Config; +use Friendica\Core\L10n; + +function apps_content(App $a) +{ + $privateaddons = Config::get('config', 'private_addons'); + if ($privateaddons === "1") { + if (! local_user()) { + info(L10n::t('You must be logged in to use addons. ')); + return; + }; + } + + $title = L10n::t('Applications'); + + if (count($a->apps) == 0) { + notice(L10n::t('No installed applications.') . EOL); + } + + $tpl = get_markup_template('apps.tpl'); + return replace_macros($tpl, [ '$title' => $title, '$apps' => $a->apps, - )); - - - + ]); }