X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fapps.php;h=a220afff1cadcad109d520239030bea47c33e7e2;hb=391c5913227c7f62f19b4f08906b0b1b0b618b33;hp=f25722df785ac6942353c74579ba5fc14a967cce;hpb=dea721a3f866956e0d0b86316679e05498b1d81c;p=friendica.git diff --git a/mod/apps.php b/mod/apps.php index f25722df78..a220afff1c 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -1,25 +1,26 @@ ' . t('Applications') . ''; - - $apps = false; - - if(local_user()) { - $apps = true; - $o .= '
'; +use Friendica\App; +use Friendica\Core\Config; + +function apps_content(App $a) { + $privateaddons = Config::get('config', 'private_addons'); + if ($privateaddons === "1") { + if (! local_user()) { + info(t('You must be logged in to use addons. ')); + return; + }; } - if($a->apps) { - $apps = true; - $o .= $a->apps; - } - - if(! $apps) - notice( t('No installed applications.') . EOL); + $title = t('Applications'); - return $o; + if (count($a->apps) == 0) { + notice(t('No installed applications.') . EOL); + } -} \ No newline at end of file + $tpl = get_markup_template('apps.tpl'); + return replace_macros($tpl, [ + '$title' => $title, + '$apps' => $a->apps, + ]); +}