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

Diff of /FigWebServices/protein.cgi

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

revision 1.79, Sat Jan 29 16:54:05 2005 UTC revision 1.80, Mon Jan 31 07:29:39 2005 UTC
# Line 377  Line 377 
377  sub show_tools {  sub show_tools {
378      my($fig_or_sprout,$cgi,$html,$peg) = @_;      my($fig_or_sprout,$cgi,$html,$peg) = @_;
379    
380        # generate the link to turn tools on or off
381        my $toollink=$cgi->self_url;
382    print STDERR "Got tool link : $toollink\n";
383        $toollink =~ s/[\&\;]fulltools.*[^\;\&]/\&/;
384    print STDERR "Now have tool link : $toollink\n";
385        my $fulltoolbutton  = $cgi->a({href=> $toollink . "&fulltools='1'"}, "Show tool descriptions"); # define this here before we mess with ourself!
386        my $brieftoolbutton = $cgi->a({href=> $toollink}, "Hide tool descriptions");
387    
388      $cgi->param(-name => "request",      $cgi->param(-name => "request",
389                  -value => "use_protein_tool");                  -value => "use_protein_tool");
390      my $url = $cgi->self_url();      my $url = $cgi->self_url();
# Line 386  Line 394 
394          my $tab = [];          my $tab = [];
395    
396          $/ = "\n//\n";          $/ = "\n//\n";
397            my $brieftools; # in case we don't want descriptions and whatnot
398          while (defined($_ = <TMP>)) {          while (defined($_ = <TMP>)) {
399              # allow comment lines in the file              # allow comment lines in the file
400              next if (/^#/);              next if (/^#/);
401              my($tool,$desc) = split(/\n/,$_);              my($tool,$desc) = split(/\n/,$_);
402              # RAE modified this so we can include column headers.              # RAE modified this so we can include column headers.
403              undef($desc) if ($desc eq "//"); # it is a separator              undef($desc) if ($desc eq "//"); # it is a separator
404                # RAE modified again so that we only get a short tool list instead of the big table if that is what we want.
405                if ($cgi->param('fulltools')) {
406              if ($desc) {push(@$tab,["<a href=\"$url\&tool=$tool\">$tool</a>",$desc])}              if ($desc) {push(@$tab,["<a href=\"$url\&tool=$tool\">$tool</a>",$desc])}
407              else {push(@$tab, [["<strong>$tool</strong>", "td colspan=2 align=center"]])}              else {push(@$tab, [["<strong>$tool</strong>", "td colspan=2 align=center"]])}
408          }          }
409                else {
410                 # Why doesn't this work $brieftools .= "<span class=\"tool\" style=\"border: 0 1px solid gray\"><a href=\"$url\&tool=$tool\">$tool</a></span>";
411                 if ($desc) {$brieftools .= " &nbsp; <a href=\"$url\&tool=$tool\">$tool</a> &nbsp;|"}
412                }
413            }
414          close(TMP);          close(TMP);
415          $/ = "\n";          $/ = "\n";
416          push(@$html,&HTML::make_table($col_hdrs,$tab,"Tools to Analyze Protein Sequences"));          if ($brieftools) {push(@$html, $cgi->p("|" . $brieftools), $fulltoolbutton)}
417            else {push(@$html,&HTML::make_table($col_hdrs,$tab,"Tools to Analyze Protein Sequences"), $brieftoolbutton)}
418      }      }
419      $cgi->delete('request');      $cgi->delete('request');
420  }  }

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3