/[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.8 by dpavlin, Mon Jun 24 16:49:54 2002 UTC
# Line 2689  sub bsDisplaySearchResults { Line 2689  sub bsDisplaySearchResults {
2689                          if ( $HTML ) {                          if ( $HTML ) {
2690                                  print("<!-- resultItem -->\n");                                  print("<!-- resultItem -->\n");
2691                                  #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>");
2692                                    # decode some basic html from headline <b> <i>
2693                                    $Headline =~ s/&lt;(\/?[bi])&gt;/<$1>/g;
2694    
2695                                  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;");
2696                          } else {                          } else {
2697                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
# Line 3102  sub vGetSearch { Line 3105  sub vGetSearch {
3105          # Database selection          # Database selection
3106          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3107    
3108                  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:
3109                    </td><td>
3110                    <font size=-1>Označi
3111                            <a href=\"javascript:SetChecked(1)\">sve</a>,
3112                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
3113                    </font>
3114                    </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3115                  ");                  ");
3116                                    
3117                  # 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 3126  sub vGetSearch {
3126                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3127                          }                          }
3128                  }                  }
                 foreach $ItemEntry ( @ItemList ) {  
                         $Value{$ItemEntry} = $ItemEntry;  
                 }  
                   
   
3129    
3130                  $Flag = 0;                  &ShowDatabaseCheckBoxes(@ItemList);
   
                 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>");  
                         }  
                 }  
   
                 print("</TABLE>\n");  
3131    
3132                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3133                                    
# Line 4148  sub vGetUserSettings { Line 4109  sub vGetUserSettings {
4109    
4110                  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");
4111    
4112                  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");
4113                                    
4114                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4115                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
                 undef(%Value);  
4116                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4117                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
                         foreach $ItemEntry ( @ItemList ) {  
                                 $Value{$ItemEntry} = $ItemEntry;  
                         }  
4118                  }                  }
4119                            
4120                  $Flag = 0;                  &ShowDatabaseCheckBoxes(@ItemList);
4121                  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");  
4122                  print("</TD></TR>\n");                  print("</TD></TR>\n");
4123          }          }
4124    
# Line 7488  sub fill_SearchFieldDescriptions_fromDB Line 7425  sub fill_SearchFieldDescriptions_fromDB
7425                  }                  }
7426          }          }
7427  }  }
7428    
7429    #--------------------------------------------------------------------------
7430    # show list of all databases
7431    #
7432    # usage: ShowDatabaseCheckBoxes(@SelectedDatabases)
7433    
7434    sub ShowDatabaseCheckBoxes {
7435            # Parse out the database names and put them into a
7436            # hash table, they should be separated with a '\0'
7437            my %Value;
7438    
7439            foreach my $ItemEntry ( @_ ) {
7440                    $Value{$ItemEntry} = $ItemEntry;
7441            }
7442                    
7443            print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7444    
7445            my @html_database;
7446    
7447            foreach my $key ( sort keys %main::DatabaseSort ) {
7448                    my $DatabaseName = $main::DatabaseSort{$key};
7449                    my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";
7450                    my $ItemEntry = &lEncodeURLData($DatabaseName);
7451                    if ($main::DatabaseDescriptions{$DatabaseName}) {
7452                            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";
7453                    } else {
7454                            push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";
7455                    }
7456            }
7457    
7458    
7459            if ($main::ConfigurationData{'output-colums'}) {
7460                    # create database names in columns
7461    
7462                    my $cols = $main::ConfigurationData{'show-nr-colums'};
7463                    my $next = int($#html_database/$cols) ;
7464    
7465                    for(my $i=0; $i <= $next ; $i++) {
7466                            print("<tr>");
7467                            for(my $j=0; $j <= $cols; $j++) {
7468                                    print($html_database[$i+$next*$j+$j] || '');
7469                            }
7470                            print("</tr>");
7471                    }
7472    
7473            } else {
7474                    for(my $i=0; $i <= $#html_database ; $i=$i+1) {
7475                            print("<tr>",$html_database[$i],"</tr>");
7476                    }
7477            }
7478    
7479            print("</TABLE>\n");
7480    }

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

  ViewVC Help
Powered by ViewVC 1.1.26