aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/articles.apd4
-rw-r--r--app/webpages.apd4
-rw-r--r--app/wiki.apd4
-rw-r--r--include/nav.php56
4 files changed, 32 insertions, 36 deletions
diff --git a/app/articles.apd b/app/articles.apd
index 5a9f17e0f..00b3c4a3c 100644
--- a/app/articles.apd
+++ b/app/articles.apd
@@ -1,6 +1,6 @@
-version: 1.2
+version: 1.3
url: $baseurl/articles/$nick
name: Articles
-requires: local_channel, articles
+requires: local_channel
photo: icon:file-text-o
categories: nav_featured_app, Productivity
diff --git a/app/webpages.apd b/app/webpages.apd
index 46c6cdb5d..e98cc0794 100644
--- a/app/webpages.apd
+++ b/app/webpages.apd
@@ -1,6 +1,6 @@
-version: 1
+version: 1.1
url: $baseurl/webpages/$nick
-requires: local_channel, webpages
+requires: local_channel
name: Webpages
photo: icon:newspaper-o
categories: nav_featured_app, Productivity
diff --git a/app/wiki.apd b/app/wiki.apd
index 48fcbe0c1..56edfde20 100644
--- a/app/wiki.apd
+++ b/app/wiki.apd
@@ -1,6 +1,6 @@
-version: 1
+version: 1.1
url: $baseurl/wiki/$nick
-requires: local_channel, wiki
+requires: local_channel
name: Wiki
photo: icon:pencil-square-o
categories: nav_featured_app, Productivity
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 @@
<?php /** @file */
-use \Zotlabs\Lib as Zlib;
+use \Zotlabs\Lib\Apps;
+use \Zotlabs\Lib\Chatroom;
require_once('include/security.php');
require_once('include/menu.php');
-
function nav($template = 'default') {
/**
@@ -213,26 +213,26 @@ function nav($template = 'default') {
//app bin
if($is_owner) {
if(get_pconfig(local_channel(), 'system','import_system_apps') !== datetime_convert('UTC','UTC','now','Y-m-d')) {
- Zlib\Apps::import_system_apps();
+ Apps::import_system_apps();
set_pconfig(local_channel(), 'system','import_system_apps', datetime_convert('UTC','UTC','now','Y-m-d'));
}
$syslist = array();
- $list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
+ $list = Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
- $syslist[] = Zlib\Apps::app_encode($li);
+ $syslist[] = Apps::app_encode($li);
}
}
- Zlib\Apps::translate_system_apps($syslist);
+ Apps::translate_system_apps($syslist);
}
else {
- $syslist = Zlib\Apps::get_system_apps(true);
+ $syslist = Apps::get_system_apps(true);
}
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
- $syslist = Zlib\Apps::app_order(local_channel(),$syslist);
+ $syslist = Apps::app_order(local_channel(),$syslist);
foreach($syslist as $app) {
if(\App::$nav_sel['name'] == $app['name'])
@@ -240,18 +240,18 @@ function nav($template = 'default') {
if($is_owner) {
if(strpos($app['categories'],'nav_pinned_app') !== false) {
- $navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
+ $navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav');
+ $nav_apps[] = Apps::app_render($app,'nav');
}
}
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
if(strpos($app['categories'],'nav_pinned_app') !== false) {
- $navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
+ $navbar_apps[] = Apps::app_render($app,'navbar');
}
else {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav');
+ $nav_apps[] = Apps::app_render($app,'nav');
}
}
}
@@ -314,12 +314,10 @@ function nav($template = 'default') {
function nav_set_selected($item){
App::$nav_sel['raw_name'] = $item;
$item = ['name' => $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);