aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-08-06 23:20:24 +0200
committergit-marijus <mario@mariovavti.com>2017-08-06 23:20:24 +0200
commit1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84 (patch)
tree47ded7bd82679639d6a52e50114ce1975765f810
parentb0d1fa09c1f64ad435202e93d0d23cb1cc112b60 (diff)
downloadvolse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.tar.gz
volse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.tar.bz2
volse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.zip
make config requirements in apps more universal - provide key and value
-rw-r--r--Zotlabs/Lib/Apps.php10
-rw-r--r--app/pubstream.apd4
2 files changed, 6 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 1fb841008..3730f3a23 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -174,10 +174,9 @@ class Apps {
if(substr($require, 0, 7) == 'config:') {
$config = true;
$require = ltrim($require, 'config:');
+ $require = explode('=', $require);
}
- $toggle = (($require[0] == '!') ? 0 : 1);
-
switch($require) {
case 'nologin':
if(local_channel())
@@ -201,7 +200,7 @@ class Apps {
break;
default:
if($config)
- $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+ $unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
else
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
if($unset)
@@ -325,10 +324,9 @@ class Apps {
if(substr($require, 0, 7) == 'config:') {
$config = true;
$require = ltrim($require, 'config:');
+ $require = explode('=', $require);
}
- $toggle = (($require[0] == '!') ? 0 : 1);
-
switch($require) {
case 'nologin':
if(local_channel())
@@ -353,7 +351,7 @@ class Apps {
break;
default:
if($config)
- $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true);
+ $unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
else
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
if($unset)
diff --git a/app/pubstream.apd b/app/pubstream.apd
index 874e0a6cc..ebfcf38b0 100644
--- a/app/pubstream.apd
+++ b/app/pubstream.apd
@@ -1,6 +1,6 @@
-version: 1
+version: 2
url: $baseurl/pubstream
-requires: config:!disable_discover_tab
+requires: config:disable_discover_tab=0
name: Public Stream
photo: icon:globe
categories: Social