diff options
-rw-r--r-- | Zotlabs/Module/Group.php | 29 | ||||
-rw-r--r-- | Zotlabs/Widget/Activity_filter.php | 4 | ||||
-rw-r--r-- | include/features.php | 9 | ||||
-rw-r--r-- | include/group.php | 2 | ||||
-rw-r--r-- | include/nav.php | 2 |
5 files changed, 29 insertions, 17 deletions
diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index acebe995d..bf0edb1ed 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -1,11 +1,13 @@ <?php namespace Zotlabs\Module; -require_once('include/group.php'); - +use App; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\Apps; +require_once('include/group.php'); -class Group extends \Zotlabs\Web\Controller { +class Group extends Controller { function init() { if(! local_channel()) { @@ -13,7 +15,11 @@ class Group extends \Zotlabs\Web\Controller { return; } - \App::$profile_uid = local_channel(); + if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) { + return; + } + + App::$profile_uid = local_channel(); nav_set_selected('Privacy Groups'); } @@ -24,6 +30,10 @@ class Group extends \Zotlabs\Web\Controller { notice( t('Permission denied.') . EOL); return; } + + if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) { + return; + } if((argc() == 2) && (argv(1) === 'new')) { check_form_security_token_redirectOnErr('/group/new', 'group_edit'); @@ -77,13 +87,22 @@ class Group extends \Zotlabs\Web\Controller { $change = false; - logger('mod_group: ' . \App::$cmd,LOGGER_DEBUG); + logger('mod_group: ' . App::$cmd,LOGGER_DEBUG); if(! local_channel()) { notice( t('Permission denied') . EOL); return; } + if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '<b>Privacy Groups App (Not Installed):</b><br>'; + $o .= t('Management of privacy groups'); + return $o; + } + // Switch to text mode interface if we have more than 'n' contacts or group members $switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit'); if($switchtotext === false) diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index d725f8b55..912bfce49 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -2,6 +2,8 @@ namespace Zotlabs\Widget; +use Zotlabs\Lib\Apps; + class Activity_filter { function widget($arr) { @@ -44,7 +46,7 @@ class Activity_filter { ]; } - if(feature_enabled(local_channel(),'groups')) { + if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) { $groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); diff --git a/include/features.php b/include/features.php index 12b0ed787..0da6a9725 100644 --- a/include/features.php +++ b/include/features.php @@ -75,15 +75,6 @@ function get_features($filtered = true, $level = (-1)) { t('Access Control and Permissions'), [ - 'groups', - t('Privacy Groups'), - t('Enable management and selection of privacy groups'), - true, - get_config('feature_lock','groups'), - feature_level('groups',0), - ], - - [ 'permcats', t('Permission Categories'), t('Create custom connection permission limits'), diff --git a/include/group.php b/include/group.php index 56bf210ff..79d70aca4 100644 --- a/include/group.php +++ b/include/group.php @@ -274,7 +274,7 @@ function group_side($every="connections",$each="group",$edit = false, $group_id $o = ''; - if(! (local_channel() && feature_enabled(local_channel(),'groups'))) { + if(! (local_channel() && \Zotlabs\Lib\Apps::system_app_installed(local_channel(), 'Privacy Groups'))) { return ''; } diff --git a/include/nav.php b/include/nav.php index 1eef8dc07..988a07b7c 100644 --- a/include/nav.php +++ b/include/nav.php @@ -93,7 +93,7 @@ function nav($template = 'default') { if(! $_SESSION['delegate']) { $nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage your channels'),'manage_nav_btn'); } - if(feature_enabled(local_channel(),'groups')) + if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) $nav['group'] = array('group', t('Privacy Groups'),"", t('Manage your privacy groups'),'group_nav_btn'); $nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn'); |