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"; |
16 |
|
|
17 |
|
#use Data::Dumper; |
18 |
|
|
19 |
#-------------------------------------------------------------------------- |
#-------------------------------------------------------------------------- |
20 |
# |
# |
21 |
# Author: Francois Schiettecatte (FS Consulting, Inc.) |
# Author: Francois Schiettecatte (FS Consulting, Inc.) |
183 |
# |
# |
184 |
|
|
185 |
|
|
186 |
# List of default configuration settings |
# read configuration fields |
187 |
%main::DefaultSettings = ( |
require "config.pm"; |
|
'lowest-year', '1990', |
|
|
'max-score', '1000', |
|
|
'allow-summary-displays','no', |
|
|
'allow-similiar-search','no', |
|
|
'allow-regular-searches','no', |
|
|
'deliver-empty-results-from-regular-search','no', |
|
|
# 'allow-relevance-feedback-searches','no', |
|
|
'mailer-application','/usr/lib/sendmail', |
|
|
'server-log','mps.log', |
|
|
'output-colums','yes', |
|
|
# 'show-past-date-list','yes', |
|
|
'database-for-SearchFieldDescriptions','ps', |
|
|
); |
|
|
|
|
|
# DbP: Define which fields you have in normal and advanced search |
|
|
# first define all available fields and then how many fields of that |
|
|
# are visible. |
|
|
@main::NormalSearchFieldNames = ( |
|
|
'700+', |
|
|
'200+', |
|
|
'610', |
|
|
'210', |
|
|
'10', |
|
|
|
|
|
); |
|
|
$main::NormalSearchDropdowns = 3 ; |
|
|
|
|
|
@main::AdvancedSearchFieldNames = ( |
|
|
'700+', |
|
|
'200+', |
|
|
'610', |
|
|
'210', |
|
|
'225', |
|
|
'300+', |
|
|
'330', |
|
|
'464', |
|
|
'675', |
|
|
'686', |
|
|
'990', |
|
|
'991', |
|
|
'10', |
|
|
'001', |
|
|
); |
|
|
$main::AdvancedSearchDropdowns = 4 ; |
|
|
|
|
188 |
|
|
189 |
# List of required configuration settings |
# List of required configuration settings |
190 |
@main::RequiredSettings = ( |
@main::RequiredSettings = ( |
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 = ( |
376 |
if ( ! $ENV{'GATEWAY_INTERFACE'} ) { |
if ( ! $ENV{'GATEWAY_INTERFACE'} ) { |
377 |
return; |
return; |
378 |
} |
} |
379 |
|
|
380 |
# Bail if we have already sent the header |
# Bail if we have already sent the header |
381 |
if ( $main::HeaderSent ) { |
if ( $main::HeaderSent ) { |
382 |
return; |
return; |
392 |
print("$JavaScript\n"); |
print("$JavaScript\n"); |
393 |
} |
} |
394 |
print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">'; |
print '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">'; |
395 |
|
print '<link rel="STYLESHEET" type="text/css" href="'.$main::ConfigurationData{'image-base-path'}.'/stil.css">'; |
396 |
print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n"); |
print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n"); |
397 |
|
|
398 |
|
|
402 |
|
|
403 |
# Send the banner |
# Send the banner |
404 |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n"); |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n"); |
405 |
print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n"); |
# print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n"); |
406 |
print("</TABLE>\n"); |
|
407 |
|
print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><H3>Katalozi knji¾nica Filozofskog fakulteta</H3> </A> </TD></TR>\n"); |
408 |
|
|
409 |
|
print("</TABLE>\n"); |
410 |
|
|
411 |
|
|
412 |
# Set the flag saying that the header has been sent |
# Set the flag saying that the header has been sent |
503 |
} |
} |
504 |
} |
} |
505 |
|
|
506 |
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>"); |
|
507 |
|
|
508 |
|
$DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : ""; |
509 |
} |
print("<INPUT NAME=\"GetSearch\" TYPE=SUBMIT VALUE=\"Forma za pretra¾ivanje\" $DISABLED class=\"navigacija\">"); |
510 |
|
|
511 |
if ( defined($main::RemoteUser) ) { |
if ( defined($main::RemoteUser) ) { |
512 |
if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : ""; |
513 |
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 class=\"navigacija\">"; |
|
} |
|
|
else { |
|
|
print("<INPUT NAME=\"ListSearchHistory\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search-history'}\" ALT=\"Search History\" BORDER=0>"); |
|
|
} |
|
514 |
|
|
515 |
if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : ""; |
516 |
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 class=\"navigacija\">"; |
|
} |
|
|
else { |
|
|
print("<INPUT NAME=\"ListSavedSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-saved-searches'}\" ALT=\"Saved Searches\" BORDER=0>"); |
|
|
} |
|
517 |
|
|
518 |
if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) { |
$DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : ""; |
519 |
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 class=\"navigacija\">"; |
520 |
} |
|
521 |
else { |
$DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : ""; |
522 |
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 class=\"navigacija\">"; |
|
} |
|
|
|
|
|
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>"); |
|
|
} |
|
523 |
} |
} |
524 |
|
|
525 |
|
|
1529 |
|
|
1530 |
# nuke accented chars |
# nuke accented chars |
1531 |
$SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
$SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/; |
1532 |
|
# convert search string to lower case -> make search case insensitive |
1533 |
|
$SearchString =~ tr/A-Z/a-z/; |
1534 |
|
|
1535 |
# Add the internal search terms |
# Add the internal search terms |
1536 |
|
|
2072 |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength); |
2073 |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction); |
2074 |
my ($Value, %Value, @Values, $ValueEntry); |
my ($Value, %Value, @Values, $ValueEntry); |
2075 |
|
|
2076 |
|
|
2077 |
# Check input parameters |
# Check input parameters |
2078 |
if ( !defined($SearchResults) || !%Content ) { |
if ( !defined($SearchResults) || !%Content ) { |
2079 |
return (0); |
return (0); |
2080 |
} |
} |
2081 |
|
|
|
|
|
|
|
|
2082 |
# Split the search results text into a search results list |
# Split the search results text into a search results list |
2083 |
@SearchResults = split(/\n/, $SearchResults); |
@SearchResults = split(/\n/, $SearchResults); |
|
|
|
2084 |
|
|
2085 |
|
|
2086 |
# First we count up the number of results and scoop up |
# First we count up the number of results and scoop up |
2390 |
} |
} |
2391 |
|
|
2392 |
|
|
2393 |
|
### FIX:: ADD SORT HERE |
2394 |
if ( $ResultCount > 0 ) { |
if ( $ResultCount > 0 ) { |
2395 |
|
|
2396 |
# Loop over each entry in the hits list |
# Loop over each entry in the hits list |
2647 |
# Put up the headline and the score, this one links to the document |
# Put up the headline and the score, this one links to the document |
2648 |
if ( $HTML ) { |
if ( $HTML ) { |
2649 |
print("<!-- resultItem -->\n"); |
print("<!-- resultItem -->\n"); |
2650 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>"); |
#print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>"); |
2651 |
} |
# decode some basic html from headline <b> <i> |
2652 |
else { |
$Headline =~ s/<(\/?[bi])>/<$1>/g; |
2653 |
|
|
2654 |
|
print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline </A> <BR> <FONT SIZE=-2> "); |
2655 |
|
} else { |
2656 |
printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); |
printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); |
2657 |
} |
} |
2658 |
|
|
2659 |
|
if (0) { ## don't display description |
2660 |
|
|
2661 |
# Put up the summary |
# Put up the summary |
2662 |
if ( defined($SummaryText) && ($SummaryText ne "") ) { |
if ( defined($SummaryText) && ($SummaryText ne "") ) { |
2673 |
if ( ! defined($Remainder) ) { |
if ( ! defined($Remainder) ) { |
2674 |
if ( $HTML ) { |
if ( $HTML ) { |
2675 |
print("Formatttt: $MimeTypeName, "); |
print("Formatttt: $MimeTypeName, "); |
2676 |
|
|
2677 |
} |
} |
2678 |
else { |
else { |
2679 |
print(" Format: $MimeTypeName, "); |
print(" Format: $MimeTypeName, "); |
2682 |
|
|
2683 |
|
|
2684 |
# Put up the date if we got it |
# Put up the date if we got it |
2685 |
if ( defined($Date) && ($Date ne "") ) { |
if ( defined($Date) && ($Date ne "") ) { |
2686 |
print("Date: $Date"); |
print("Date: $Date"); |
2687 |
|
|
2688 |
# Put up the time if we got it |
# Put up the time if we got it |
2689 |
if ( defined($Time) && ($Time ne "") ) { |
if ( defined($Time) && ($Time ne "") ) { |
2690 |
print(" $Time"); |
print(" $Time"); |
2691 |
} |
} |
2692 |
|
|
2817 |
} |
} |
2818 |
print("\n"); |
print("\n"); |
2819 |
|
|
2820 |
|
} #if |
2821 |
# Finish off the entry |
# Finish off the entry |
2822 |
if ( $HTML ) { |
if ( $HTML ) { |
2823 |
print("</FONT></TD></TR>\n"); |
print("</FONT></TD></TR>\n"); |
2933 |
|
|
2934 |
# Make sure that we send the header |
# Make sure that we send the header |
2935 |
$Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretra¾ivanje s vi¹e kriterija" : "Jednostavno pretra¾ivanje"; |
$Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretra¾ivanje s vi¹e kriterija" : "Jednostavno pretra¾ivanje"; |
2936 |
&vSendHTMLHeader($Value, undef); |
my $JavaScript = '<SCRIPT LANGUAGE="JavaScript"> |
2937 |
|
<!-- hide |
2938 |
|
function SetChecked(val) { |
2939 |
|
dml=document.Search; |
2940 |
|
len = dml.elements.length; |
2941 |
|
var i=0; |
2942 |
|
for( i=0 ; i<len ; i++) { |
2943 |
|
if (dml.elements[i].name==\'Database\') { |
2944 |
|
dml.elements[i].checked=val; |
2945 |
|
} |
2946 |
|
} |
2947 |
|
} |
2948 |
|
// --> |
2949 |
|
</SCRIPT> |
2950 |
|
'; |
2951 |
|
|
2952 |
|
&vSendHTMLHeader($Value, $JavaScript); |
2953 |
|
|
2954 |
undef(%Value); |
undef(%Value); |
2955 |
$Value{'GetSearch'} = "GetSearch"; |
$Value{'GetSearch'} = "GetSearch"; |
3000 |
|
|
3001 |
# Send the start of the form and the buttons |
# Send the start of the form and the buttons |
3002 |
print("<TD ALIGN=RIGHT VALIGN=TOP>\n"); |
print("<TD ALIGN=RIGHT VALIGN=TOP>\n"); |
3003 |
print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/GetSearchResults\" METHOD=POST> <INPUT TYPE=SUBMIT VALUE=\"Pretra¾i bazu\"> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\">\n"); |
print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/GetSearchResults\" NAME=\"Search\" METHOD=POST> <INPUT TYPE=SUBMIT VALUE=\"Pretra¾i bazu\"> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\">\n"); |
3004 |
print("</TD></TR>\n"); |
print("</TD></TR>\n"); |
3005 |
|
|
3006 |
print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=3><BR></TD></TR>\n"); |
print("<TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=3><BR></TD></TR>\n"); |
3029 |
print ("<SELECT NAME=\"FieldName${field}\">"); |
print ("<SELECT NAME=\"FieldName${field}\">"); |
3030 |
for (my $i=0; $i<=$#SearchFieldNames; $i++) { |
for (my $i=0; $i<=$#SearchFieldNames; $i++) { |
3031 |
my $ItemEntry = $SearchFieldNames[$i]; |
my $ItemEntry = $SearchFieldNames[$i]; |
3032 |
my $Selected = ($main::FormData{"FieldName${field}"} == $ItemEntry || $i == ($field-1)) ? "SELECTED" : ""; |
my $Selected = ""; |
3033 |
|
if ($main::FormData{"FieldName${field}"} && $main::FormData{"FieldName${field}"} eq $ItemEntry) { |
3034 |
|
$Selected = "SELECTED"; |
3035 |
|
} elsif ($i == ($field - 1)) { |
3036 |
|
$Selected = "SELECTED"; |
3037 |
|
} |
3038 |
|
|
3039 |
print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n"); |
print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n"); |
3040 |
} |
} |
3041 |
my $Value = defined($main::FormData{"FieldContent${field}"}) ? "VALUE='".$main::FormData{"FieldContent${field}"}."'" : ""; |
my $Value = ""; |
3042 |
|
if (defined($main::FormData{"FieldContent${field}"})) { |
3043 |
|
$Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'"; |
3044 |
|
} |
3045 |
print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n"); |
print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n"); |
3046 |
} |
} |
3047 |
|
|
3064 |
# Database selection |
# Database selection |
3065 |
if ( %main::DatabaseDescriptions ) { |
if ( %main::DatabaseDescriptions ) { |
3066 |
|
|
3067 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju ¾elite pretra¾ivati: </TD> <TD ALIGN=LEFT VALIGN=TOP>\n"); |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju ¾elite pretra¾ivati: |
3068 |
|
</td><td> |
3069 |
|
<font size=-1>Oznaèi |
3070 |
|
<a href=\"javascript:SetChecked(1)\">sve</a>, |
3071 |
|
<a href=\"javascript:SetChecked(0)\">niti jednu</a>. |
3072 |
|
</font> |
3073 |
|
</TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4> |
3074 |
|
"); |
3075 |
|
|
3076 |
# Parse out the database names and put them into a |
# Parse out the database names and put them into a |
3077 |
# hash table, they should be separated with a '\0' |
# hash table, they should be separated with a '\0' |
3085 |
@ItemList = split(",", $SelectedDatabases); |
@ItemList = split(",", $SelectedDatabases); |
3086 |
} |
} |
3087 |
} |
} |
|
foreach $ItemEntry ( @ItemList ) { |
|
|
$Value{$ItemEntry} = $ItemEntry; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$Flag = 0; |
|
|
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n"); |
|
|
|
|
|
my @html_database; |
|
|
|
|
|
foreach my $key ( sort keys %main::DatabaseSort ) { |
|
|
$DatabaseName = $main::DatabaseSort{$key}; |
|
|
$Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : ""; |
|
|
$ItemEntry = &lEncodeURLData($DatabaseName); |
|
|
if ($main::DatabaseDescriptions{$DatabaseName}) { |
|
|
push @html_database,"<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"Database\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Informacije io bazi $main::DatabaseDescriptions{$DatabaseName} '; return true\"> $main::DatabaseDescriptions{$DatabaseName} </A> </TD>\n"; |
|
|
} else { |
|
|
push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($main::ConfigurationData{'output-colums'}) { |
|
|
# create database names in columns |
|
3088 |
|
|
3089 |
my $max = $#html_database+1 ; |
&ShowDatabaseCheckBoxes(@ItemList); |
|
|
|
|
my $j=0; |
|
|
for(my $i=0; $i < $max ; $i=$i+2) { |
|
|
print("<tr>",$html_database[$j],$html_database[$j+int($max/2)],"</tr>"); |
|
|
$j++; |
|
|
} |
|
|
|
|
|
} else { |
|
|
for(my $i=0; $i <= $#html_database ; $i=$i+1) { |
|
|
print("<tr>",$html_database[$i],"</tr>"); |
|
|
} |
|
|
} |
|
|
|
|
|
print("</TABLE>\n"); |
|
3090 |
|
|
3091 |
print("</TD></TR>\n"); |
print("</TD></TR>\n"); |
3092 |
|
|
3174 |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n"); |
3175 |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
$Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : ""; |
3176 |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n"); |
3177 |
|
### FIX:: SORT |
3178 |
|
# print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n"); |
3179 |
|
# print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n"); |
3180 |
print("</SELECT> </TD></TR>\n"); |
print("</SELECT> </TD></TR>\n"); |
3181 |
|
|
3182 |
|
|
4071 |
|
|
4072 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <B> Odabrane baze: </B> </TD></TR>\n"); |
print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <B> Odabrane baze: </B> </TD></TR>\n"); |
4073 |
|
|
4074 |
print("<TR><TD ALIGN=LEFT VALIGN=TOP> Oznaèite baze koje uvijek ¾elite pretra¾ivati: </TD> <TD ALIGN=LEFT VALIGN=TOP>\n"); |
print("<TR><TD ALIGN=LEFT VALIGN=TOP> Oznaèite baze koje uvijek ¾elite pretra¾ivati:</TD> <TD ALIGN=LEFT VALIGN=TOP>\n"); |
4075 |
|
|
4076 |
# Parse out the database names and put them into a |
# Parse out the database names and put them into a |
4077 |
# hash table, they should be separated with a '\n' |
# hash table, they should be separated with a '\n' |
|
undef(%Value); |
|
4078 |
if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { |
if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { |
4079 |
@ItemList = split(",", $SelectedDatabases); |
@ItemList = split(",", $SelectedDatabases); |
|
foreach $ItemEntry ( @ItemList ) { |
|
|
$Value{$ItemEntry} = $ItemEntry; |
|
|
} |
|
4080 |
} |
} |
4081 |
|
|
4082 |
$Flag = 0; |
&ShowDatabaseCheckBoxes(@ItemList); |
4083 |
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%\n"); |
|
|
|
|
|
foreach $DatabaseName ( sort(keys(%main::DatabaseDescriptions)) ) { |
|
|
|
|
|
if ( $Flag == 0 ) { |
|
|
print("<TR>"); |
|
|
} |
|
|
|
|
|
$Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1)) ? "CHECKED" : ""; |
|
|
$ItemEntry = &lEncodeURLData($DatabaseName); |
|
|
print("<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"SelectedDatabases\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Get Information about the $main::DatabaseDescriptions{$DatabaseName} database'; return true\"> $main::DatabaseDescriptions{$DatabaseName} </A></TD>\n"); |
|
|
|
|
|
if ( $Flag == 1 ) { |
|
|
print("</TR>"); |
|
|
$Flag = 0; |
|
|
} |
|
|
else { |
|
|
$Flag = 1; |
|
|
} |
|
|
} |
|
|
print("</TABLE>\n"); |
|
4084 |
print("</TD></TR>\n"); |
print("</TD></TR>\n"); |
4085 |
} |
} |
4086 |
|
|
7118 |
} |
} |
7119 |
|
|
7120 |
|
|
7121 |
if ( defined($main::FormData{'GetSearch.x'}) ) { |
if ( defined($main::FormData{'GetSearch'}) ) { |
7122 |
$ENV{'PATH_INFO'} = "/GetSearch"; |
$ENV{'PATH_INFO'} = "/GetSearch"; |
7123 |
delete($main::FormData{'GetSearch.x'}); |
delete($main::FormData{'GetSearch'}); |
7124 |
delete($main::FormData{'GetSearch.y'}); |
delete($main::FormData{'GetSearch'}); |
7125 |
} |
} |
7126 |
|
|
7127 |
if ( defined($main::FormData{'ListSearchHistory.x'}) ) { |
if ( defined($main::FormData{'ListSearchHistory'}) ) { |
7128 |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
$ENV{'PATH_INFO'} = "/ListSearchHistory"; |
7129 |
delete($main::FormData{'ListSearchHistory.x'}); |
delete($main::FormData{'ListSearchHistory'}); |
7130 |
delete($main::FormData{'ListSearchHistory.y'}); |
delete($main::FormData{'ListSearchHistory'}); |
7131 |
} |
} |
7132 |
|
|
7133 |
if ( defined($main::FormData{'ListSavedSearch.x'}) ) { |
if ( defined($main::FormData{'ListSavedSearch'}) ) { |
7134 |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
$ENV{'PATH_INFO'} = "/ListSavedSearch"; |
7135 |
delete($main::FormData{'ListSavedSearch.x'}); |
delete($main::FormData{'ListSavedSearch'}); |
7136 |
delete($main::FormData{'ListSavedSearch.y'}); |
delete($main::FormData{'ListSavedSearch'}); |
7137 |
} |
} |
7138 |
|
|
7139 |
if ( defined($main::FormData{'ListFolder.x'}) ) { |
if ( defined($main::FormData{'ListFolder'}) ) { |
7140 |
$ENV{'PATH_INFO'} = "/ListFolder"; |
$ENV{'PATH_INFO'} = "/ListFolder"; |
7141 |
delete($main::FormData{'ListFolder.x'}); |
delete($main::FormData{'ListFolder'}); |
7142 |
delete($main::FormData{'ListFolder.y'}); |
delete($main::FormData{'ListFolder'}); |
7143 |
} |
} |
7144 |
|
|
7145 |
if ( defined($main::FormData{'GetUserSettings.x'}) ) { |
if ( defined($main::FormData{'GetUserSettings'}) ) { |
7146 |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
$ENV{'PATH_INFO'} = "/GetUserSettings"; |
7147 |
delete($main::FormData{'GetUserSettings.x'}); |
delete($main::FormData{'GetUserSettings'}); |
7148 |
delete($main::FormData{'GetUserSettings.y'}); |
delete($main::FormData{'GetUserSettings'}); |
7149 |
} |
} |
7150 |
|
|
7151 |
|
|
7387 |
} |
} |
7388 |
} |
} |
7389 |
} |
} |
7390 |
|
|
7391 |
|
#-------------------------------------------------------------------------- |
7392 |
|
# show list of all databases |
7393 |
|
# |
7394 |
|
# usage: ShowDatabaseCheckBoxes(@SelectedDatabases) |
7395 |
|
|
7396 |
|
sub ShowDatabaseCheckBoxes { |
7397 |
|
# Parse out the database names and put them into a |
7398 |
|
# hash table, they should be separated with a '\0' |
7399 |
|
my %Value; |
7400 |
|
|
7401 |
|
foreach my $ItemEntry ( @_ ) { |
7402 |
|
$Value{$ItemEntry} = $ItemEntry; |
7403 |
|
} |
7404 |
|
|
7405 |
|
print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n"); |
7406 |
|
|
7407 |
|
my @html_database; |
7408 |
|
|
7409 |
|
foreach my $key ( sort keys %main::DatabaseSort ) { |
7410 |
|
my $DatabaseName = $main::DatabaseSort{$key}; |
7411 |
|
my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : ""; |
7412 |
|
my $ItemEntry = &lEncodeURLData($DatabaseName); |
7413 |
|
if ($main::DatabaseDescriptions{$DatabaseName}) { |
7414 |
|
push @html_database,"<TD ALIGN=LEFT VALIGN=TOP><INPUT TYPE=\"checkbox\" NAME=\"Database\" VALUE=\"$DatabaseName\" $Value> <A HREF=\"$ENV{'SCRIPT_NAME'}/GetDatabaseInfo?Database=$ItemEntry\" OnMouseOver=\"self.status='Informacije io bazi $main::DatabaseDescriptions{$DatabaseName} '; return true\"> $main::DatabaseDescriptions{$DatabaseName} </A> </TD>\n"; |
7415 |
|
} else { |
7416 |
|
push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n"; |
7417 |
|
} |
7418 |
|
} |
7419 |
|
|
7420 |
|
|
7421 |
|
if ($main::ConfigurationData{'output-colums'}) { |
7422 |
|
# create database names in columns |
7423 |
|
|
7424 |
|
my $cols = $main::ConfigurationData{'show-nr-colums'}; |
7425 |
|
my $next = int($#html_database/$cols) ; |
7426 |
|
|
7427 |
|
for(my $i=0; $i <= $next ; $i++) { |
7428 |
|
print("<tr>"); |
7429 |
|
for(my $j=0; $j <= $cols; $j++) { |
7430 |
|
print($html_database[$i+$next*$j+$j] || ''); |
7431 |
|
} |
7432 |
|
print("</tr>"); |
7433 |
|
} |
7434 |
|
|
7435 |
|
} else { |
7436 |
|
for(my $i=0; $i <= $#html_database ; $i=$i+1) { |
7437 |
|
print("<tr>",$html_database[$i],"</tr>"); |
7438 |
|
} |
7439 |
|
} |
7440 |
|
|
7441 |
|
print("</TABLE>\n"); |
7442 |
|
} |