aboutsummaryrefslogtreecommitdiffstats
path: root/include/apps.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-15 19:54:37 -0700
committerfriendica <info@friendica.com>2014-05-15 19:54:37 -0700
commit077b97eac46989cfc7aadc14f3c4974fb31473b3 (patch)
tree4258c4f67d84c618558f821dcbe6e87e12600c8c /include/apps.php
parent99d97170deb1d2b04e649b8f7a3170145ff2a19d (diff)
downloadvolse-hubzilla-077b97eac46989cfc7aadc14f3c4974fb31473b3.tar.gz
volse-hubzilla-077b97eac46989cfc7aadc14f3c4974fb31473b3.tar.bz2
volse-hubzilla-077b97eac46989cfc7aadc14f3c4974fb31473b3.zip
the app menu takes form
Diffstat (limited to 'include/apps.php')
-rw-r--r--include/apps.php46
1 files changed, 43 insertions, 3 deletions
diff --git a/include/apps.php b/include/apps.php
index 244c2adb7..f6c09d803 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -46,10 +46,9 @@ function parse_app_description($f) {
//future expansion
- $observer = get_observer();
+ $observer = get_app()->get_observer();
-
$lines = @file($f);
if($lines) {
foreach($lines as $x) {
@@ -62,5 +61,46 @@ function parse_app_description($f) {
if(! $ret['photo'])
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
- return $ret;
+
+ foreach($ret as $k => $v) {
+ if(strpos($v,'http') === 0)
+ $ret[$k] = zid($v);
+ }
+
+ if(array_key_exists('requires',$ret)) {
+ $require = trim(strtolower($ret['requires']));
+ switch($require) {
+ case 'local_user':
+ if(! local_user())
+ unset($ret);
+ break;
+ case 'observer':
+ if(! $observer)
+ unset($ret);
+ break;
+ default:
+ if(! local_user() && feature_enabled(local_user(),$require))
+ unset($ret);
+ break;
+
+ }
+ logger('require: ' . print_r($ret,true));
+ }
+ if($ret) {
+ translate_system_apps($ret);
+ return $ret;
+ }
+ return false;
}
+
+
+function translate_system_apps(&$arr) {
+ $apps = array( 'Matrix' => t('Matrix'), 'Channel Home' => t('Channel Home'), 'Profile' => t('Profile'),
+ 'Photos' => t('Photos')
+
+ );
+
+ if(array_key_exists($arr['name'],$apps))
+ $arr['name'] = $apps[$arr['name']];
+
+} \ No newline at end of file