aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/nav.php17
-rwxr-xr-xview/tpl/nav.tpl11
2 files changed, 14 insertions, 14 deletions
diff --git a/include/nav.php b/include/nav.php
index f6c8aa23f..4cb2e7fa6 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -42,7 +42,7 @@ EOT;
$observer = App::get_observer();
require_once('include/conversation.php');
- $is_owner = (((local_channel()) && (App::$profile['profile_uid'] == local_channel())) ? true : false);
+ $is_owner = (((local_channel()) && ((App::$profile_uid == local_channel()) || (App::$profile_uid == 0))) ? true : false);
$channel_apps[] = channel_apps($is_owner, App::$profile['channel_address']);
$myident = (($channel) ? $channel['xchan_addr'] : '');
@@ -93,8 +93,6 @@ EOT;
if(local_channel()) {
-
-
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select'))
$nav['channels'] = $chans;
@@ -134,12 +132,12 @@ EOT;
$homelink = (($observer) ? $observer['xchan_url'] : '');
}
- if(! local_channel()) {
+ if(! $is_owner) {
$nav['rusermenu'] = array(
$homelink,
t('Take me home'),
'logout',
- t('Log me out of this site')
+ ((local_channel()) ? t('Logout') : t('Log me out of this site'))
);
}
@@ -170,7 +168,6 @@ EOT;
if(local_channel()) {
-
$nav['network'] = array('network', t('Grid'), "", t('Your grid'),'network_nav_btn');
$nav['network']['all'] = [ 'network', t('View your network/grid'), '','' ];
$nav['network']['mark'] = array('', t('Mark all grid notifications seen'), '','');
@@ -221,7 +218,7 @@ EOT;
$powered_by = '';
//app bin
- if(local_channel()) {
+ if($is_owner) {
if(get_pconfig(local_channel(), 'system','initial_import_system_apps') === false) {
Zlib\Apps::import_system_apps();
set_pconfig(local_channel(), 'system','initial_import_system_apps', 1);
@@ -245,7 +242,10 @@ EOT;
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
foreach($syslist as $app) {
- $nav_apps[] = Zlib\Apps::app_render($app,'nav');
+ if($is_owner)
+ $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');
}
$tpl = get_markup_template('nav.tpl');
@@ -259,6 +259,7 @@ EOT;
'$emptynotifications' => t('Loading...'),
'$userinfo' => $x['usermenu'],
'$localuser' => local_channel(),
+ '$is_owner' => $is_owner,
'$sel' => App::$nav_sel,
'$powered_by' => $powered_by,
'$help' => t('@name, #tag, ?doc, content'),
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 288a15f2c..c0b34bbe8 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -16,7 +16,7 @@
<img id="avatar" src="{{$userinfo.icon}}" alt="{{$userinfo.name}}">
<i class="fa fa-caret-down"></i>
</div>
- {{if $localuser}}
+ {{if $is_owner}}
<div class="dropdown-menu">
{{foreach $nav.usermenu as $usermenu}}
<a class="dropdown-item{{if $usermenu.2}} active{{/if}}" href="{{$usermenu.0}}" title="{{$usermenu.3}}" role="menuitem" id="{{$usermenu.4}}">{{$usermenu.1}}</a>
@@ -45,14 +45,13 @@
<a class="dropdown-item" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" role="menuitem" id="{{$nav.logout.4}}">{{$nav.logout.1}}</a>
{{/if}}
</div>
- {{else}}
- {{if $nav.rusermenu}}
+ {{/if}}
+ {{if ! $is_owner}}
<div class="dropdown-menu" role="menu" aria-labelledby="avatar">
<a class="dropdown-item" href="{{$nav.rusermenu.0}}" role="menuitem">{{$nav.rusermenu.1}}</a>
<a class="dropdown-item" href="{{$nav.rusermenu.2}}" role="menuitem">{{$nav.rusermenu.3}}</a>
</div>
{{/if}}
- {{/if}}
</div>
{{/if}}
<div class="navbar-toggler-right">
@@ -204,7 +203,7 @@
{{if $channel_apps.0}}
</div>
{{/if}}
- {{if $localuser}}
+ {{if $is_owner}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
<a class="dropdown-item" href="/apporder"><i class="generic-icons-nav fa fa-fw fa-sort"></i>{{$orderapps}}</a>
@@ -230,7 +229,7 @@
{{if $channel_apps.0}}
</div>
{{/if}}
- {{if $localuser}}
+ {{if $is_owner}}
<div class="dropdown-divider"></div>
<a class="nav-link" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
<a class="nav-link" href="/apporder"><i class="generic-icons-nav fa fa-fw fa-sort"></i>{{$orderapps}}</a>