]> git.mxchange.org Git - friendica.git/commitdiff
Don't show search options in side bar.
authorMichael Vogel <icarus@dabo.de>
Mon, 24 Aug 2015 10:12:14 +0000 (12:12 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 24 Aug 2015 10:12:14 +0000 (12:12 +0200)
include/text.php
mod/search.php
view/templates/searchbox.tpl

index f3e44b3ebc09f3d13e9cbaa5bc9f47c6707e3023..9a65224af9bfd4e3d8ae19b5f7b97c67734b6038 100644 (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')) {
index d5e0dfb208992af0f91f65745fad772add2b9312..d9a2852dd4af4e92f078296752763142ef5486c8 100644 (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;
index b9a01752c0eabbd46c64223bffefb59d20a6b646..9c1be50cf618b3c6b86023ef3b5dbdc0d5f359b8 100644 (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}}