--- search/Search.cgi 2002/06/24 16:49:54 1.8 +++ search/Search.cgi 2002/06/25 15:25:14 1.14 @@ -1,19 +1,21 @@ #!/usr/bin/perl -w #***************************************************************************** -# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved * -# * -# * -# This notice is intended as a precaution against inadvertent publication * -# and does not constitute an admission or acknowledgement that publication * -# has occurred or constitute a waiver of confidentiality. * -# * -# This software is the proprietary and confidential property * -# of FS Consulting, Inc. * +# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved * +# * +# * +# This notice is intended as a precaution against inadvertent publication * +# and does not constitute an admission or acknowledgement that publication * +# has occurred or constitute a waiver of confidentiality. * +# * +# This software is the proprietary and confidential property * +# of FS Consulting, Inc. * #***************************************************************************** #print "Content-type: text/plain\n\n"; +#use Data::Dumper; + #-------------------------------------------------------------------------- # # Author: Francois Schiettecatte (FS Consulting, Inc.) @@ -230,25 +232,6 @@ $main::QueryReportMimeType = "application/x-wais-report"; - -# Hash of icon/images names that we use -%main::ImageNames = ( - 'banner', 'banner.gif', - 'collapse', 'collapse.gif', - 'expand', 'expand.gif', - 'inactive-search', 'inactive-search.gif', - 'active-search', 'active-search.gif', - 'inactive-search-history', 'inactive-search-history.gif', - 'active-search-history', 'active-search-history.gif', - 'inactive-saved-searches', 'inactive-saved-searches.gif', - 'active-saved-searches', 'active-saved-searches.gif', - 'inactive-document-folders','inactive-document-folders.gif', - 'active-document-folders', 'active-document-folders.gif', - 'inactive-settings', 'inactive-settings.gif', - 'active-settings', 'active-settings.gif', -); - - # Array of mime type names, we use this to map # mime types to mime type names (which are more readable) %main::MimeTypeNames = ( @@ -409,6 +392,7 @@ print("$JavaScript\n"); } print ''; + print ''; print("\n\n"); @@ -519,47 +503,23 @@ } } - if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) { - print("\"Search\""); - - - } - else { - - print(""); - + my $DISABLED; - - } + $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : ""; + print(""); if ( defined($main::RemoteUser) ) { - if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) { - print("\"Search"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : ""; + print""; - if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) { - print("\"Saved"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : ""; + print""; - if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) { - print("\"Doument"); - } - else { - print(""); - } - - if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) { - print("\"My"); - } - else { - print(""); - } + $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : ""; + print""; + + $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : ""; + print""; } @@ -1569,6 +1529,8 @@ # nuke accented chars $SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; + # convert search string to lower case -> make search case insensitive + $SearchString =~ tr/A-Z/a-z/; # Add the internal search terms @@ -2110,18 +2072,15 @@ my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); my ($Value, %Value, @Values, $ValueEntry); - - + + # Check input parameters if ( !defined($SearchResults) || !%Content ) { return (0); } - - # Split the search results text into a search results list @SearchResults = split(/\n/, $SearchResults); - # First we count up the number of results and scoop up @@ -2431,7 +2390,7 @@ } - +### FIX:: ADD SORT HERE if ( $ResultCount > 0 ) { # Loop over each entry in the hits list @@ -3215,6 +3174,9 @@ print("