1
0
Fork 0

Don't show search options in side bar.

This commit is contained in:
Michael Vogel 2015-08-24 12:12:14 +02:00
parent 3ff196f00d
commit 3bca2db11b
3 changed files with 20 additions and 13 deletions

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')) {

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;

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}}