/[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.10 by dpavlin, Mon Jun 24 17:53:11 2002 UTC revision 1.16 by dpavlin, Tue Jun 25 16:28:40 2002 UTC
# Line 232  $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 411  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="'.$main::ConfigurationData{'image-base-path'}.'/stil.css">';
396          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");          print("</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n");
397    
398    
# Line 521  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>");  
   
   
         }  
         else {  
   
                 print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");  
   
   
507    
508          }          $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : "";
509            print("<INPUT NAME=\"GetSearch\" TYPE=SUBMIT VALUE=\"Pretra¾ivanje\" $DISABLED class=\"navigacija${DISABLED}\">");
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=\"Prija¹nja pretra¾ivanja\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                 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=\"Spremljena pretra¾ivanja\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                 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=\"Korisnièki folderi\" $DISABLED class=\"navigacija${DISABLED}\">";
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=\"Korisnièke postavke\" $DISABLED class=\"navigacija${DISABLED}\">";
                 }  
                   
                 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 1571  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 2972  sub vGetSearch { Line 2932  sub vGetSearch {
2932    
2933    
2934          # Make sure that we send the header          # Make sure that we send the header
2935          $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Pretra¾ivanje s vi¹e kriterija" : "Jednostavno pretra¾ivanje";          $Value = ($ENV{'PATH_INFO'} eq "/GetExpandedSearch") ? "Slo¾eno pretra¾ivanje" : "Jednostavno pretra¾ivanje";
         my $JavaScript = '<SCRIPT LANGUAGE="JavaScript">  
                 <!-- hide  
                 function SetChecked(val) {  
                         dml=document.Search;  
                         len = dml.elements.length;  
                         var i=0;  
                         for( i=0 ; i<len ; i++) {  
                                 if (dml.elements[i].name==\'Database\') {  
                                         dml.elements[i].checked=val;  
                                 }  
                         }  
                 }  
                 // -->  
                 </SCRIPT>  
                 ';  
2936    
2937          &vSendHTMLHeader($Value, $JavaScript);          &vSendHTMLHeader($Value, $main::JavaScript_SetChecked);
2938    
2939          undef(%Value);          undef(%Value);
2940          $Value{'GetSearch'} = "GetSearch";          $Value{'GetSearch'} = "GetSearch";
# Line 3028  sub vGetSearch { Line 2973  sub vGetSearch {
2973    
2974          if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) {          if ( $ENV{'PATH_INFO'} eq "/GetExpandedSearch" ) {
2975                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n");                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetSimpleSearch\">\n");
2976                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'collapse'}\" BORDER=0 TYPE=IMAGE> Kliknite na trokutiæ da biste suzili formu.\n");                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'collapse'}\" BORDER=0 TYPE=IMAGE> Jednostavo pretra¾ivanje (kliknite na trokutiæ)\n");
2977          }          }
2978          else {          else {
2979                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n");                  print("<INPUT TYPE=HIDDEN NAME=\"Action\" VALUE=\"GetExpandedSearch\">\n");
2980                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'expand'}\" BORDER=0 TYPE=IMAGE>  Kliknite na trokutiæ da biste pro¹irili formu.\n");                  print("<INPUT SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'expand'}\" BORDER=0 TYPE=IMAGE> Slo¾eno pretra¾ivanje (kliknite na trokutiæ)\n");
2981          }          }
2982          print("</FORM></TD>\n");          print("</FORM></TD>\n");
2983                    
# Line 3104  sub vGetSearch { Line 3049  sub vGetSearch {
3049          # Database selection          # Database selection
3050          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3051    
3052                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju ¾elite pretra¾ivati:                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju ¾elite pretra¾ivati:</TD></TR>
3053                  </td><td>                  <TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
                 <font size=-1>Oznaèi  
                         <a href=\"javascript:SetChecked(1)\">sve</a>,  
                         <a href=\"javascript:SetChecked(0)\">niti jednu</a>.  
                 </font>  
                 </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>  
