/[webpac-proto]/search/Search.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /search/Search.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Thu Jun 13 17:01:56 2002 UTC revision 1.10 by dpavlin, Mon Jun 24 17:53:11 2002 UTC
# Line 1  Line 1 
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.)
# Line 179  $main::MPSSession = 0; Line 183  $main::MPSSession = 0;
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 = (
# Line 436  sub vSendHTMLHeader { Line 395  sub vSendHTMLHeader {
395          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {
396                  return;                  return;
397          }          }
398            
399          # Bail if we have already sent the header          # Bail if we have already sent the header
400          if ( $main::HeaderSent ) {          if ( $main::HeaderSent ) {
401                  return;                  return;
# Line 461  sub vSendHTMLHeader { Line 420  sub vSendHTMLHeader {
420    
421          # Send the banner          # Send the banner
422          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
423          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");
424          print("</TABLE>\n");  
425            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");
426    
427            print("</TABLE>\n");
428                                    
429    
430          # Set the flag saying that the header has been sent          # Set the flag saying that the header has been sent
# Line 561  sub vSendMenuBar { Line 523  sub vSendMenuBar {
523    
524          if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {          if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {
525                  print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>");                  print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>");
526    
527    
528          }          }
529          else {          else {
530    
531                  print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");                  print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");
532    
533            
534    
535          }          }
536    
537          if ( defined($main::RemoteUser) ) {          if ( defined($main::RemoteUser) ) {
# Line 2146  sub bsDisplaySearchResults { Line 2112  sub bsDisplaySearchResults {
2112          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);
2113          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);
2114          my ($Value, %Value, @Values, $ValueEntry);          my ($Value, %Value, @Values, $ValueEntry);
2115            
2116            
2117          # Check input parameters          # Check input parameters
2118          if ( !defined($SearchResults) || !%Content ) {          if ( !defined($SearchResults) || !%Content ) {
2119                  return (0);                  return (0);
2120          }          }
2121                    
   
           
2122          # Split the search results text into a search results list          # Split the search results text into a search results list
2123          @SearchResults = split(/\n/, $SearchResults);                            @SearchResults = split(/\n/, $SearchResults);                  
                   
