/[local]/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.11 by dpavlin, Tue Jun 25 13:48:12 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 1605  sub sMakeSearchString { Line 1571  sub sMakeSearchString {
1571    
1572          # nuke accented chars          # nuke accented chars
1573          $SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;          $SearchString =~ tr/Çüéâäùæç³ëÕõî¬ÄÆÉÅåôö¥µ¦¶ÖÜ«»£èáíóú¡±®¾Êê¼ÈºÁÂ̪¯¿ÃãðÐÏËïÒÍÎìÞÙÓÔÑñò©¹ÀÚàÛýÝþ´­½²·¢¸¨ÿØø/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;
1574            # convert search string to lower case -> make search case insensitive
1575            $SearchString =~ tr/A-Z/a-z/;
1576    
1577          # Add the internal search terms          # Add the internal search terms
1578    
# Line 2146  sub bsDisplaySearchResults { Line 2114  sub bsDisplaySearchResults {
2114          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);          my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);
2115          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);          my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);
2116          my ($Value, %Value, @Values, $ValueEntry);          my ($Value, %Value, @Values, $ValueEntry);
2117            
2118            
2119          # Check input parameters          # Check input parameters
2120          if ( !defined($SearchResults) || !%Content ) {          if ( !defined($SearchResults) || !%Content ) {
2121                  return (0);                  return (0);
2122          }          }
2123                    
   
           
2124          # Split the search results text into a search results list          # Split the search results text into a search results list
2125          @SearchResults = split(/\n/, $SearchResults);                            @SearchResults = split(/\n/, $SearchResults);                  
                   
2126                    
2127                    
2128          # 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 2432  sub bsDisplaySearchResults {
2432          }          }
2433    
2434    
2435            ### FIX:: ADD SORT HERE
2436          if ( $ResultCount > 0 ) {          if ( $ResultCount > 0 ) {
2437    
2438                  # Loop over each entry in the hits list                  # Loop over each entry in the hits list
# Line 2724  sub bsDisplaySearchResults { Line 2689  sub bsDisplaySearchResults {
2689                          # 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
2690                          if ( $HTML ) {                          if ( $HTML ) {
2691                                  print("<!-- resultItem -->\n");                                  print("<!-- resultItem -->\n");
2692                                  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>");
2693                          }                                  # decode some basic html from headline <b> <i>
2694                          else {                                  $Headline =~ s/&lt;(\/?[bi])&gt;/<$1>/g;
2695    
2696                                    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;");
2697                            } else {
2698                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
2699                          }                          }
2700    
2701    if (0) { ## don't display description
2702    
2703                          # Put up the summary                          # Put up the summary
2704                          if ( defined($SummaryText) && ($SummaryText ne "") ) {                          if ( defined($SummaryText) && ($SummaryText ne "") ) {
# Line 2746  sub bsDisplaySearchResults { Line 2715  sub bsDisplaySearchResults {
2715                          if ( ! defined($Remainder) ) {                          if ( ! defined($Remainder) ) {
2716                                  if ( $HTML ) {                                  if ( $HTML ) {
2717                                          print("Formatttt: $MimeTypeName, ");                                          print("Formatttt: $MimeTypeName, ");
2718                            
2719                                  }                                  }
2720                                  else {                                  else {
2721                                          print("    Format: $MimeTypeName, ");                                          print("    Format: $MimeTypeName, ");
# Line 2754  sub bsDisplaySearchResults { Line 2724  sub bsDisplaySearchResults {
2724    
2725    
2726                          # Put up the date if we got it                          # Put up the date if we got it
2727                          if ( defined($Date) && ($Date ne "") ) {                           if ( defined($Date) && ($Date ne "") ) {
2728                                  print("Date: $Date");                                  print("Date: $Date");
2729                                                                    
2730                                  # Put up the time if we got it                                  # Put up the time if we got it
2731                                  if ( defined($Time) && ($Time ne "") ) {                                   if ( defined($Time) && ($Time ne "") ) {
2732                                          print(" $Time");                                          print(" $Time");
2733                                  }                                  }
2734                                                                    
# Line 2889  sub bsDisplaySearchResults { Line 2859  sub bsDisplaySearchResults {
2859                                  }                                  }
2860                                  print("\n");                                  print("\n");
2861    
2862    } #if
2863                                  # Finish off the entry                                  # Finish off the entry
2864                                  if ( $HTML ) {                                  if ( $HTML ) {
2865                                          print("</FONT></TD></TR>\n");                                          print("</FONT></TD></TR>\n");
# Line 3004  sub vGetSearch { Line 2975  sub vGetSearch {
2975    
2976          # Make sure that we send the header          # Make sure that we send the header
2977          $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";
2978          &vSendHTMLHeader($Value, undef);          my $JavaScript = '<SCRIPT LANGUAGE="JavaScript">
2979                    <!-- hide
2980                    function SetChecked(val) {
2981                            dml=document.Search;
2982                            len = dml.elements.length;
2983                            var i=0;
2984                            for( i=0 ; i<len ; i++) {
2985                                    if (dml.elements[i].name==\'Database\') {
2986                                            dml.elements[i].checked=val;
2987                                    }
2988                            }
2989                    }
2990                    // -->
2991                    </SCRIPT>
2992                    ';
2993    
2994            &vSendHTMLHeader($Value, $JavaScript);
2995    
2996          undef(%Value);          undef(%Value);
2997          $Value{'GetSearch'} = "GetSearch";          $Value{'GetSearch'} = "GetSearch";
# Line 3055  sub vGetSearch { Line 3042  sub vGetSearch {
3042    
3043          # Send the start of the form and the buttons          # Send the start of the form and the buttons
3044          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");          print("<TD ALIGN=RIGHT VALIGN=TOP>\n");
3045          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");
3046          print("</TD></TR>\n");          print("</TD></TR>\n");
3047    
3048          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 3071  sub vGetSearch {
3071                  print ("<SELECT NAME=\"FieldName${field}\">");                  print ("<SELECT NAME=\"FieldName${field}\">");
3072                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {
3073                          my $ItemEntry = $SearchFieldNames[$i];                          my $ItemEntry = $SearchFieldNames[$i];
3074                          my $Selected = ($main::FormData{"FieldName${field}"} == $ItemEntry || $i == ($field-1)) ? "SELECTED" : "";                          my $Selected = "";
3075                            if ($main::FormData{"FieldName${field}"} && $main::FormData{"FieldName${field}"} eq $ItemEntry) {
3076                                    $Selected = "SELECTED";
3077                            } elsif ($i == ($field - 1)) {
3078                                    $Selected = "SELECTED";
3079                            }
3080                                    
3081                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");
3082                  }                  }
3083                  my $Value = defined($main::FormData{"FieldContent${field}"}) ? "VALUE='".$main::FormData{"FieldContent${field}"}."'" : "";                  my $Value = "";
3084                    if (defined($main::FormData{"FieldContent${field}"})) {
3085                            $Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'";
3086                    }
3087                  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");
3088          }          }
3089    
# Line 3110  sub vGetSearch { Line 3106  sub vGetSearch {
3106          # Database selection          # Database selection
3107          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3108    
3109                  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:
3110                    </td><td>
3111                    <font size=-1>Oznaèi
3112                            <a href=\"javascript:SetChecked(1)\">sve</a>,
3113                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
3114                    </font>
3115                    </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3116                    ");
3117                                    
3118                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
3119                  # hash table, they should be separated with a '\0'                  # hash table, they should be separated with a '\0'
# Line 3124  sub vGetSearch { Line 3127  sub vGetSearch {
3127                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3128                          }                          }
3129                  }                  }
                 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>");  
                         }  
                 }  
3130    
3131                  print("</TABLE>\n");                  &ShowDatabaseCheckBoxes(@ItemList);
3132    
3133                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3134                                    
# Line 3252  sub vGetSearch { Line 3216  sub vGetSearch {
3216          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");          print("<OPTION VALUE=\"SORT:DATE:DESC\" $Value> Datum - najprije novije\n");
3217          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";          $Value = (defined($main::FormData{'Order'}) && ($main::FormData{'Order'} eq "DATEASCSORT")) ? "SELECTED" : "";
3218          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");          print("<OPTION VALUE=\"SORT:DATE:ASC\" $Value> Datum - najprije starije\n");
3219    ### FIX:: SORT
3220    #       print("<OPTION VALUE=\"SORT:700+:DESC\"> autor\n");
3221    #       print("<OPTION VALUE=\"SORT:200+:DESC\"> naslov\n");
3222          print("</SELECT> </TD></TR>\n");          print("</SELECT> </TD></TR>\n");
3223    
3224    
# Line 4146  sub vGetUserSettings { Line 4113  sub vGetUserSettings {
4113    
4114                  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");
4115    
4116                  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");
4117                                    
4118                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4119                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
                 undef(%Value);  
