From b9256eed307d6fa07fcd55067e7278ac421d3b96 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 15:31:36 +0200 Subject: unclutter menues a little --- include/conversation.php | 25 +++++++++---------------- include/nav.php | 12 +++++++++--- view/tpl/nav.tpl | 7 +++++-- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 21ce3bb66..d78ee2710 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1517,25 +1517,18 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ require_once('include/chat.php'); $chats = chatroom_list($uid); - $subdued = ((count($chats)) ? '' : ' subdued'); - $tabs[] = array( - 'label' => t('Chatrooms'), - 'url' => $a->get_baseurl() . '/chat/' . $nickname, - 'sel' => ((argv(0) == 'chat') ? 'active' . $subdued : '' . $subdued), - 'title' => t('Chatrooms'), - 'id' => 'chat-tab', - ); - - - if($is_owner) { + if (count($chats)) { $tabs[] = array( - 'label' => t('Events'), - 'url' => $a->get_baseurl() . '/events', - 'sel' => ((argv(0) == 'events') ? 'active' : ''), - 'title' => t('Events and Calendar'), - 'id' => 'events-tab', + 'label' => t('Chatrooms'), + 'url' => $a->get_baseurl() . '/chat/' . $nickname, + 'sel' => ((argv(0) == 'chat') ? 'active' : '' ), + 'title' => t('Chatrooms'), + 'id' => 'chat-tab', ); + } + + if($is_owner) { $tabs[] = array( 'label' => t('Bookmarks'), 'url' => $a->get_baseurl() . '/bookmarks', diff --git a/include/nav.php b/include/nav.php index 2d0d43d5a..d1ee5da9a 100644 --- a/include/nav.php +++ b/include/nav.php @@ -73,6 +73,8 @@ EOT; $nav['usermenu']=array(); $userinfo = null; + + if(local_user()) { $nav['logout'] = Array('logout',t('Logout'), "", t('End this session')); @@ -83,8 +85,13 @@ EOT; $nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit profiles')); $nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos')); $nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files')); - $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms')); - $nav['usermenu'][] = Array('events', t('Events'), "", t('Your events')); + + require_once('include/chat.php'); + $chats = chatroom_list(local_user()); + if (count($chats)) { + $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms')); + } + $nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks')); if(feature_enabled($channel['channel_id'],'webpages')) $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages')); @@ -185,7 +192,6 @@ EOT; $nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings')); - $nav['contacts'] = array('connections', t('Connections'),"", t('Manage/Edit Friends and Connections')); } /** diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 6b76ff5b6..dd3f67f45 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -18,11 +18,14 @@ {{foreach $nav.usermenu as $usermenu}}
  • {{$usermenu.1}}
  • {{/foreach}} + {{if $nav.profiles}}
  • {{$nav.profiles.1}}
  • {{/if}} {{if $nav.manage}}
  • {{$nav.manage.1}}
  • {{/if}} - {{if $nav.contacts}}
  • {{$nav.contacts.1}}
  • {{/if}} {{if $nav.settings}}
  • {{$nav.settings.1}}
  • {{/if}} - {{if $nav.admin}}
  • {{$nav.admin.1}}
  • {{/if}} + {{if $nav.admin}} + +
  • {{$nav.admin.1}}
  • + {{/if}} {{if $nav.logout}}
  • {{$nav.logout.1}}
  • -- cgit v1.2.3 From bd06e580078e4955acd6d7d6782f06ab076f08b6 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 15:38:44 +0200 Subject: whitespace --- include/conversation.php | 1 - include/nav.php | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index d78ee2710..ee4952d7e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1527,7 +1527,6 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ ); } - if($is_owner) { $tabs[] = array( 'label' => t('Bookmarks'), diff --git a/include/nav.php b/include/nav.php index d1ee5da9a..80e4955e5 100644 --- a/include/nav.php +++ b/include/nav.php @@ -73,8 +73,6 @@ EOT; $nav['usermenu']=array(); $userinfo = null; - - if(local_user()) { $nav['logout'] = Array('logout',t('Logout'), "", t('End this session')); -- cgit v1.2.3 From b7b8303f8d110f8216a4894e2c0568778422b919 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 15:49:57 +0200 Subject: fix active state --- mod/connections.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/connections.php b/mod/connections.php index 3c3a704b2..b9df3c2b7 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -233,6 +233,7 @@ function connections_content(&$a) { $a->argc = 1; unset($a->argv[1]); } + nav_set_selected('intros'); break; case 'unconnected': $search_flags = ABOOK_FLAG_UNCONNECTED; -- cgit v1.2.3 From c80cf61a9b91b7c235786b262828007b5855b999 Mon Sep 17 00:00:00 2001 From: marijus Date: Sat, 14 Jun 2014 23:10:48 +0200 Subject: no need to have this twice --- mod/editwebpage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 38aef4a8b..deaf9ae57 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -169,7 +169,6 @@ function editwebpage_content(&$a) { '$placeholdercategory' => t('Categories (comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), 'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'), - '$acl' => populate_acl($itm[0]), '$bang' => '', '$profile_uid' => (intval($owner)), '$preview' => ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''), -- cgit v1.2.3