From b1dddd293682e37f08e95a35316ac5b6f060e144 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 25 Aug 2015 05:54:50 +0200 Subject: [PATCH] Only offer forum search in local mode. --- include/nav.php | 6 ++++-- include/text.php | 9 ++++++--- view/templates/searchbox.tpl | 2 +- view/theme/vier/templates/nav.tpl | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/nav.php b/include/nav.php index e1661644d1..e7f51cc0c0 100644 --- a/include/nav.php +++ b/include/nav.php @@ -121,8 +121,10 @@ function nav_info(&$a) { $nav['searchoption'] = array( t("Full Text"), t("Tags"), - t("Contacts"), - t("Forums")); + t("Contacts")); + + if (get_config('system','poco_local_search')) + $nav['searchoption'][] = t("Forums"); $gdirpath = 'directory'; diff --git a/include/text.php b/include/text.php index 9a65224af9..0002f074e9 100644 --- a/include/text.php +++ b/include/text.php @@ -998,12 +998,15 @@ function search($s,$id='search-box',$url='/search',$save = false, $aside = true) '$savedsearch' => feature_enabled(local_user(),'savedsearch'), ); - if (!$aside) + if (!$aside) { $values['$searchoption'] = array( t("Full Text"), t("Tags"), - t("Contacts"), - t("Forums")); + t("Contacts")); + + if (get_config('system','poco_local_search')) + $values['$searchoption'][] = t("Forums"); + } return replace_macros(get_markup_template('searchbox.tpl'), $values); }} diff --git a/view/templates/searchbox.tpl b/view/templates/searchbox.tpl index 9c1be50cf6..4b1a51f877 100644 --- a/view/templates/searchbox.tpl +++ b/view/templates/searchbox.tpl @@ -7,7 +7,7 @@ - + {{if $searchoption.3}}{{/if}} {{/if}} diff --git a/view/theme/vier/templates/nav.tpl b/view/theme/vier/templates/nav.tpl index 5483113f33..ef52e77894 100644 --- a/view/theme/vier/templates/nav.tpl +++ b/view/theme/vier/templates/nav.tpl @@ -76,7 +76,7 @@ - + {{if $nav.searchoption.3}}{{/if}}