From b522ab13cbf7653dcc5e0f91b10eed0a63560ecb Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 18 Aug 2014 20:03:48 -0700 Subject: nav channel selection --- include/features.php | 3 +++ include/nav.php | 15 ++++++++++++++- version.inc | 2 +- view/theme/redbasic/css/style.css | 2 ++ view/tpl/nav.tpl | 7 ++++++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/features.php b/include/features.php index 6bb444cb6..7530158ec 100644 --- a/include/features.php +++ b/include/features.php @@ -31,6 +31,9 @@ function get_features() { // prettyphoto has licensing issues and will no longer be provided in core - // in any event this setting should probably be a theme option or plugin // array('prettyphoto', t('Enhanced Photo Albums'), t('Enable photo album with enhanced features')), + array('nav_channel_select', t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu')), + + //FIXME - needs a description, but how the hell do we explain this to normals? array('sendzid', t('Extended Identity Sharing'), t('Share your identity with all websites on the internet. When disabled, identity is only shared with sites in the matrix.')), array('expert', t('Expert Mode'), t('Enable Expert Mode to provide advanced configuration options')), diff --git a/include/nav.php b/include/nav.php index 8133ecf67..799faf5ce 100644 --- a/include/nav.php +++ b/include/nav.php @@ -38,6 +38,14 @@ EOT; intval($channel['channel_id']) ); + $chans = q("select channel_name, channel_id from channel where channel_account_id = %d and not ( channel_pageflags & %d ) order by channel_name ", + intval(get_account_id()), + intval(PAGE_REMOVED) + ); + + + + } elseif(remote_user()) $observer = $a->get_observer(); @@ -78,6 +86,11 @@ EOT; $userinfo = null; if(local_user()) { + + + if($chans && count($chans) > 1 && feature_enabled(local_user(),'nav_channel_select')) + $nav['channels'] = $chans; + $nav['logout'] = Array('logout',t('Logout'), "", t('End this session')); // user menu @@ -193,7 +206,7 @@ EOT; $nav['all_events']['all']=array('events', t('See all events'), "", ""); $nav['all_events']['mark'] = array('', t('Mark all events seen'), '',''); - $nav['manage'] = array('manage', t('Channel Select'), "", t('Manage Your Channels')); + $nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels')); $nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings')); diff --git a/version.inc b/version.inc index 6d17789e1..9699f543a 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-08-17.770 +2014-08-18.771 diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 889988d48..478f1efee 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -177,6 +177,8 @@ nav #banner #logo-text a { } nav #banner #logo-text a:hover { text-decoration: none; } +.nav-channel-select { margin-left: 8px; } + header #banner { /* overflow: hidden; */ text-align: center; diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 0602c72af..2953f3b41 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -20,8 +20,13 @@ {{/foreach}} {{if $nav.profiles}}
  • {{$nav.profiles.1}}
  • {{/if}} - {{if $nav.manage}}
  • {{$nav.manage.1}}
  • {{/if}} {{if $nav.settings}}
  • {{$nav.settings.1}}
  • {{/if}} + {{if $nav.manage}}
  • {{$nav.manage.1}}
  • {{/if}} + {{if $nav.channels}} + {{foreach $nav.channels as $chan}} + + {{/foreach}} + {{/if}} {{if $nav.admin}}
  • {{$nav.admin.1}}
  • -- cgit v1.2.3