4120                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4121                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
                         foreach $ItemEntry ( @ItemList ) {  
                                 $Value{$ItemEntry} = $ItemEntry;  
                         }  
4122                  }                  }
4123                            
4124                  $Flag = 0;                  &ShowDatabaseCheckBoxes(@ItemList);
4125                  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");  
4126                  print("</TD></TR>\n");                  print("</TD></TR>\n");
4127          }          }
4128    
# Line 7486  sub fill_SearchFieldDescriptions_fromDB Line 7429  sub fill_SearchFieldDescriptions_fromDB
7429                  }                  }
7430          }          }
7431  }  }
7432    
7433    #--------------------------------------------------------------------------
7434    # show list of all databases
7435    #
7436    # usage: ShowDatabaseCheckBoxes(@SelectedDatabases)
7437    
7438    sub ShowDatabaseCheckBoxes {
7439            # Parse out the database names and put them into a
7440            # hash table, they should be separated with a '\0'
7441            my %Value;
7442    
7443            foreach my $ItemEntry ( @_ ) {
7444                    $Value{$ItemEntry} = $ItemEntry;
7445            }
7446                    
7447            print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7448    
7449            my @html_database;
7450    
7451            foreach my $key ( sort keys %main::DatabaseSort ) {
7452                    my $DatabaseName = $main::DatabaseSort{$key};
7453                    my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";
7454                    my $ItemEntry = &lEncodeURLData($DatabaseName);
7455                    if ($main::DatabaseDescriptions{$DatabaseName}) {
7456                            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";
7457                    } else {
7458                            push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";
7459                    }
7460            }
7461    
7462    
7463            if ($main::ConfigurationData{'output-colums'}) {
7464                    # create database names in columns
7465    
7466                    my $cols = $main::ConfigurationData{'show-nr-colums'};
7467                    my $next = int($#html_database/$cols) ;
7468    
7469                    for(my $i=0; $i <= $next ; $i++) {
7470                            print("<tr>");
7471                            for(my $j=0; $j <= $cols; $j++) {
7472                                    print($html_database[$i+$next*$j+$j] || '');
7473                            }
7474                            print("</tr>");
7475                    }
7476    
7477            } else {
7478                    for(my $i=0; $i <= $#html_database ; $i=$i+1) {
7479                            print("<tr>",$html_database[$i],"</tr>");
7480                    }
7481            }
7482    
7483            print("</TABLE>\n");
7484    }

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

  ViewVC Help
Powered by ViewVC 1.1.26