diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-08-01 11:41:25 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-08-01 11:41:25 +0200 |
commit | a510c91d48bb26f7653e031b9e2ca05127054f75 (patch) | |
tree | e1c12c4d39b8404d0d5870c57ebd91540fd2a37f /Zotlabs/Lib/Apps.php | |
parent | 10e459140b46df52d2f8e46edf60d2d0369871db (diff) | |
parent | 2f8c5cf7d09f7d079671785574b588bc21c373cd (diff) | |
download | volse-hubzilla-a510c91d48bb26f7653e031b9e2ca05127054f75.tar.gz volse-hubzilla-a510c91d48bb26f7653e031b9e2ca05127054f75.tar.bz2 volse-hubzilla-a510c91d48bb26f7653e031b9e2ca05127054f75.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'Zotlabs/Lib/Apps.php')
-rw-r--r-- | Zotlabs/Lib/Apps.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 7287bdd52..1fb841008 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -169,7 +169,15 @@ class Apps { $requires = explode(',',$ret['requires']); foreach($requires as $require) { $require = trim(strtolower($require)); + $config = false; + + if(substr($require, 0, 7) == 'config:') { + $config = true; + $require = ltrim($require, 'config:'); + } + $toggle = (($require[0] == '!') ? 0 : 1); + switch($require) { case 'nologin': if(local_channel()) @@ -192,9 +200,10 @@ class Apps { unset($ret); break; default: - $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true); - $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true); - + if($config) + $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true); + else + $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true); if($unset) unset($ret); break; @@ -308,9 +317,18 @@ class Apps { if($k === 'requires') { $requires = explode(',',$v); + foreach($requires as $require) { $require = trim(strtolower($require)); + $config = false; + + if(substr($require, 0, 7) == 'config:') { + $config = true; + $require = ltrim($require, 'config:'); + } + $toggle = (($require[0] == '!') ? 0 : 1); + switch($require) { case 'nologin': if(local_channel()) @@ -334,9 +352,10 @@ class Apps { return ''; break; default: - $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true); - $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true); - + if($config) + $unset = ((get_config('system', ltrim($require, '!')) == $toggle) ? false : true); + else + $unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true); if($unset) return ''; break; |