diff options
author | git-marijus <mario@mariovavti.com> | 2017-07-25 20:06:01 +0200 |
---|---|---|
committer | git-marijus <mario@mariovavti.com> | 2017-07-25 20:06:01 +0200 |
commit | 5cc8837fb6605d18f09693e4ca418b8a5d38f57b (patch) | |
tree | 55d219166b2bf24bc12f8e747fec58b85afa992d | |
parent | 72ed290ccd63d8cc92d50ed8239159a2f3fa307a (diff) | |
download | volse-hubzilla-5cc8837fb6605d18f09693e4ca418b8a5d38f57b.tar.gz volse-hubzilla-5cc8837fb6605d18f09693e4ca418b8a5d38f57b.tar.bz2 volse-hubzilla-5cc8837fb6605d18f09693e4ca418b8a5d38f57b.zip |
make local channel (not our own) nav menus appear similar to what we are used from remote channels
-rw-r--r-- | include/nav.php | 17 | ||||
-rwxr-xr-x | view/tpl/nav.tpl | 11 |
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> |