Merge pull request #1853 from annando/1508-search-forum

Only offer forum search in local mode
This commit is contained in:
Tobias Diekershoff 2015-08-25 07:10:54 +02:00
commit 445dcd3051
4 changed files with 12 additions and 7 deletions

View file

@ -121,8 +121,10 @@ function nav_info(&$a) {
$nav['searchoption'] = array( $nav['searchoption'] = array(
t("Full Text"), t("Full Text"),
t("Tags"), t("Tags"),
t("Contacts"), t("Contacts"));
t("Forums"));
if (get_config('system','poco_local_search'))
$nav['searchoption'][] = t("Forums");
$gdirpath = 'directory'; $gdirpath = 'directory';

View file

@ -998,12 +998,15 @@ function search($s,$id='search-box',$url='/search',$save = false, $aside = true)
'$savedsearch' => feature_enabled(local_user(),'savedsearch'), '$savedsearch' => feature_enabled(local_user(),'savedsearch'),
); );
if (!$aside) if (!$aside) {
$values['$searchoption'] = array( $values['$searchoption'] = array(
t("Full Text"), t("Full Text"),
t("Tags"), t("Tags"),
t("Contacts"), t("Contacts"));
t("Forums"));
if (get_config('system','poco_local_search'))
$values['$searchoption'][] = t("Forums");
}
return replace_macros(get_markup_template('searchbox.tpl'), $values); return replace_macros(get_markup_template('searchbox.tpl'), $values);
}} }}

View file

@ -7,7 +7,7 @@
<option value="fulltext">{{$searchoption.0}}</option> <option value="fulltext">{{$searchoption.0}}</option>
<option value="tags">{{$searchoption.1}}</option> <option value="tags">{{$searchoption.1}}</option>
<option value="contacts">{{$searchoption.2}}</option> <option value="contacts">{{$searchoption.2}}</option>
<option value="forums">{{$searchoption.3}}</option> {{if $searchoption.3}}<option value="forums">{{$searchoption.3}}</option>{{/if}}
</select> </select>
{{/if}} {{/if}}

View file

@ -76,7 +76,7 @@
<option value="fulltext">{{$nav.searchoption.0}}</option> <option value="fulltext">{{$nav.searchoption.0}}</option>
<option value="tags">{{$nav.searchoption.1}}</option> <option value="tags">{{$nav.searchoption.1}}</option>
<option value="contacts">{{$nav.searchoption.2}}</option> <option value="contacts">{{$nav.searchoption.2}}</option>
<option value="forums">{{$nav.searchoption.3}}</option> {{if $nav.searchoption.3}}<option value="forums">{{$nav.searchoption.3}}</option>{{/if}}
</select> </select>
</form> </form>
</li> </li>