Commit 272584cb37236a77d712ecaf8171b77401b6e11b

Authored by rob
1 parent 007a6d78

Search bar is now hidden if you are browsing search results


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1135 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 24 additions and 16 deletions
lib/visualpatterns/NavBar.inc
@@ -30,6 +30,7 @@ class NavBar { @@ -30,6 +30,7 @@ class NavBar {
30 var $help; 30 var $help;
31 var $logout; 31 var $logout;
32 var $nwColourbar; 32 var $nwColourbar;
  33 + var $sSection;
33 34
34 /** variables used for searching */ 35 /** variables used for searching */
35 var $sBrowseType; 36 var $sBrowseType;
@@ -78,6 +79,7 @@ class NavBar { @@ -78,6 +79,7 @@ class NavBar {
78 */ 79 */
79 function setHighlightedSection($section) { 80 function setHighlightedSection($section) {
80 global $default; 81 global $default;
  82 + $this->sSection = $section;
81 83
82 // check for highlighting..and highlight as required 84 // check for highlighting..and highlight as required
83 if($section == "General") { 85 if($section == "General") {
@@ -94,8 +96,8 @@ class NavBar { @@ -94,8 +96,8 @@ class NavBar {
94 $this->subscriptions = "$default->graphicsUrl/subscriptions/over.gif"; 96 $this->subscriptions = "$default->graphicsUrl/subscriptions/over.gif";
95 $this->nwColourBar = "$default->graphicsUrl/subscriptions/def.gif"; 97 $this->nwColourBar = "$default->graphicsUrl/subscriptions/def.gif";
96 } 98 }
97 -  
98 - if($section == "Advanced Search") { 99 +
  100 + if(($section == "Standard Search") || ($section == "Advanced Search")) {
99 $this->asearch = "$default->graphicsUrl/asearch/over.gif"; 101 $this->asearch = "$default->graphicsUrl/asearch/over.gif";
100 $this->nwColourBar = "$default->graphicsUrl/asearch/def.gif"; 102 $this->nwColourBar = "$default->graphicsUrl/asearch/def.gif";
101 } 103 }
@@ -121,6 +123,7 @@ class NavBar { @@ -121,6 +123,7 @@ class NavBar {
121 $this->logout = "$default->graphicsUrl/logout/over.gif"; 123 $this->logout = "$default->graphicsUrl/logout/over.gif";
122 $this->nwColourBar = "$default->graphicsUrl/logout/def.gif"; 124 $this->nwColourBar = "$default->graphicsUrl/logout/def.gif";
123 } 125 }
  126 +
124 } 127 }
125 128
126 129
@@ -199,7 +202,7 @@ class NavBar { @@ -199,7 +202,7 @@ class NavBar {
199 //array of coloured section images 202 //array of coloured section images
200 $row4 = $oColourTableLinks->render(); 203 $row4 = $oColourTableLinks->render();
201 204
202 - $toRender = new PatternCustom; 205 + $toRender = new PatternCustom;
203 206
204 //bar is the actaul html creation of the nav bar 207 //bar is the actaul html creation of the nav bar
205 $bar= " 208 $bar= "
@@ -208,19 +211,24 @@ class NavBar { @@ -208,19 +211,24 @@ class NavBar {
208 "<tr height=\"30%\"> <td VALIGN = \"absmiddle\" background = " . $hStretched ." width =\"100%\" NOWRAP >\n " . 211 "<tr height=\"30%\"> <td VALIGN = \"absmiddle\" background = " . $hStretched ." width =\"100%\" NOWRAP >\n " .
209 "<img align = \"absmiddle\" src = \"$default->graphicsUrl/arrow.gif\" ></img>\n " . 212 "<img align = \"absmiddle\" src = \"$default->graphicsUrl/arrow.gif\" ></img>\n " .
210 "<img align = \"absmiddle\" src = \"$default->graphicsUrl/arrow.gif\" ></img>\n " . 213 "<img align = \"absmiddle\" src = \"$default->graphicsUrl/arrow.gif\" ></img>\n " .
211 - "<INPUT type=\"hidden\" name=\"fForStandardSearch\" value=\"no\" />\n " .  
212 - "<INPUT type=\"text\" name=\"fSearchText\" width=\"30\" height = \"10\" align = \"absmiddle\" />\n " .  
213 - "<INPUT type=\"hidden\" name=\"fBrowseType\" value=\"" . $this->sBrowseType . "\" />\n " .  
214 - "<INPUT type=\"hidden\" name=\"fFolderID\" value=\"" . $this->iFolderID . "\" />\n " .  
215 - "<INPUT type=\"hidden\" name=\"fDocumentID\" value=\"" . $this->iDocumentID . "\" />\n " .  
216 - "<INPUT type=\"hidden\" name=\"fCategoryName\" value=\"" . $this->sCategoryName . "\" />\n " .  
217 - "<INPUT type=\"hidden\" name=\"fDocTypeID\" value=\"" . $this->iDocTypeID . "\" />\n " .  
218 - "<INPUT type=\"image\" onClick=\"setActionAndSubmitSearch('" . $default->rootUrl . "/control.php')\" src=\"$default->graphicsUrl/search.gif\" align = \"absmiddle\" border=\"0\" />\n " .  
219 - "</td>\n " .  
220 - "</tr>\n" .  
221 - "<tr height=\"25%\" ><td width =\"10%\">". $row3 . "</td></tr>\n" .  
222 - "<tr height=\"25%\"><td width =\"100%\">". $row4 . "</td></tr>\n" .  
223 - "</table>\n"; 214 + "<INPUT type=\"hidden\" name=\"fForStandardSearch\" value=\"no\" />\n ";
  215 + //disable the search bar if we are browsing search results
  216 + if (strcmp($this->sSection,"Standard Search") == 0) {
  217 + $bar .= "<INPUT type=\"hidden\" name=\"fSearchText\" width=\"30\" height = \"10\" align = \"absmiddle\" />\n ";
  218 + } else {
  219 + $bar .= "<INPUT type=\"text\" name=\"fSearchText\" width=\"30\" height = \"10\" align = \"absmiddle\" />\n " .
  220 + "<INPUT type=\"hidden\" name=\"fBrowseType\" value=\"" . $this->sBrowseType . "\" />\n " .
  221 + "<INPUT type=\"hidden\" name=\"fFolderID\" value=\"" . $this->iFolderID . "\" />\n " .
  222 + "<INPUT type=\"hidden\" name=\"fDocumentID\" value=\"" . $this->iDocumentID . "\" />\n " .
  223 + "<INPUT type=\"hidden\" name=\"fCategoryName\" value=\"" . $this->sCategoryName . "\" />\n " .
  224 + "<INPUT type=\"hidden\" name=\"fDocTypeID\" value=\"" . $this->iDocTypeID . "\" />\n " .
  225 + "<INPUT type=\"image\" onClick=\"setActionAndSubmitSearch('" . $default->rootUrl . "/control.php')\" src=\"$default->graphicsUrl/search.gif\" align = \"absmiddle\" border=\"0\" />\n ";
  226 + }
  227 + $bar .= "</td>\n " .
  228 + "</tr>\n" .
  229 + "<tr height=\"25%\" ><td width =\"10%\">". $row3 . "</td></tr>\n" .
  230 + "<tr height=\"25%\"><td width =\"100%\">". $row4 . "</td></tr>\n" .
  231 + "</table>\n";
224 232
225 //set the bar as html to object 233 //set the bar as html to object
226 $toRender->setHtml($bar); 234 $toRender->setHtml($bar);