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 e1661644d..e7f51cc0c 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 9a65224af..0002f074e 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 9c1be50cf..4b1a51f87 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 5483113f3..ef52e7789 100644 --- a/view/theme/vier/templates/nav.tpl +++ b/view/theme/vier/templates/nav.tpl @@ -76,7 +76,7 @@ - + {{if $nav.searchoption.3}}{{/if}}