From 4cf4c13460e067126baa2c9b31a0f57cb3334421 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 11 Oct 2012 15:20:41 -0400
Subject: [PATCH] Search box cleanup: hide type drop-down if no types are
 available; removed some unused lines from jquerymobile version.

---
 themes/blueprint/templates/search/searchbox.phtml    | 2 ++
 themes/jquerymobile/templates/search/searchbox.phtml | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/themes/blueprint/templates/search/searchbox.phtml b/themes/blueprint/templates/search/searchbox.phtml
index 3782f1b5e16..a837ec4a01b 100644
--- a/themes/blueprint/templates/search/searchbox.phtml
+++ b/themes/blueprint/templates/search/searchbox.phtml
@@ -23,11 +23,13 @@
       <label for="searchForm_lookfor" class="offscreen"><?=$this->transEsc("Your search terms")?></label>
       <input id="searchForm_lookfor" type="text" name="lookfor" size="40" value="<?=$this->escapeHtml($this->lookfor)?>"<?=$options->autocompleteEnabled() ? ' class="autocomplete searcher:' . $this->escapeHtml($this->searchClassId) . ' typeSelector:searchForm_type"' : ''?>/>
       <label for="searchForm_type" class="offscreen"><?=$this->transEsc("Search Type")?></label>
+      <? if (count($options->getBasicHandlers()) > 0): ?>
       <select id="searchForm_type" name="type">
       <? foreach ($options->getBasicHandlers() as $searchVal => $searchDesc): ?>
         <option value="<?=$this->escapeHtml($searchVal)?>"<?=$this->searchIndex == $searchVal ? ' selected="selected"' : ''?>><?=$this->transEsc($searchDesc)?></option>
       <? endforeach; ?>
       </select>
+      <? endif; ?>
       <input type="submit" name="submit" value="<?=$this->transEsc("Find")?>"/>
       <? if ($advSearch): ?>
         <a href="<?=$this->url($advSearch)?>" class="small"><?=$this->transEsc("Advanced")?></a>
diff --git a/themes/jquerymobile/templates/search/searchbox.phtml b/themes/jquerymobile/templates/search/searchbox.phtml
index 6550a2ef7a7..16c3aaac7d7 100644
--- a/themes/jquerymobile/templates/search/searchbox.phtml
+++ b/themes/jquerymobile/templates/search/searchbox.phtml
@@ -7,9 +7,6 @@
   // Load search actions and settings (if any):
   $options = $this->searchOptions($this->searchClassId);
   $basicSearch = $options->getSearchAction();
-  $searchHome = $basicSearch;
-  $searchHome['action'] = 'Home';
-  $advSearch = $options->getAdvancedSearchAction();
   $lastSort = $options->getLastSort();
   $lastLimit = $options->getLastLimit();
 ?>
@@ -20,11 +17,13 @@
   <input type="search" placeholder="<?=$this->transEsc("Search")?>" name="lookfor" id="searchForm_lookfor" value="<?=$this->escapeHtml($this->lookfor)?>"/>
   
   <label class="offscreen" for="searchForm_type"><?=$this->transEsc("Search Type")?></label>
+  <? if (count($options->getBasicHandlers()) > 0): ?>
   <select id="searchForm_type" name="type" data-native-menu="false">
     <? foreach ($options->getBasicHandlers() as $searchVal => $searchDesc): ?>
       <option value="<?=$this->escapeHtml($searchVal)?>"<?=$this->searchIndex == $searchVal ? ' selected="selected"' : ''?>><?=$this->transEsc($searchDesc)?></option>
     <? endforeach; ?>
   </select>
+  <? endif; ?>
   <div data-role="fieldcontain">
     <input type="submit" data-theme="b" name="submit" value="<?=$this->transEsc("Find")?>"/>
   </div>
-- 
GitLab