aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-10-17 09:43:36 +1100
committerRedMatrix <info@friendica.com>2014-10-17 09:43:36 +1100
commit8391e8b1a179b9bda9198e0eb54171b4b88eb5f0 (patch)
tree80f107ca73a484c7dfad72432cda5b6b0d1e3460
parentf290c4b1e4c13389bacfd736772ce40fe1961f08 (diff)
parente425def2a2d81dc39e113a343eeab51764ce1163 (diff)
downloadvolse-hubzilla-8391e8b1a179b9bda9198e0eb54171b4b88eb5f0.tar.gz
volse-hubzilla-8391e8b1a179b9bda9198e0eb54171b4b88eb5f0.tar.bz2
volse-hubzilla-8391e8b1a179b9bda9198e0eb54171b4b88eb5f0.zip
Merge pull request #645 from pafcu/master
Turn login button into a menu
-rw-r--r--include/nav.php11
-rwxr-xr-xview/tpl/nav.tpl15
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}}