Browse Source

Don't show search options in side bar.

pull/1848/head
Michael Vogel 5 years ago
parent
commit
3bca2db11b
3 changed files with 20 additions and 13 deletions
  1. +16
    -11
      include/text.php
  2. +1
    -1
      mod/search.php
  3. +3
    -1
      view/templates/searchbox.tpl

+ 16
- 11
include/text.php View File

@ -986,21 +986,26 @@ if(! function_exists('search')) {
* @param string $url search url
* @param boolean $savedsearch show save search button
*/
function search($s,$id='search-box',$url='/search',$save = false) {
function search($s,$id='search-box',$url='/search',$save = false, $aside = true) {
$a = get_app();
return replace_macros(get_markup_template('searchbox.tpl'), array(
'$s' => $s,
'$id' => $id,
'$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url,
'$search_label' => t('Search'),
'$save_label' => t('Save'),
'$savedsearch' => feature_enabled(local_user(),'savedsearch'),
'$searchoption' => array(
$values = array(
'$s' => $s,
'$id' => $id,
'$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url,
'$search_label' => t('Search'),
'$save_label' => t('Save'),
'$savedsearch' => feature_enabled(local_user(),'savedsearch'),
);
if (!$aside)
$values['$searchoption'] = array(
t("Full Text"),
t("Tags"),
t("Contacts"),
t("Forums"))
));
t("Forums"));
return replace_macros(get_markup_template('searchbox.tpl'), $values);
}}
if(! function_exists('valid_email')) {


+ 1
- 1
mod/search.php View File

@ -111,7 +111,7 @@ function search_content(&$a) {
}
$o .= search($search,'search-box','/search',((local_user()) ? true : false));
$o .= search($search,'search-box','/search',((local_user()) ? true : false), false);
if(strpos($search,'#') === 0) {
$tag = true;


+ 3
- 1
view/templates/searchbox.tpl View File

@ -2,12 +2,14 @@
<form action="{{$action_url}}" method="get" >
{{strip}}
<input type="text" name="search" id="search-text" placeholder="{{$search_label}}" value="{{$s}}" />
<select name="search-option">
{{if $searchoption}}
<select name="search-option" id="search-options">
<option value="fulltext">{{$searchoption.0}}</option>
<option value="tags">{{$searchoption.1}}</option>
<option value="contacts">{{$searchoption.2}}</option>
<option value="forums">{{$searchoption.3}}</option>
</select>
{{/if}}
<input type="submit" name="submit" id="search-submit" value="{{$search_label}}" />
{{if $savedsearch}}


Loading…
Cancel
Save