From f66f631079539bc986dab29d4a01c6c59a19545a Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 4 Jan 2018 14:02:04 +0000 Subject: [PATCH] We now have a single menu item again --- include/nav.php | 8 ++------ mod/community.php | 21 ++++++++++++++++++++- view/templates/nav.tpl | 3 --- view/theme/frio/templates/nav.tpl | 4 ---- view/theme/frost-mobile/templates/nav.tpl | 6 ------ view/theme/frost/templates/nav.tpl | 6 ------ view/theme/quattro/templates/nav.tpl | 6 ------ view/theme/vier/templates/nav.tpl | 7 ------- 8 files changed, 22 insertions(+), 39 deletions(-) diff --git a/include/nav.php b/include/nav.php index 13999e0e80..9e136276af 100644 --- a/include/nav.php +++ b/include/nav.php @@ -149,12 +149,8 @@ function nav_info(App $a) } } - if (in_array(Config::get('system', 'community_page_style'), [CP_USERS_ON_SERVER, CP_USERS_AND_GLOBAL])) { - $nav['community'] = array('community/local', t('Community'), '', t('Conversations on this site')); - } - - if (in_array(Config::get('system', 'community_page_style'), [CP_GLOBAL_COMMUNITY, CP_USERS_AND_GLOBAL])) { - $nav['global'] = array('community/global', t('Global Timeline'), '', t('Conversations on the network')); + if (Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) { + $nav['community'] = array('community', t('Community'), '', t('Conversations on this and other servers')); } if (local_user()) { diff --git a/mod/community.php b/mod/community.php index 138873be57..1451593449 100644 --- a/mod/community.php +++ b/mod/community.php @@ -57,6 +57,25 @@ function community_content(App $a, $update = 0) { require_once 'include/conversation.php'; if (!$update) { + $tabs = []; + + $tabs[] = array('label'=>t('Community'), + 'url' => 'community/local', + 'sel' => $content == 'local' ? 'active' : '', + 'title' => t('Posts from local users on this server'), + 'id' => 'community-local-tab', + 'accesskey' => 'l'); + + $tabs[] = array('label' => t('Global Timeline'), + 'url' => 'community/global', + 'sel' => $content == 'global' ? 'active' : '', + 'title' => t('Posts from users of the federated network'), + 'id' => 'community-global-tab', + 'accesskey' => 'g'); + + $tab_tpl = get_markup_template('common_tabs.tpl'); + $o .= replace_macros($tab_tpl, array('$tabs' => $tabs)); + nav_set_selected('community'); } @@ -121,7 +140,7 @@ function community_content(App $a, $update = 0) { $t = get_markup_template("community.tpl"); return replace_macros($t, array( '$content' => $o, - '$header' => $content == 'global' ? t("Global Timeline") : t("Community"), + '$header' => '', '$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'), '$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") )); diff --git a/view/templates/nav.tpl b/view/templates/nav.tpl index 35611ca10a..b6513e0fe8 100644 --- a/view/templates/nav.tpl +++ b/view/templates/nav.tpl @@ -31,9 +31,6 @@ {{if $nav.community}} {{$nav.community.1}} {{/if}} - {{if $nav.global}} - {{$nav.global.1}} - {{/if}} {{if $nav.introductions}} {{$nav.introductions.1}} diff --git a/view/theme/frio/templates/nav.tpl b/view/theme/frio/templates/nav.tpl index b9c8d36c5d..2fab623530 100644 --- a/view/theme/frio/templates/nav.tpl +++ b/view/theme/frio/templates/nav.tpl @@ -50,10 +50,6 @@ {{if $nav.community}} {{/if}} - - {{if $nav.global}} - - {{/if}} {{/if}} - - {{if $nav.global}} -
  • - {{$nav.global.1}} -
  • - {{/if}} diff --git a/view/theme/frost/templates/nav.tpl b/view/theme/frost/templates/nav.tpl index e3edf59e8f..cc9110a27f 100644 --- a/view/theme/frost/templates/nav.tpl +++ b/view/theme/frost/templates/nav.tpl @@ -130,12 +130,6 @@ {{$nav.community.1}} {{/if}} - - {{if $nav.global}} -
  • - {{$nav.global.1}} -
  • - {{/if}} diff --git a/view/theme/quattro/templates/nav.tpl b/view/theme/quattro/templates/nav.tpl index cfc46f1d5a..f0aacd4261 100644 --- a/view/theme/quattro/templates/nav.tpl +++ b/view/theme/quattro/templates/nav.tpl @@ -20,12 +20,6 @@ {{/if}} - {{if $nav.global}} - - {{/if}} - {{if $nav.community}} {{/if}} - {{if $nav.global}} - - {{/if}} -