From 57e3ee47ee02002239bab1cde5b68f741e6f0c08 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 12 Sep 2018 20:52:55 +0200 Subject: more feature to app transition --- include/nav.php | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'include/nav.php') diff --git a/include/nav.php b/include/nav.php index 56fe9b901..7520fd782 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,11 +1,11 @@ $item]; - Zlib\Apps::translate_system_apps($item); + Apps::translate_system_apps($item); App::$nav_sel['name'] = $item['name']; } - - function channel_apps($is_owner = false, $nickname = null) { // Don't provide any channel apps if we're running as the sys channel @@ -420,7 +418,7 @@ function channel_apps($is_owner = false, $nickname = null) { if ($p['chat'] && feature_enabled($uid,'ajaxchat')) { - $has_chats = ZLib\Chatroom::list_count($uid); + $has_chats = Chatroom::list_count($uid); if ($has_chats) { $tabs[] = [ 'label' => t('Chatrooms'), @@ -445,7 +443,7 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if($p['view_pages'] && feature_enabled($uid,'cards')) { + if($p['view_pages'] && Apps::system_app_installed($uid, 'Cards')) { $tabs[] = [ 'label' => t('Cards'), 'url' => z_root() . '/cards/' . $nickname , @@ -456,7 +454,7 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if($p['view_pages'] && feature_enabled($uid,'articles')) { + if($p['view_pages'] && Apps::system_app_installed($uid, 'Articles')) { $tabs[] = [ 'label' => t('Articles'), 'url' => z_root() . '/articles/' . $nickname , @@ -468,7 +466,7 @@ function channel_apps($is_owner = false, $nickname = null) { } - if($has_webpages && feature_enabled($uid,'webpages')) { + if($has_webpages && Apps::system_app_installed($uid, 'Webpages')) { $tabs[] = [ 'label' => t('Webpages'), 'url' => z_root() . '/page/' . $nickname . '/home', @@ -480,17 +478,15 @@ function channel_apps($is_owner = false, $nickname = null) { } - if ($p['view_wiki']) { - if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) { - $tabs[] = [ - 'label' => t('Wikis'), - 'url' => z_root() . '/wiki/' . $nickname, - 'sel' => ((argv(0) == 'wiki') ? 'active' : ''), - 'title' => t('Wiki'), - 'id' => 'wiki-tab', - 'icon' => 'pencil-square-o' - ]; - } + if ($p['view_wiki'] && Apps::system_app_installed($uid, 'Wiki')) { + $tabs[] = [ + 'label' => t('Wikis'), + 'url' => z_root() . '/wiki/' . $nickname, + 'sel' => ((argv(0) == 'wiki') ? 'active' : ''), + 'title' => t('Wiki'), + 'id' => 'wiki-tab', + 'icon' => 'pencil-square-o' + ]; } $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs); -- cgit v1.2.3