aboutsummaryrefslogtreecommitdiffstats
path: root/include/nav.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/nav.php')
-rw-r--r--include/nav.php44
1 files changed, 33 insertions, 11 deletions
diff --git a/include/nav.php b/include/nav.php
index 6b98a807d..8566cc58c 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -73,6 +73,11 @@ EOT;
// nav links: array of array('href', 'text', 'extra css classes', 'title')
$nav = [];
+ $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
+
+ if(! $disable_discover_tab)
+ $nav['pubs'] = true;
+
/**
* Display login or logout
*/
@@ -171,13 +176,15 @@ EOT;
}
-
- $homelink = get_my_url();
- if(! $homelink) {
+ $my_url = get_my_url();
+ if(! $my_url) {
$observer = App::get_observer();
- $homelink = (($observer) ? $observer['xchan_url'] : '');
+ $my_url = (($observer) ? $observer['xchan_url'] : '');
}
+ $homelink_arr = parse_url($my_url);
+ $homelink = $homelink_arr['scheme'] . '://' . $homelink_arr['host'];
+
if(! $is_owner) {
$nav['rusermenu'] = array(
$homelink,
@@ -253,7 +260,7 @@ EOT;
}
$syslist = array();
- $list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app');
+ $list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
@@ -274,16 +281,20 @@ EOT;
$app['active'] = true;
if($is_owner) {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav');
- if(strpos($app['categories'],'navbar_' . $template)) {
+ if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
}
+ else {
+ $nav_apps[] = Zlib\Apps::app_render($app,'nav');
+ }
}
elseif(! $is_owner && strpos($app['requires'], 'local_channel') === false) {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav');
- if(strpos($app['categories'],'navbar_' . $template)) {
+ if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'navbar');
}
+ else {
+ $nav_apps[] = Zlib\Apps::app_render($app,'nav');
+ }
}
}
@@ -304,7 +315,7 @@ EOT;
'$sitelocation' => $sitelocation,
'$nav' => $x['nav'],
'$banner' => $banner,
- '$emptynotifications' => t('Loading...'),
+ '$emptynotifications' => t('Loading'),
'$userinfo' => $x['usermenu'],
'$localuser' => local_channel(),
'$is_owner' => $is_owner,
@@ -314,7 +325,7 @@ EOT;
'$pleasewait' => t('Please wait...'),
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps,
- '$channel_menu' => get_config('system','channel_menu'),
+ '$channel_menu' => get_pconfig(App::$profile_uid,'system','channel_menu',get_config('system','channel_menu')),
'$channel_thumb' => ((App::$profile) ? App::$profile['thumb'] : ''),
'$channel_apps' => $channel_apps,
'$addapps' => t('Add Apps'),
@@ -487,6 +498,17 @@ function channel_apps($is_owner = false, $nickname = null) {
];
}
+ if($p['view_pages'] && feature_enabled($uid,'articles')) {
+ $tabs[] = [
+ 'label' => t('Articles'),
+ 'url' => z_root() . '/articles/' . $nickname ,
+ 'sel' => ((argv(0) == 'articles') ? 'active' : ''),
+ 'title' => t('View Articles'),
+ 'id' => 'articles-tab',
+ 'icon' => 'file-text-o'
+ ];
+ }
+
if($has_webpages && feature_enabled($uid,'webpages')) {
$tabs[] = [