[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.100, Sun Sep 24 15:22:58 2006 UTC revision 1.105, Tue Oct 17 12:32:12 2006 UTC
# Line 57  Line 57 
57    
58      my @parts = split(/\//, $ENV{SCRIPT_NAME});      my @parts = split(/\//, $ENV{SCRIPT_NAME});
59      my $top;      my $top;
60      if ($parts[-2] eq 'FIG')      if (defined $parts[-2] && $parts[-2] eq 'FIG')
61      {      {
62          $top = '.';          $top = '.';
63  #       warn "toplevel @parts\n";  #       warn "toplevel @parts\n";
64      }      }
65      elsif ($parts[-3] eq 'FIG')      elsif (defined $parts[-3] && $parts[-3] eq 'FIG')
66      {      {
67          $top = '..';          $top = '..';
68  #       warn "subdir @parts\n";  #       warn "subdir @parts\n";
# Line 182  Line 182 
182      # Find the HTML header      # Find the HTML header
183      #      #
184    
185      ### TRS ### "tail_name" has no value here.      my $tail_name = $options->{tail_name} ? $options->{tail_name} : "html.tail";
186      my $html_tail_file = ""; # "./Html/$tail_name";      my $html_tail_file = "./Html/$tail_name";
187  #    if (! -f $html_tail_file)      if (! -f $html_tail_file)
188  #    {      {
189  #        $html_tail_file = "$FIG_Config::fig/CGI/Html/$tail_name";          $html_tail_file = "$FIG_Config::fig/CGI/Html/$tail_name";
190  #    }      }
191    
192      my $user = $cgi->param('user') || "";      my $user = $cgi->param('user') || "";
193      my @html_hdr;      my @html_hdr;
# Line 539  Line 539 
539      my(@tab);      my(@tab);
540    
541      my $border = defined $options{border} ? "border=\"$options{border}\"" : "border";      my $border = defined $options{border} ? "border=\"$options{border}\"" : "border";
542      my $width = defined $options{width} ? "width=\"$options{width}\"" : undef;      my $width = defined $options{width} ? "width=\"$options{width}\"" : "";
543      my $class = defined $options{class} ? "class=\"$options{class}\"" : undef;      my $class = defined $options{class} ? "class=\"$options{class}\"" : "";
544      push( @tab, "\n<table $border $width $class>\n",      push( @tab, "\n<table $border $width $class>\n",
545                  "\t<caption><b>$title</b></caption>\n",                  "\t<caption><b>$title</b></caption>\n",
546                  "\t<tr>\n\t\t"                  "\t<tr>\n\t\t"
# Line 808  Line 808 
808      return "<a href=$link>$role</a>";      return "<a href=$link>$role</a>";
809  }  }
810    
811  #  =head2 fid_link
812  # Local means to eliminate the fig|org.peg from the  
813  # text of the link.  Get a link to a fid.
814  #  
815    use: my $html=&HTML::fid_link($cgi, $fid, Local, Just_URL, Full_Path);
816    
817    Local is a boolean means to eliminate the fig|org.peg from the text of the link.
818    
819    Just_URL will only return the URL and not the HTML code. The default is to return the full code.
820    
821    Full_Path is a boolean that will get the full path to the URL not just a relative path. This is required in pages where the base href changes (e.g. if an image is imported like on the metabolic pages).
822    
823    =cut
824    
825    
826  sub fid_link {  sub fid_link {
827      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
828      my($cgi,$fid,$local,$just_url) = @_;      my($cgi,$fid,$local,$just_url,$fullpath) = @_;
829        Trace("Creating link for feature $fid.") if T(4);
830        my $err=join(" ", $cgi,$fid,$local,$just_url,$fullpath);
831    
832      my($n);      my($n);
833    
834      my $top = top_link();      my $top = top_link();
835        if ($fullpath) {$top=$FIG_Config::cgi_url}
836    
837      if ($fid =~ /^fig\|\d+\.\d+\.([a-z]+)\.(\d+)/)      if ($fid =~ /^fig\|\d+\.\d+\.([a-z]+)\.(\d+)/)
838      {      {
# Line 841  Line 856 
856          my $new_framework = $cgi->param('new_framework') ? 1 : 0;          my $new_framework = $cgi->param('new_framework') ? 1 : 0;
857          #added to format prophage and path island links to feature.cgi          #added to format prophage and path island links to feature.cgi
858          my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";          my $sprout = $cgi->param('SPROUT') ? "&SPROUT=1" : "";
859            Trace("Sprout mode is \"$sprout\".") if T(4);
860          if ($1 ne "peg" && ! $sprout)          if ($1 ne "peg" && ! $sprout)
861          {          {
862               Trace("Creating feature link for $fid.") if T(4);
863             my $user = $cgi->param('user');             my $user = $cgi->param('user');
864             if (! $user) { $user = "" }             if (! $user) { $user = "" }
865             $link = "$top/feature.cgi?feature=$fid&user=$user$sprout";             $link = "$top/feature.cgi?feature=$fid&user=$user$sprout";
# Line 850  Line 867 
867          }          }
868          else          else
869          {          {
870                Trace("Creating protein link for $fid.") if T(4);
871              my $user = $cgi->param('user');              my $user = $cgi->param('user');
872              if (! $user) { $user = "" }              if (! $user) { $user = "" }
873              my $trans = $cgi->param('translate') ? "&translate=1" : "";              my $trans = $cgi->param('translate') ? "&translate=1" : "";
# Line 984  Line 1002 
1002      for ($j=$i-1; ($j > 0) && ($out->[$j] !~ /FIG search/); $j--) {}      for ($j=$i-1; ($j > 0) && ($out->[$j] !~ /FIG search/); $j--) {}
1003      if ($j > 0)      if ($j > 0)
1004      {      {
1005           ### TRS ###          #
1006  #        my @tmp = `cat $html_tail_file`;          # Hm. We would have tried using the options here:
1007  #        my $n = @tmp;          # my $tail_name = $options{tail_name} ? $options{tail_name} : "html.tail";
1008  #        splice(@$out,$j-$n,$n+1);          # but they're not passed in. So use the default html.tail.
1009            #
1010            my $html_tail_file = "./Html/html.tail";
1011            my @tmp = `cat $html_tail_file`;
1012            my $n = @tmp;
1013            splice(@$out,$j-$n,$n+1);
1014      }      }
1015  }  }
1016    
# Line 1397  Line 1420 
1420      {      {
1421          return "<a href='http://www.gene.ucl.ac.uk/cgi-bin/nomenclature/searchgenes.pl?field=symbol&anchor=equals&match=$1&symbol_search=Search&number=50&format=html&sortby=symbol' target=_blank>$hgnc</a>";          return "<a href='http://www.gene.ucl.ac.uk/cgi-bin/nomenclature/searchgenes.pl?field=symbol&anchor=equals&match=$1&symbol_search=Search&number=50&format=html&sortby=symbol' target=_blank>$hgnc</a>";
1422      }      }
1423      ### TRS ###: was $mim, changed to $hgnc  
1424      return $hgnc;      return $hgnc;
1425  }  }
1426    
# Line 1678  Line 1701 
1701    
1702   my @files=("SEED.rss");   my @files=("SEED.rss");
1703   if ($args->{"type"}) {   if ($args->{"type"}) {
     ### TRS ### "$type" had no value here, so guessed what it should be.  
1704      my $type = $args->{type};      my $type = $args->{type};
1705      push @files, "SEED.$type.rss"      push @files, "SEED.$type.rss"
1706  }  }

Legend:
Removed from v.1.100  
changed lines
  Added in v.1.105

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3