2124                    
2125                    
2126          # First we count up the number of results and scoop up          # First we count up the number of results and scoop up
# Line 2467  sub bsDisplaySearchResults { Line 2430  sub bsDisplaySearchResults {
2430          }          }
2431    
2432    
2433            ### FIX:: ADD SORT HERE
2434          if ( $ResultCount > 0 ) {          if ( $ResultCount > 0 ) {
2435    
2436                  # Loop over each entry in the hits list                  # Loop over each entry in the hits list
# Line 2724  sub bsDisplaySearchResults { Line 2687  sub bsDisplaySearchResults {
2687                          # 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
2688                          if ( $HTML ) {                          if ( $HTML ) {
2689                                  print("<!-- resultItem -->\n");                                  print("<!-- resultItem -->\n");
2690                                  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>");
2691                          }                                  # decode some basic html from headline <b> <i>
2692                          else {                                  $Headline =~ s/&lt;(\/?[bi])&gt;/<$1>/g;
2693    
2694                                    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>&nbsp;");
2695                            } else {
2696                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
2697                          }                          }
2698    
2699    if (0) { ## don't display description
2700    
2701                          # Put up the summary                          # Put up the summary
2702                          if ( defined($SummaryText) && ($SummaryText ne "") ) {                          if ( defined($SummaryText) && ($SummaryText ne "") ) {
# Line 2746  sub bsDisplaySearchResults { Line 2713  sub bsDisplaySearchResults {
2713                          if ( ! defined($Remainder) ) {                          if ( ! defined($Remainder) ) {
2714                                  if ( $HTML ) {                                  if ( $HTML ) {
2715                                          print("Formatttt: $MimeTypeName, ");                                          print("Formatttt: $MimeTypeName, ");
2716                            
2717                                  }                                  }
2718                                  else {                                  else {
2719                                          print("    Format: $MimeTypeName, ");                                          print("    Format: $MimeTypeName, ");
# Line 2754  sub bsDisplaySearchResults { Line 2722  sub bsDisplaySearchResults {
2722    
2723    
2724                          # Put up the date if we got it                          # Put up the date if we got it
2725                          if ( defined($Date) && ($Date ne "") ) {                           if ( defined($Date) && ($Date ne "") ) {
2726                                  print("Date: $Date");                                  print("Date: $Date");
2727                                                                    
2728                                  # Put up the time if we got it                                  # Put up the time if we got it
2729                                  if ( defined($Time) && ($Time ne "") ) {                                   if ( defined($Time) && ($Time ne "") ) {
2730                                          print(" $Time");                                          print(" $Time");
2731                                  }                                  }
2732                                                                    
# Line 2889  sub bsDisplaySearchResults { Line 2857  sub bsDisplaySearchResults {
2857                                  }                                  }
2858                                  print("\n");                                  print("\n");
2859    
2860    } #if
2861                                  # Finish off the entry                                  # Finish off the entry
2862                                  if ( $HTML ) {                                  if ( $HTML ) {
2863                                          print("</FONT></TD></TR>\n");                                          print("</FONT></TD></TR>\n");
# Line 3004  sub vGetSearch { Line 2973  sub vGetSearch {
2973    
2974          # Make sure that we send the header          # Make sure that we send the header
2975          $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";
2976          &vSendHTMLHeader($Value, undef);          my $JavaScript = '<SCRIPT LANGUAGE="JavaScript">
2977                    <!-- hide
2978                    function SetChecked(val) {
2979                            dml=document.Search;
2980                            len = dml.elements.length;
2981                            var i=0;
2982                            for( i=0 ; i<len ; i++) {
2983                                    if (dml.elements[i].name==\'Database\') {
2984                                            dml.elements[i].checked=val;
2985                                    }
2986                            }
2987                    }
2988                    // -->
2989                    </SCRIPT>
2990                    ';
2991    
2992            &vSendHTMLHeader($Value, $JavaScript);
2993    
2994          undef(%Value);          undef(%Value);
2995          $Value{'GetSearch'} = "GetSearch";          $Value{'GetSearch'} = "GetSearch";
# Line 3055  sub vGetSearch { Line 3040  sub vGetSearch {
3040    
3041          # Send the start of the form and the buttons          # Send the start of the form and the buttons
3042          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");
3043          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");
3044          print("</TD></TR>\n");          print("</TD></TR>\n");
3045    
3046          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");
# Line 3084  sub vGetSearch { Line 3069  sub vGetSearch {
3069                  print ("<SELECT NAME=\"FieldName${field}\">");                  print ("<SELECT NAME=\"FieldName${field}\">");
3070                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {
3071                          my $ItemEntry = $SearchFieldNames[$i];                          my $ItemEntry = $SearchFieldNames[$i];
3072                          my $Selected = ($main::FormData{"FieldName${field}"} == $ItemEntry || $i == ($field-1)) ? "SELECTED" : "";                          my $Selected = "";
3073                            if ($main::FormData{"FieldName${field}"} && $main::FormData{"FieldName${field}"} eq $ItemEntry) {
3074                                    $Selected = "SELECTED";
3075                            } elsif ($i == ($field - 1)) {
3076                                    $Selected = "SELECTED";
3077                            }
3078                                    
3079                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");
3080                  }                  }
3081                  my $Value = defined($main::FormData{"FieldContent${field}"}) ? "VALUE='".$main::FormData{"FieldContent${field}"}."'" : "";                  my $Value = "";
3082                    if (defined($main::FormData{"FieldContent${field}"})) {
3083                            $Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'";
3084                    }
3085                  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");
3086          }          }
3087    
# Line 3110  sub vGetSearch { Line 3104  sub vGetSearch {
3104          # Database selection          # Database selection
3105          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3106    
3107                  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:
3108                    </td><td>
3109                    <font size=-1>Označi
3110                            <a href=\"javascript:SetChecked(1)\">sve</a>,
3111                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
3112                    </font>
3113                    </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3114                    ");
3115                                    
3116                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
3117                  # hash table, they should be separated with a '\0'                  # hash table, they should be separated with a '\0'
# Line 3124  sub vGetSearch { Line 3125  sub vGetSearch {
3125                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3126                          }                          }
3127                  }                  }
                 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  
   
                         my $max = $#html_database+1 ;  
   
                         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>");  
                         }  
                 }  
3128    
3129                  print("</TABLE>\n");                  &ShowDatabaseCheckBoxes(@ItemList);
3130    
3131                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3132                                    
# Line 3252  sub vGetSearch { Line 3214  sub vGetSearch {
3214          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");
3215          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";
3216          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");
3217    ### FIX:: SORT
3218    #       print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n");
3219    #       print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n");
3220          print("</SELECT> </TD></TR>\n");          print("</SELECT> </TD></TR>\n");
3221    
3222    
# Line 4146  sub vGetUserSettings { Line 4111  sub vGetUserSettings {
4111    
4112                  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");
4113    
4114                  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");
4115                                    
4116                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4117                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
                 undef(%Value);  
4118                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4119                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
                         foreach $ItemEntry ( @ItemList ) {  
                                 $Value{$ItemEntry} = $ItemEntry;  
                         }  
4120                  }                  }
4121                            
4122                  $Flag = 0;                  &ShowDatabaseCheckBoxes(@ItemList);
4123                  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");  
4124                  print("</TD></TR>\n");                  print("</TD></TR>\n");
4125          }          }
4126    
# Line 7486  sub fill_SearchFieldDescriptions_fromDB Line 7427  sub fill_SearchFieldDescriptions_fromDB
7427                  }                  }
7428          }          }
7429  }  }
7430    
7431    #--------------------------------------------------------------------------
7432    # show list of all databases
7433    #
7434    # usage: ShowDatabaseCheckBoxes(@SelectedDatabases)
7435    
7436    sub ShowDatabaseCheckBoxes {
7437            # Parse out the database names and put them into a
7438            # hash table, they should be separated with a '\0'
7439            my %Value;
7440    
7441            foreach my $ItemEntry ( @_ ) {
7442                    $Value{$ItemEntry} = $ItemEntry;
7443            }
7444                    
7445            print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7446    
7447            my @html_database;
7448    
7449            foreach my $key ( sort keys %main::DatabaseSort ) {
7450                    my $DatabaseName = $main::DatabaseSort{$key};
7451                    my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";
7452                    my $ItemEntry = &lEncodeURLData($DatabaseName);
7453                    if ($main::DatabaseDescriptions{$DatabaseName}) {
7454                            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";
7455                    } else {
7456                            push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";
7457                    }
7458            }
7459    
7460    
7461            if ($main::ConfigurationData{'output-colums'}) {
7462                    # create database names in columns
7463    
7464                    my $cols = $main::ConfigurationData{'show-nr-colums'};
7465                    my $next = int($#html_database/$cols) ;
7466    
7467                    for(my $i=0; $i <= $next ; $i++) {
7468                            print("<tr>");
7469                            for(my $j=0; $j <= $cols; $j++) {
7470                                    print($html_database[$i+$next*$j+$j] || '');
7471                            }
7472                            print("</tr>");
7473                    }
7474    
7475            } else {
7476                    for(my $i=0; $i <= $#html_database ; $i=$i+1) {
7477                            print("<tr>",$html_database[$i],"</tr>");
7478                    }
7479            }
7480    
7481            print("</TABLE>\n");
7482    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26