--- search/Search.cgi 2002/06/16 19:39:44 1.4 +++ search/Search.cgi 2002/06/24 16:39:10 1.7 @@ -181,23 +181,6 @@ # -# 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','no', - 'database-for-SearchFieldDescriptions','ps', -); - # read configuration fields require "config.pm"; @@ -435,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 @@ -535,11 +521,15 @@ if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) { print("\"Search\""); + + } else { + print(""); - + + } if ( defined($main::RemoteUser) ) { @@ -2698,12 +2688,13 @@ # 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} )
"); + 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 "") ) { @@ -2720,6 +2711,7 @@ if ( ! defined($Remainder) ) { if ( $HTML ) { print("Formatttt: $MimeTypeName, "); + } else { print(" Format: $MimeTypeName, "); @@ -2728,11 +2720,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"); } @@ -2863,6 +2855,7 @@ } print("\n"); +} #if # Finish off the entry if ( $HTML ) { print("\n"); @@ -2978,7 +2971,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"; @@ -3029,7 +3038,7 @@ # Send the start of the form and the buttons print("\n"); - print("
\n"); + print(" \n"); print("\n"); print("
\n"); @@ -3093,7 +3102,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' @@ -3107,50 +3123,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"); @@ -4132,40 +4106,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"); } @@ -7472,3 +7422,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"); +}