diff options
author | git-marijus <mario@mariovavti.com> | 2017-08-06 23:20:24 +0200 |
---|---|---|
committer | git-marijus <mario@mariovavti.com> | 2017-08-06 23:20:24 +0200 |
commit | 1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84 (patch) | |
tree | 47ded7bd82679639d6a52e50114ce1975765f810 /Zotlabs/Lib | |
parent | b0d1fa09c1f64ad435202e93d0d23cb1cc112b60 (diff) | |
download | volse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.tar.gz volse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.tar.bz2 volse-hubzilla-1c0c01ccfe918d0d5eea8fcbba6d5a59d1ab5c84.zip |
make config requirements in apps more universal - provide key and value
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Apps.php | 10 |
1 files changed, 4 insertions, 6 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) |