1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
|
|
3 |
#***************************************************************************** |
#***************************************************************************** |
4 |
# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved * |
# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved * |
5 |
# * |
# * |
6 |
# * |
# * |
7 |
# This notice is intended as a precaution against inadvertent publication * |
# This notice is intended as a precaution against inadvertent publication * |
8 |
# and does not constitute an admission or acknowledgement that publication * |
# and does not constitute an admission or acknowledgement that publication * |
9 |
# has occurred or constitute a waiver of confidentiality. * |
# has occurred or constitute a waiver of confidentiality. * |
10 |
# * |
# * |
11 |
# This software is the proprietary and confidential property * |
# This software is the proprietary and confidential property * |
12 |
# of FS Consulting, Inc. * |
# of FS Consulting, Inc. * |
13 |
#***************************************************************************** |
#***************************************************************************** |
14 |
|
|
15 |
#print "Content-type: text/plain\n\n"; |
#print "Content-type: text/plain\n\n"; |
16 |
|
|
17 |
|
#use Data::Dumper; |
18 |
|
|
19 |
#-------------------------------------------------------------------------- |
#-------------------------------------------------------------------------- |
20 |
# |
# |
21 |
# Author: Francois Schiettecatte (FS Consulting, Inc.) |
# Author: Francois Schiettecatte (FS Consulting, Inc.) |
232 |
$main::QueryReportMimeType = "application/x-wais-report"; |
$main::QueryReportMimeType = "application/x-wais-report"; |
233 |
|
|
234 |
|
|
|
|
|
|
# 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', |
|
|
); |
|
|
|
|
|
|
|
235 |
# Array of mime type names, we use this to map |
# Array of mime type names, we use this to map |
236 |
# mime types to mime type names (which are more readable) |
# mime types to mime type names (which are more readable) |
237 |
%main::MimeTypeNames = ( |
%main::MimeTypeNames = ( |
502 |
} |
} |
503 |
} |
} |
504 |
|
|
505 |
if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) { |
my $DISABLED; |
|
print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>"); |
|
|
|
|
|
|
|
|
} |
|
|
else { |
|
|
|
|
|
print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>"); |
|
|
|
|
506 |
|
|
507 |
|
$DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : ""; |
508 |
} |
print("<INPUT NAME=\"GetSearch\" TYPE=SUBMIT VALUE=\"Forma za pretra¾ivanje\" $DISABLED>"); |
509 |
|
|
510 |
if ( defined($main::RemoteUser) ) { |
if ( defined($main::RemoteUser) ) { |
511 |
if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : ""; |
512 |
print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search-history'}\" ALT=\"Search History\" BORDER=0>"); |
print"<INPUT NAME=\"ListSearchHistory\" TYPE=SUBMIT VALUE=\"Search History\" $DISABLED>"; |
|
} |
|
|
else { |
|
|
print("<INPUT NAME=\"ListSearchHistory\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search-history'}\" ALT=\"Search History\" BORDER=0>"); |
|
|
} |
|
513 |
|
|
514 |
if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : ""; |
515 |
print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-saved-searches'}\" ALT=\"Saved Searches\" BORDER=0>"); |
print"<INPUT NAME=\"ListSavedSearch\" TYPE=SUBMIT VALUE=\"List Saved Search\" $DISABLED>"; |
|
} |
|
|
else { |
|
|
print("<INPUT NAME=\"ListSavedSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-saved-searches'}\" ALT=\"Saved Searches\" BORDER=0>"); |
|
|
} |
|
516 |
|
|
517 |
if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : ""; |
518 |
print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-document-folders'}\" ALT=\"Doument Folders\" BORDER=0>"); |
print"<INPUT NAME=\"ListFolder\" TYPE=SUBMIT VALUE=\"List Folder\" $DISABLED>"; |
519 |
} |
|
520 |
else { |
$DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : ""; |
521 |
print("<INPUT NAME=\"ListFolder\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-document-folders'}\" ALT=\"Document Folders\" BORDER=0>"); |
print"<INPUT NAME=\"GetUserSettings\" TYPE=SUBMIT VALUE=\"Get User Settings\" $DISABLED>"; |
|
} |
|
|
|
|
|
if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) { |
|
|
print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-settings'}\" ALT=\"My Preferences\" BORDER=0>"); |
|
|
} |
|
|
else { |
|
|
print("<INPUT NAME=\"GetUserSettings\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-settings'}\" ALT=\"My Settings\" BORDER=0>"); |
|
|
} |
|
522 |
} |
} |
523 |
|
|
524 |
|
|
1528 |
|
|
1529 |
# nuke accented chars |
# nuke accented chars |
1530 |
$SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
$SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
1531 |
|
# convert search string to lower case -> make search case insensitive |
1532 |
|
$SearchString =~ tr/A-Z/a-z/; |
1533 |
|
|
1534 |
# Add the internal search terms |
# Add the internal search terms |
1535 |
|
|
2071 |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
2072 |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
2073 |
my ($Value, %Value, @Values, $ValueEntry); |
my ($Value, %Value, @Values, $ValueEntry); |
2074 |
|
|
2075 |
|
|
2076 |
# Check input parameters |
# Check input parameters |
2077 |
if ( !defined($SearchResults) || !%Content ) { |
if ( !defined($SearchResults) || !%Content ) { |
2078 |
return (0); |
return (0); |
2079 |
} |
} |
2080 |
|
|
|
|
|
|
|
|
2081 |
# Split the search results text into a search results list |
# Split the search results text into a search results list |
2082 |
@SearchResults = split(/\n/, $SearchResults); |
@SearchResults = split(/\n/, $SearchResults); |
|
|
|
2083 |
|
|
2084 |
|
|
2085 |
# First we count up the number of results and scoop up |
# First we count up the number of results and scoop up |
2389 |
} |
} |
2390 |
|
|
2391 |
|
|
2392 |
|
### FIX:: ADD SORT HERE |
2393 |
if ( $ResultCount > 0 ) { |
if ( $ResultCount > 0 ) { |
2394 |
|
|
2395 |
# Loop over each entry in the hits list |
# Loop over each entry in the hits list |
3173 |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
3174 |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
3175 |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
3176 |
|
### FIX:: SORT |
3177 |
|
# print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n"); |
3178 |
|
# print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n"); |
3179 |
print("</SELECT> </TD></TR>\n"); |
print("</SELECT> </TD></TR>\n"); |
3180 |
|
|
3181 |
|
|
7117 |
} |
} |
7118 |
|
|
7119 |
|
|
7120 |
if ( defined($main::FormData{'GetSearch.x'}) ) { |
if ( defined($main::FormData{'GetSearch'}) ) { |
7121 |
$ENV{'PATH_INFO'} = "/GetSearch"; |
$ENV{'PATH_INFO'} = "/GetSearch"; |
7122 |
delete($main::FormData{'GetSearch.x'}); |
delete($main::FormData{'GetSearch'}); |
7123 |
delete($main::FormData{'GetSearch.y'}); |
delete($main::FormData{'GetSearch'}); |
7124 |
} |
} |
7125 |
|
|
7126 |
if ( defined($main::FormData{'ListSearchHistory.x'}) ) { |
if ( defined($main::FormData{'ListSearchHistory'}) ) { |
7127 |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
7128 |
delete($main::FormData{'ListSearchHistory.x'}); |
delete($main::FormData{'ListSearchHistory'}); |
7129 |
delete($main::FormData{'ListSearchHistory.y'}); |
delete($main::FormData{'ListSearchHistory'}); |
7130 |
} |
} |
7131 |
|
|
7132 |
if ( defined($main::FormData{'ListSavedSearch.x'}) ) { |
if ( defined($main::FormData{'ListSavedSearch'}) ) { |
7133 |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
7134 |
delete($main::FormData{'ListSavedSearch.x'}); |
delete($main::FormData{'ListSavedSearch'}); |
7135 |
delete($main::FormData{'ListSavedSearch.y'}); |
delete($main::FormData{'ListSavedSearch'}); |
7136 |
} |
} |
7137 |
|
|
7138 |
if ( defined($main::FormData{'ListFolder.x'}) ) { |
if ( defined($main::FormData{'ListFolder'}) ) { |
7139 |
$ENV{'PATH_INFO'} = "/ListFolder"; |
$ENV{'PATH_INFO'} = "/ListFolder"; |
7140 |
delete($main::FormData{'ListFolder.x'}); |
delete($main::FormData{'ListFolder'}); |
7141 |
delete($main::FormData{'ListFolder.y'}); |
delete($main::FormData{'ListFolder'}); |
7142 |
} |
} |
7143 |
|
|
7144 |
if ( defined($main::FormData{'GetUserSettings.x'}) ) { |
if ( defined($main::FormData{'GetUserSettings'}) ) { |
7145 |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
7146 |
delete($main::FormData{'GetUserSettings.x'}); |
delete($main::FormData{'GetUserSettings'}); |
7147 |
delete($main::FormData{'GetUserSettings.y'}); |
delete($main::FormData{'GetUserSettings'}); |
7148 |
} |
} |
7149 |
|
|
7150 |
|
|