/[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.6 by dpavlin, Mon Jun 24 14:50:44 2002 UTC revision 1.13 by dpavlin, Tue Jun 25 15:02:32 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";  #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 230  $main::QueryReportItemName = "document"; Line 232  $main::QueryReportItemName = "document";
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 = (
# Line 409  sub vSendHTMLHeader { Line 392  sub vSendHTMLHeader {
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="stil.css">';
396          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");
397    
398    
# Line 519  sub vSendMenuBar { Line 503  sub vSendMenuBar {
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>");  
   
507    
508          }          $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : "";
509          else {          print("<INPUT NAME=\"GetSearch\" TYPE=SUBMIT VALUE=\"Forma za pretra¾ivanje\" $DISABLED class=\"navigacija\">");
   
                 print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");  
   
   
   
         }  
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    
# Line 1569  sub sMakeSearchString { Line 1529  sub sMakeSearchString {
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    
# Line 2110  sub bsDisplaySearchResults { Line 2072  sub bsDisplaySearchResults {
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
# Line 2431  sub bsDisplaySearchResults { Line 2390  sub bsDisplaySearchResults {
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
# Line 2689  sub bsDisplaySearchResults { Line 2648  sub bsDisplaySearchResults {
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                                    $Headline =~ s/&lt;(\/?[bi])&gt;/<$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>&nbsp;");                                  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;");
2655                          } else {                          } else {
2656                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
# Line 3102  sub vGetSearch { Line 3064  sub vGetSearch {
3064          # Database selection          # Database selection
3065          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3066    
3067                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3> Odaberite bazu koju ¾elite pretra¾ivati: </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>                  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
# Line 3117  sub vGetSearch { Line 3085  sub vGetSearch {
3085                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3086                          }                          }
3087                  }                  }
                 foreach $ItemEntry ( @ItemList ) {  
                         $Value{$ItemEntry} = $ItemEntry;  
                 }  
                   
   
   
                 $Flag = 0;  
   
                 print('  
                         <a href="javascript:SetChecked(1)">all</a>  
                         <a href="javascript:SetChecked(0)">none</a>  
                         ');  
                   
                 print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\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 $cols = $main::ConfigurationData{'show-nr-colums'};  
                         my $next = int($#html_database/$cols) ;  
   
                         for(my $i=0; $i <= $next ; $i++) {  
                                 print("<tr>");  
                                 for(my $j=0; $j <= $cols; $j++) {  
                                         print($html_database[$i+$next*$j+$j] || '');  
                                 }  
                                 print("</tr>");  
                         }  
   
                 } else {  
                         for(my $i=0; $i <= $#html_database ; $i=$i+1) {  
                                 print("<tr>",$html_database[$i],"</tr>");  
                         }  
                 }  
3088    
3089                  print("</TABLE>\n");                  &ShowDatabaseCheckBoxes(@ItemList);
3090    
3091                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3092                                    
# Line 3254  sub vGetSearch { Line 3174  sub vGetSearch {
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    
# Line 4148  sub vGetUserSettings { Line 4071  sub vGetUserSettings {
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    
# Line 7219  sub vLog { Line 7118  sub vLog {
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    
# Line 7488  sub fill_SearchFieldDescriptions_fromDB Line 7387  sub fill_SearchFieldDescriptions_fromDB
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    }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26