/[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.6 by dpavlin, Mon Jun 24 14:50:44 2002 UTC revision 1.7 by dpavlin, Mon Jun 24 16:39:10 2002 UTC
# Line 3102  sub vGetSearch { Line 3102  sub vGetSearch {
3102          # Database selection          # Database selection
3103          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3104    
3105                  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:
3106                    </td><td>
3107                    <font size=-1>Označi
3108                            <a href=\"javascript:SetChecked(1)\">sve</a>,
3109                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
3110                    </font>
3111                    </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3112                  ");                  ");
3113                                    
3114                  # 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 3123  sub vGetSearch {
3123                                  @ItemList = split(",", $SelectedDatabases);                                  @ItemList = split(",", $SelectedDatabases);
3124                          }                          }
3125                  }                  }
                 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  
3126    
3127                          my $cols = $main::ConfigurationData{'show-nr-colums'};                  &ShowDatabaseCheckBoxes(@ItemList);
                         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");  
3128    
3129                  print("</TD></TR>\n");                  print("</TD></TR>\n");
3130                                    
# Line 4148  sub vGetUserSettings { Line 4106  sub vGetUserSettings {
4106    
4107                  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");
4108    
4109                  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");
4110                                    
4111                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4112                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
                 undef(%Value);  
4113                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4114                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
                         foreach $ItemEntry ( @ItemList ) {  
                                 $Value{$ItemEntry} = $ItemEntry;  
                         }  
                 }  
                   
                 $Flag = 0;  
                 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;  
                         }  
4115                  }                  }
4116                  print("</TABLE>\n");          
4117                    &ShowDatabaseCheckBoxes(@ItemList);
4118            
4119                  print("</TD></TR>\n");                  print("</TD></TR>\n");
4120          }          }
4121    
# Line 7488  sub fill_SearchFieldDescriptions_fromDB Line 7422  sub fill_SearchFieldDescriptions_fromDB
7422                  }                  }
7423          }          }
7424  }  }
7425    
7426    #--------------------------------------------------------------------------
7427    # show list of all databases
7428    #
7429    # usage: ShowDatabaseCheckBoxes(@SelectedDatabases)
7430    
7431    sub ShowDatabaseCheckBoxes {
7432            # Parse out the database names and put them into a
7433            # hash table, they should be separated with a '\0'
7434            my %Value;
7435    
7436            foreach my $ItemEntry ( @_ ) {
7437                    $Value{$ItemEntry} = $ItemEntry;
7438            }
7439                    
7440            print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7441    
7442            my @html_database;
7443    
7444            foreach my $key ( sort keys %main::DatabaseSort ) {
7445                    my $DatabaseName = $main::DatabaseSort{$key};
7446                    my $Value = ((defined($Value{$DatabaseName})) || (scalar(keys(%main::DatabaseDescriptions)) == 1) || !defined($main::RemoteUser) ) ? "CHECKED" : "";
7447                    my $ItemEntry = &lEncodeURLData($DatabaseName);
7448                    if ($main::DatabaseDescriptions{$DatabaseName}) {
7449                            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";
7450                    } else {
7451                            push @html_database,"<td align=left valign=top>$main::DatabaseDescriptions{$DatabaseName}</td>\n";
7452                    }
7453            }
7454    
7455    
7456            if ($main::ConfigurationData{'output-colums'}) {
7457                    # create database names in columns
7458    
7459                    my $cols = $main::ConfigurationData{'show-nr-colums'};
7460                    my $next = int($#html_database/$cols) ;
7461    
7462                    for(my $i=0; $i <= $next ; $i++) {
7463                            print("<tr>");
7464                            for(my $j=0; $j <= $cols; $j++) {
7465                                    print($html_database[$i+$next*$j+$j] || '');
7466                            }
7467                            print("</tr>");
7468                    }
7469    
7470            } else {
7471                    for(my $i=0; $i <= $#html_database ; $i=$i+1) {
7472                            print("<tr>",$html_database[$i],"</tr>");
7473                    }
7474            }
7475    
7476            print("</TABLE>\n");
7477    }

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

  ViewVC Help
Powered by ViewVC 1.1.26