]> git.mxchange.org Git - friendica.git/blobdiff - mod/apps.php
fix some method names (camelcase) in Probe.php and Lock.php
[friendica.git] / mod / apps.php
index 7a0a3f59ea1d62636a28bd7eb0bc90ac855c700c..0c0df76544ed6ca2a3fb97e05653bef278593a45 100644 (file)
@@ -1,15 +1,25 @@
 <?php
 
+use Friendica\App;
 
-function apps_content(&$a) {
+function apps_content(App $a) {
+       $privateaddons = get_config('config', 'private_addons');
+       if ($privateaddons === "1") {
+               if (! local_user()) {
+                       info(t('You must be logged in to use addons. '));
+                       return;
+               };
+       }
 
-       $o .= '<h3>' . t('Applications') . '</h3>';
+       $title = t('Applications');
 
-       if($a->apps)
-               $o .= $a->apps;
-       else
-               notice( t('No installed applications.') . EOL);
+       if (count($a->apps) == 0) {
+               notice(t('No installed applications.') . EOL);
+       }
 
-       return $o;
-
-}
\ No newline at end of file
+       $tpl = get_markup_template('apps.tpl');
+       return replace_macros($tpl, array(
+               '$title' => $title,
+               '$apps' => $a->apps,
+       ));
+}