* @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')) {
}
- $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;
<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}}