--- search/Search.cgi 2002/06/15 17:37:32 1.2 +++ search/Search.cgi 2002/06/24 16:49:54 1.8 @@ -12,6 +12,8 @@ # of FS Consulting, Inc. * #***************************************************************************** +#print "Content-type: text/plain\n\n"; + #-------------------------------------------------------------------------- # # Author: Francois Schiettecatte (FS Consulting, Inc.) @@ -179,54 +181,8 @@ # -# List of default configuration settings -%main::DefaultSettings = ( - '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-nr-colums',3, -# '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 ; - +# read configuration fields +require "config.pm"; # List of required configuration settings @main::RequiredSettings = ( @@ -437,7 +393,7 @@ if ( ! $ENV{'GATEWAY_INTERFACE'} ) { return; } - + # Bail if we have already sent the header if ( $main::HeaderSent ) { return; @@ -462,8 +418,11 @@ # Send the banner print("\n"); - print("\n"); - print("
\"Return
\n"); +# print(" \"Return \n"); + + print("

Katalozi knjižnica Filozofskog fakulteta

\n"); + + print("\n"); # Set the flag saying that the header has been sent @@ -562,11 +521,15 @@ if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) { print("\"Search\""); + + } else { + print(""); - + + } if ( defined($main::RemoteUser) ) { @@ -2725,12 +2688,16 @@ # Put up the headline and the score, this one links to the document if ( $HTML ) { print("\n"); - print(" $SelectorText $Score $Headline ( $main::DatabaseDescriptions{$Database} )
"); - } - else { + #print(" $SelectorText $Score $Headline ( $main::DatabaseDescriptions{$Database} )
"); + # decode some basic html from headline + $Headline =~ s/<(\/?[bi])>/<$1>/g; + + print(" $SelectorText $Headline
 "); + } else { printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score); } +if (0) { ## don't display description # Put up the summary if ( defined($SummaryText) && ($SummaryText ne "") ) { @@ -2747,6 +2714,7 @@ if ( ! defined($Remainder) ) { if ( $HTML ) { print("Formatttt: $MimeTypeName, "); + } else { print(" Format: $MimeTypeName, "); @@ -2755,11 +2723,11 @@ # Put up the date if we got it - if ( defined($Date) && ($Date ne "") ) { + if ( defined($Date) && ($Date ne "") ) { print("Date: $Date"); # Put up the time if we got it - if ( defined($Time) && ($Time ne "") ) { + if ( defined($Time) && ($Time ne "") ) { print(" $Time"); } @@ -2890,6 +2858,7 @@ } print("\n"); +} #if # Finish off the entry if ( $HTML ) { print("\n"); @@ -3005,7 +2974,23 @@ # Make sure that we send the header $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretraživanje s više kriterija" : "Jednostavno pretraživanje"; - &vSendHTMLHeader($Value, undef); + my $JavaScript = ' + '; + + &vSendHTMLHeader($Value, $JavaScript); undef(%Value); $Value{'GetSearch'} = "GetSearch"; @@ -3056,7 +3041,7 @@ # Send the start of the form and the buttons print("\n"); - print("
\n"); + print(" \n"); print("\n"); print("
\n"); @@ -3085,10 +3070,19 @@ print (" \n"); } @@ -3111,7 +3105,14 @@ # Database selection if ( %main::DatabaseDescriptions ) { - print(" Odaberite bazu koju želite pretraživati: \n"); + print(" Odaberite bazu koju želite pretraživati: + + Označi + sve, + niti jednu. + + + "); # Parse out the database names and put them into a # hash table, they should be separated with a '\0' @@ -3125,50 +3126,8 @@ @ItemList = split(",", $SelectedDatabases); } } - foreach $ItemEntry ( @ItemList ) { - $Value{$ItemEntry} = $ItemEntry; - } - - - - $Flag = 0; - print("\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,"\n"; - } else { - push @html_database,"\n"; - } - } - - if ($main::ConfigurationData{'output-colums'}) { - # create database names in columns - - my $cols = $main::ConfigurationData{'show-nr-colums'}; - my $next = int($#html_database/$cols) ; - - for(my $i=0; $i <= $next ; $i++) { - print(""); - for(my $j=0; $j <= $cols; $j++) { - print($html_database[$i+$next*$j+$j]); - } - print(""); - } - - } else { - for(my $i=0; $i <= $#html_database ; $i=$i+1) { - print("",$html_database[$i],""); - } - } - - print("
$main::DatabaseDescriptions{$DatabaseName} $main::DatabaseDescriptions{$DatabaseName}
\n"); + &ShowDatabaseCheckBoxes(@ItemList); print("\n"); @@ -4150,40 +4109,16 @@ print(" Odabrane baze: \n"); - print(" Označite baze koje uvijek želite pretraživati: \n"); + print(" Označite baze koje uvijek želite pretraživati: \n"); # Parse out the database names and put them into a # hash table, they should be separated with a '\n' - undef(%Value); if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) { @ItemList = split(",", $SelectedDatabases); - foreach $ItemEntry ( @ItemList ) { - $Value{$ItemEntry} = $ItemEntry; - } - } - - $Flag = 0; - print(""); - } - - $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1)) ? "CHECKED" : ""; - $ItemEntry = &lEncodeURLData($DatabaseName); - print("\n"); - - if ( $Flag == 1 ) { - print(""); - $Flag = 0; - } - else { - $Flag = 1; - } } - print("
$main::DatabaseDescriptions{$DatabaseName}
\n"); + + &ShowDatabaseCheckBoxes(@ItemList); + print("\n"); } @@ -7490,3 +7425,56 @@ } } } + +#-------------------------------------------------------------------------- +# show list of all databases +# +# usage: ShowDatabaseCheckBoxes(@SelectedDatabases) + +sub ShowDatabaseCheckBoxes { + # Parse out the database names and put them into a + # hash table, they should be separated with a '\0' + my %Value; + + foreach my $ItemEntry ( @_ ) { + $Value{$ItemEntry} = $ItemEntry; + } + + print("\n"); + + my @html_database; + + foreach my $key ( sort keys %main::DatabaseSort ) { + my $DatabaseName = $main::DatabaseSort{$key}; + my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : ""; + my $ItemEntry = &lEncodeURLData($DatabaseName); + if ($main::DatabaseDescriptions{$DatabaseName}) { + push @html_database,"\n"; + } else { + push @html_database,"\n"; + } + } + + + if ($main::ConfigurationData{'output-colums'}) { + # create database names in columns + + my $cols = $main::ConfigurationData{'show-nr-colums'}; + my $next = int($#html_database/$cols) ; + + for(my $i=0; $i <= $next ; $i++) { + print(""); + for(my $j=0; $j <= $cols; $j++) { + print($html_database[$i+$next*$j+$j] || ''); + } + print(""); + } + + } else { + for(my $i=0; $i <= $#html_database ; $i=$i+1) { + print("",$html_database[$i],""); + } + } + + print("
$main::DatabaseDescriptions{$DatabaseName} $main::DatabaseDescriptions{$DatabaseName}
\n"); +}