[Bio] / FigKernelPackages / HTML.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/HTML.pm

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

revision 1.67, Wed Oct 12 21:53:22 2005 UTC revision 1.68, Fri Oct 14 14:00:40 2005 UTC
# Line 12  Line 12 
12  use POSIX;  use POSIX;
13    
14    
15    my $top_link_cache;
16    
17    
18  sub new  sub new
19  {  {
20      my($class) = @_;      my($class) = @_;
# Line 21  Line 24 
24      return bless $self, $class;      return bless $self, $class;
25  }  }
26    
27    sub top_link
28    {
29    
30        #
31        # Determine if this is a toplevel cgi or one in one of the subdirs (currently
32        # just /p2p).
33        #
34    
35        return $top_link_cache if ($top_link_cache);
36    
37        my @parts = split(/\//, $ENV{SCRIPT_NAME});
38        my $top;
39        if ($parts[-2] eq 'FIG')
40        {
41            $top = '.';
42    #       warn "toplevel @parts\n";
43        }
44        elsif ($parts[-3] eq 'FIG')
45        {
46            $top = '..';
47    #       warn "subdir @parts\n";
48        }
49        else
50        {
51            $top = $FIG_Config::cgi_base;
52    #       warn "other @parts\n";
53        }
54    
55        $top_link_cache = $top;
56        return $top;
57    }
58    
59  sub compute_html_header  sub compute_html_header
60  {  {
61      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
# Line 695  Line 730 
730      my($cgi,$fid,$local,$just_url) = @_;      my($cgi,$fid,$local,$just_url) = @_;
731      my($n);      my($n);
732    
733        my $top = top_link();
734    
735      if ($fid =~ /^fig\|\d+\.\d+\.([a-z]+)\.(\d+)/)      if ($fid =~ /^fig\|\d+\.\d+\.([a-z]+)\.(\d+)/)
736      {      {
737          if ($local)          if ($local)
# Line 720  Line 757 
757             my $user = $cgi->param('user');             my $user = $cgi->param('user');
758             if (! $user) { $user = "" }             if (! $user) { $user = "" }
759             my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";             my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";
760             $link = "feature.cgi?feature=$fid&user=$user$trans$sprout";             $link = "$top/feature.cgi?feature=$fid&user=$user$trans$sprout";
761             $link =~ s/[a-z_A-Z0-9]+\.cgi\?/feature.cgi?/;             $link =~ s/[a-z_A-Z0-9]+\.cgi\?/feature.cgi?/;
762          }          }
763          else          else
# Line 740  Line 777 
777    
778              #if (! $cgi_url) { $cgi_url = &FIG::cgi_url }              #if (! $cgi_url) { $cgi_url = &FIG::cgi_url }
779              #$link = $cgi_url . "/protein.cgi?prot=$fid&user=$user$trans$sprout";              #$link = $cgi_url . "/protein.cgi?prot=$fid&user=$user$trans$sprout";
780              $link = "protein.cgi?prot=$fid&user=$user$trans$sprout";              $link = "$top/protein.cgi?prot=$fid&user=$user$trans$sprout";
781              $link =~ s/[a-z_A-Z0-9]+\.cgi\?/protein.cgi?/;              $link =~ s/[a-z_A-Z0-9]+\.cgi\?/protein.cgi?/;
782          }          }
783          if ($just_url)          if ($just_url)

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3