diff options
author | Stefan Parviainen <saparvia@caterva.eu> | 2014-10-16 17:21:37 +0200 |
---|---|---|
committer | Stefan Parviainen <saparvia@caterva.eu> | 2014-10-16 17:21:37 +0200 |
commit | 6867a8a7f6060c82cba3a34cd944a3737e8e263e (patch) | |
tree | 5028e552c199e6245bf9190fa1fdab2498947467 | |
parent | aa0aa22b8ad5db1589331e985e82781949985269 (diff) | |
download | volse-hubzilla-6867a8a7f6060c82cba3a34cd944a3737e8e263e.tar.gz volse-hubzilla-6867a8a7f6060c82cba3a34cd944a3737e8e263e.tar.bz2 volse-hubzilla-6867a8a7f6060c82cba3a34cd944a3737e8e263e.zip |
Login menu
-rw-r--r-- | include/nav.php | 11 | ||||
-rwxr-xr-x | view/tpl/nav.tpl | 15 |
2 files changed, 13 insertions, 13 deletions
diff --git a/include/nav.php b/include/nav.php index 4f7d609aa..ba817648b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -84,6 +84,7 @@ EOT; $nav['usermenu']=array(); $userinfo = null; + $nav['loginmenu']=array(); if(local_user()) { @@ -120,8 +121,9 @@ EOT; $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages')); } else { - if(! get_account_id()) - $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in')); + if(! get_account_id()) { + $nav['loginmenu'][] = Array('login',t('Login'),'',t('Sign in')); + } else $nav['alogout'] = Array('logout',t('Logout'), "", t('End this session')); @@ -136,14 +138,11 @@ EOT; } if($observer) { - $nav['locked'] = true; $nav['lock'] = array('logout','','lock', sprintf( t('%s - click to logout'), $observer['xchan_addr'])); } else { - $nav['locked'] = false; - $nav['lock'] = array('rmagic','','unlock', - t('Click to authenticate to your home hub')); + $nav['loginmenu'][] = Array('rmagic',t('Remote login'),'',t('Click to authenticate to your home hub')); } /** diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 6c461f062..ac6cb1a9c 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -48,14 +48,15 @@ <div class="collapse navbar-collapse" id="navbar-collapse-1"> <ul class="nav navbar-nav navbar-left"> {{if !$userinfo}} - {{if $nav.lock}} - <li> - <a title="{{$nav.lock.3}}" href="{{$nav.lock.0}}"><i class="{{if $nav.locked}}icon-lock{{else}}icon-unlock{{/if}}"></i></a> - </li> - {{/if}} + {{if $nav.loginmenu}} + <li class="{{$nav.loginmenu.0.2}}"><a data-toggle="dropdown" data-target="#" href="{{$nav.loginmenu.0.0}}" title="{{$nav.loginmenu.0.3}}" >{{$nav.loginmenu.0.1}} <span class="caret" id="usermenu-caret"></span></a> + <ul class="dropdown-menu" role="menu"> + {{foreach $nav.loginmenu as $loginmenu}} + <li role="presentation"><a class="{{$loginmenu.2}}" href="{{$loginmenu.0}}" title="{{$loginmenu.3}}" role="menuitem">{{$loginmenu.1}}</a></li> + {{/foreach}} + </ul></li> + {{/if}} {{/if}} - - {{if $nav.login}}<li class="{{$nav.login.2}}"><a href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a><li>{{/if}} {{if $nav.alogout}}<li class="{{$nav}}-alogout.2"><a href="{{$nav.alogout.0}}" title="{{$nav.alogout.3}}" >{{$nav.alogout.1}}</a></li>{{/if}} |