aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-31 02:24:49 +0200
committergit-marijus <mario@mariovavti.com>2017-07-31 02:24:49 +0200
commitb4efe8ad8d91c70bf869259e6764e7e4a079563b (patch)
tree791afacf52710049ffc3b37f7ba2d571663d8ecb
parent35c05a318016e3269e4bc677a36b515833fab66e (diff)
downloadvolse-hubzilla-b4efe8ad8d91c70bf869259e6764e7e4a079563b.tar.gz
volse-hubzilla-b4efe8ad8d91c70bf869259e6764e7e4a079563b.tar.bz2
volse-hubzilla-b4efe8ad8d91c70bf869259e6764e7e4a079563b.zip
implement system configs as app requirement and add the pubstream app
-rw-r--r--Zotlabs/Lib/Apps.php14
-rw-r--r--app/pubstream.apd6
2 files changed, 16 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 68587df49..7287bdd52 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -169,6 +169,7 @@ class Apps {
$requires = explode(',',$ret['requires']);
foreach($requires as $require) {
$require = trim(strtolower($require));
+ $toggle = (($require[0] == '!') ? 0 : 1);
switch($require) {
case 'nologin':
if(local_channel())
@@ -191,10 +192,12 @@ class Apps {
unset($ret);
break;
default:
- if(! (local_channel() && feature_enabled(local_channel(),$require)))
+ $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
+ $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+
+ if($unset)
unset($ret);
break;
-
}
}
}
@@ -307,6 +310,7 @@ class Apps {
$requires = explode(',',$v);
foreach($requires as $require) {
$require = trim(strtolower($require));
+ $toggle = (($require[0] == '!') ? 0 : 1);
switch($require) {
case 'nologin':
if(local_channel())
@@ -330,10 +334,12 @@ class Apps {
return '';
break;
default:
- if(! (local_channel() && feature_enabled(local_channel(),$require)))
+ $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
+ $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+
+ if($unset)
return '';
break;
-
}
}
}
diff --git a/app/pubstream.apd b/app/pubstream.apd
new file mode 100644
index 000000000..065be24bc
--- /dev/null
+++ b/app/pubstream.apd
@@ -0,0 +1,6 @@
+version: 1
+url: $baseurl/pubstream
+requires: !disable_discover_tab
+name: Public Stream
+photo: icon:globe
+categories: Social