[Bio] / FigWebServices / SearchSkeleton.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/SearchSkeleton.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21, Thu Apr 19 00:03:37 2007 UTC revision 1.22, Sat May 5 02:21:12 2007 UTC
# Line 393  Line 393 
393      # Get the operating system type.      # Get the operating system type.
394      my $osType = $cgi->param('os');      my $osType = $cgi->param('os');
395      # Compute the appropriate EOL marker based on the web user's OS. Unfortunately,      # Compute the appropriate EOL marker based on the web user's OS. Unfortunately,
396      # for Mac used download files are always treated as binary.      # for Mac download files are always treated as binary.
397      my $eol;      my $eol;
398      if ($osType eq 'Windows') {      if ($osType eq 'Windows') {
399          $eol = "\r\n";          $eol = "\r\n";
# Line 545  Line 545 
545      # Get the parameters.      # Get the parameters.
546      my ($shelp, $cgi) = @_;      my ($shelp, $cgi) = @_;
547      # Declare the return variable.      # Declare the return variable.
548      my $retVal;      my $retVal = "";
549        # Check for a title.
550        my $title = $shelp->SearchTitle();
551        if ($title) {
552            $retVal = $cgi->h3($title);
553        }
554      # Extract the result parameters.      # Extract the result parameters.
555      my ($pageSize, $pageNum, $resultCount) = ($cgi->param('PageSize'),      my ($pageSize, $pageNum, $resultCount) = ($cgi->param('PageSize'),
556                                                $cgi->param('Page'),                                                $cgi->param('Page'),
557                                                $cgi->param('ResultCount'));                                                $cgi->param('ResultCount'));
558      # Only proceed if there are actual results.      # Only proceed if there are actual results.
559      if ($resultCount <= 0) {      if ($resultCount <= 0) {
560          $retVal = $cgi->h3("No matches found.");          $retVal .= $cgi->h3("No matches found.");
561      } else {      } else {
562          # Check the state of the session file.          # Check the state of the session file.
563          my $fileName = $shelp->GetCacheFileName();          my $fileName = $shelp->GetCacheFileName();
564          if (! -e $fileName) {          if (! -e $fileName) {
565              $retVal = $cgi->h3("Search session has expired. Please resubmit your query.");              $retVal .= $cgi->h3("Search session has expired. Please resubmit your query.");
566          } else {          } else {
567              # The file is here, so we can open it.              # The file is here, so we can open it.
568              my $sessionH = Open(undef, "<$fileName");              my $sessionH = Open(undef, "<$fileName");
# Line 606  Line 611 
611              # name of the user's operating system.              # name of the user's operating system.
612              my $downloadURL = StatusURL($cgi);              my $downloadURL = StatusURL($cgi);
613              my $dlType;              my $dlType;
614                # Ask the search helper which download types are supported.
615                my @myDlTypes = grep { $shelp->DownloadFormatAvailable($_) } sort keys %DownloadTypes;
616              # First we display the links themselves.              # First we display the links themselves.
617              my $downloadScript =   "<ul>\n";              my $downloadScript =   "<ul>\n";
618              for $dlType (sort keys %DownloadTypes) {              for $dlType (@myDlTypes) {
619                  my $dlDesc = $DownloadTypes{$dlType};                  my $dlDesc = $DownloadTypes{$dlType};
620                  $downloadScript .= "<li><a id=\"dlLink$dlType\">Click here to download these results $dlDesc.</a></li>\n";                  $downloadScript .= "<li><a id=\"dlLink$dlType\">Click here to download these results $dlDesc.</a></li>\n";
621              }              }
# Line 618  Line 625 
625              $downloadScript     .= "<script type=\"text/javascript\">\n" .              $downloadScript     .= "<script type=\"text/javascript\">\n" .
626                                     "  var sysType = checkOS();\n" .                                     "  var sysType = checkOS();\n" .
627                                     "  var linkAnchor;\n";                                     "  var linkAnchor;\n";
628              for $dlType (sort keys %DownloadTypes) {              for $dlType (@myDlTypes) {
629                  $downloadScript .= "  linkAnchor = document.getElementById('dlLink$dlType');\n" .                  $downloadScript .= "  linkAnchor = document.getElementById('dlLink$dlType');\n" .
630                                     "  linkAnchor.href = '$downloadURL;Download=$dlType;os=' + sysType;\n";                                     "  linkAnchor.href = '$downloadURL;Download=$dlType;os=' + sysType;\n";
631              }              }

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3