3054                  ");                  ");
3055                                    
3056                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
# Line 4011  sub vGetUserSettings { Line 3951  sub vGetUserSettings {
3951    
3952    
3953          # Make sure that we send the header          # Make sure that we send the header
3954          &vSendHTMLHeader("My Settings", undef);          &vSendHTMLHeader("My Settings", $main::JavaScript_SetChecked);
3955          undef(%Value);          undef(%Value);
3956          $Value{'GetUserSettings'} = "GetUserSettings";          $Value{'GetUserSettings'} = "GetUserSettings";
3957          &vSendMenuBar(%Value);          &vSendMenuBar(%Value);
# Line 4049  sub vGetUserSettings { Line 3989  sub vGetUserSettings {
3989          print("<H3> Postavke: </H3>\n");          print("<H3> Postavke: </H3>\n");
3990    
3991          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
3992          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" METHOD=POST>\n");          print("<FORM ACTION=\"$ENV{'SCRIPT_NAME'}/SetUserSettings\" NAME=\"Search\" METHOD=POST>\n");
3993                                    
3994          # Send the buttons          # Send the buttons
3995          print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=2> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\"> <INPUT TYPE=SUBMIT VALUE=\"Saèuvaj postavke\"> </TD></TR>\n");          print("<TR><TD ALIGN=RIGHT VALIGN=TOP COLSPAN=2> <INPUT TYPE=RESET VALUE=\"Pobri¹i polja\"> <INPUT TYPE=SUBMIT VALUE=\"Saèuvaj postavke\"> </TD></TR>\n");
# Line 4111  sub vGetUserSettings { Line 4051  sub vGetUserSettings {
4051    
4052                  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");
4053    
4054                  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 COLSPAN=2> Oznaèite baze koje uvijek ¾elite pretra¾ivati:</TD></TR><TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=2>\n");
4055                                    
4056                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
4057                  # hash table, they should be separated with a '\n'                  # hash table, they should be separated with a '\n'
4058                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {                  if ( defined($SelectedDatabases) && ($SelectedDatabases ne "") ) {
4059                          @ItemList = split(",", $SelectedDatabases);                          @ItemList = split(",", $SelectedDatabases);
4060                  }                  }
4061            
4062                  &ShowDatabaseCheckBoxes(@ItemList);                  &ShowDatabaseCheckBoxes(@ItemList);
4063                    
4064                  print("</TD></TR>\n");                  print("</TD></TR>\n");
# Line 4264  sub vSetUserSettings { Line 4204  sub vSetUserSettings {
4204          $Value{'UserName'} = $main::FormData{'UserName'};          $Value{'UserName'} = $main::FormData{'UserName'};
4205          $Value{'EmailAddress'} = $main::FormData{'EmailAddress'};          $Value{'EmailAddress'} = $main::FormData{'EmailAddress'};
4206          $Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'};          $Value{'DefaultSearch'} = $main::FormData{'DefaultSearch'};
4207          $Value{'SelectedDatabases'} = $main::FormData{'SelectedDatabases'};          $Value{'SelectedDatabases'} = $main::FormData{'Database'};
4208          if ( defined($Value{'SelectedDatabases'}) ) {          if ( defined($Value{'SelectedDatabases'}) ) {
4209                  $Value{'SelectedDatabases'} =~ s/\0/,/g;                  $Value{'SelectedDatabases'} =~ s/\0/,/g;
4210          }          }
# Line 7158  sub vLog { Line 7098  sub vLog {
7098                  }                  }
7099                                    
7100    
7101                  if ( defined($main::FormData{'GetSearch.x'}) ) {                  if ( defined($main::FormData{'GetSearch'}) ) {
7102                          $ENV{'PATH_INFO'} = "/GetSearch";                          $ENV{'PATH_INFO'} = "/GetSearch";
7103                          delete($main::FormData{'GetSearch.x'});                          delete($main::FormData{'GetSearch'});
7104                          delete($main::FormData{'GetSearch.y'});                          delete($main::FormData{'GetSearch'});
7105                  }                  }
7106                                    
7107                  if ( defined($main::FormData{'ListSearchHistory.x'}) ) {                  if ( defined($main::FormData{'ListSearchHistory'}) ) {
7108                          $ENV{'PATH_INFO'} = "/ListSearchHistory";                          $ENV{'PATH_INFO'} = "/ListSearchHistory";
7109                          delete($main::FormData{'ListSearchHistory.x'});                          delete($main::FormData{'ListSearchHistory'});
7110                          delete($main::FormData{'ListSearchHistory.y'});                          delete($main::FormData{'ListSearchHistory'});
7111                  }                  }
7112                                    
7113                  if ( defined($main::FormData{'ListSavedSearch.x'}) ) {                  if ( defined($main::FormData{'ListSavedSearch'}) ) {
7114                          $ENV{'PATH_INFO'} = "/ListSavedSearch";                          $ENV{'PATH_INFO'} = "/ListSavedSearch";
7115                          delete($main::FormData{'ListSavedSearch.x'});                          delete($main::FormData{'ListSavedSearch'});
7116                          delete($main::FormData{'ListSavedSearch.y'});                          delete($main::FormData{'ListSavedSearch'});
7117                  }                  }
7118                                    
7119                  if ( defined($main::FormData{'ListFolder.x'}) ) {                  if ( defined($main::FormData{'ListFolder'}) ) {
7120                          $ENV{'PATH_INFO'} = "/ListFolder";                          $ENV{'PATH_INFO'} = "/ListFolder";
7121                          delete($main::FormData{'ListFolder.x'});                          delete($main::FormData{'ListFolder'});
7122                          delete($main::FormData{'ListFolder.y'});                          delete($main::FormData{'ListFolder'});
7123                  }                  }
7124                                    
7125                  if ( defined($main::FormData{'GetUserSettings.x'}) ) {                  if ( defined($main::FormData{'GetUserSettings'}) ) {
7126                          $ENV{'PATH_INFO'} = "/GetUserSettings";                          $ENV{'PATH_INFO'} = "/GetUserSettings";
7127                          delete($main::FormData{'GetUserSettings.x'});                          delete($main::FormData{'GetUserSettings'});
7128                          delete($main::FormData{'GetUserSettings.y'});                          delete($main::FormData{'GetUserSettings'});
7129                  }                  }
7130                                    
7131    
# Line 7443  sub ShowDatabaseCheckBoxes { Line 7383  sub ShowDatabaseCheckBoxes {
7383          }          }
7384                                    
7385          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
7386            print "<tr><td colspan=3 align=\"center\">
7387                    <font size=-1>Oznaèi
7388                            <a href=\"javascript:SetChecked(1)\">sve</a>,
7389                            <a href=\"javascript:SetChecked(0)\">niti jednu</a>.
7390                    </font>
7391                    </td></tr>";
7392    
7393          my @html_database;          my @html_database;
7394    

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

  ViewVC Help
Powered by ViewVC 1.1.26