[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.83, Wed Jan 25 02:20:42 2006 UTC revision 1.89, Wed Apr 5 18:42:12 2006 UTC
# Line 78  Line 78 
78      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
79      my($additional_insert, $user, %options ) = @_;      my($additional_insert, $user, %options ) = @_;
80    
81        local $/ = "\n";
82    
83      my $header_name = $options{header_name} ? $options{header_name} : "html.hdr";      my $header_name = $options{header_name} ? $options{header_name} : "html.hdr";
84      my $tail_name = $options{tail_name} ? $options{tail_name} : "html.tail";      my $tail_name = $options{tail_name} ? $options{tail_name} : "html.tail";
85    
# Line 156  Line 158 
158  sub show_page {  sub show_page {
159      #warn "SHOWPAGE: cgi=", Dumper(@_);      #warn "SHOWPAGE: cgi=", Dumper(@_);
160      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
161      my($cgi,$html,$no_home, $alt_header, $css, $javasrc, $cookie) = @_;      my($cgi,$html,$no_home, $alt_header, $css, $javasrc, $cookie, $options) = @_;
162      my $i;      my $i;
163    
164      my $top = top_link();      my $top = top_link();
# Line 171  Line 173 
173      #               the sheet named "Sans Serif" is considered to the the first alternate, and if this is not set it points at $FIG_Config::HTML/css/sanserif.css      #               the sheet named "Sans Serif" is considered to the the first alternate, and if this is not set it points at $FIG_Config::HTML/css/sanserif.css
174      #     $javasrc is a reference to an array of URLs to javascripts to be included (e.g. "FIG/Html/css/styleswitcher.js")      #     $javasrc is a reference to an array of URLs to javascripts to be included (e.g. "FIG/Html/css/styleswitcher.js")
175      #     $cookie is the name and value of the cookie to set. Note that you should probably use raelib->cookie to get/set your cookies      #     $cookie is the name and value of the cookie to set. Note that you should probably use raelib->cookie to get/set your cookies
176        #     $options is a reference to a hash of options that you can pass around the pages
177      #      #
178      # Find the HTML header      # Find the HTML header
179      #      #
# Line 189  Line 192 
192      }      }
193      else      else
194      {      {
195          @html_hdr = compute_html_header(undef,$user);          @html_hdr = compute_html_header(undef,$user,%$options);
196      }      }
197    
198      # RAE: I am offloading the handling of cookies to CGI.pm since I don't know how they are set up.      # RAE: I am offloading the handling of cookies to CGI.pm since I don't know how they are set up.
# Line 845  Line 848 
848          }          }
849          else          else
850          {          {
851              return "<a href=$link>$n</a>";              return "<a href='$link'>$n</a>";
852          }          }
853      }      }
854      return $fid;      return $fid;
# Line 988  Line 991 
991          $after = $3;          $after = $3;
992          return &set_prot_links($cgi,$before) . &HTML::gi_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::gi_link($cgi,$match) . &set_prot_links($cgi,$after);
993      }      }
994      elsif ($x =~ /^(.*)(tigr\|[0-9a-zA-Z]+)(.*)/s)      elsif ($x =~ /^(.*)(tigr\|\w+)(.*)/s)
995      {      {
996          $before = $1;          $before = $1;
997          $match = $2;          $match = $2;
998          $after = $3;          $after = $3;
999          return &set_prot_links($cgi,$before) . &HTML::tigr_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::tigr_link($cgi,$match) . &set_prot_links($cgi,$after);
1000      }      }
1001      elsif ($x =~ /^(.*)\beric\|\w+\b(.*)/s)      elsif ($x =~ /^(.*)\b(eric\|\S+)\b(.*)/s)
1002      {      {
1003          $before = $1;          $before = $1;
1004          $match = $2;          $match = $2;
# Line 1091  Line 1094 
1094          $after = $3;          $after = $3;
1095          return &set_prot_links($cgi,$before) . &HTML::mim_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::mim_link($cgi,$match) . &set_prot_links($cgi,$after);
1096      }      }
1097      elsif ($x =~ /^(.*)(UniGene:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(HGNC:[a-zA-Z_0-9\.]+)(.*)/s)
1098      {      {
1099          $before = $1;          $before = $1;
1100          $match = $2;          $match = $2;
1101          $after = $3;          $after = $3;
1102          return &set_prot_links($cgi,$before) . &HTML::unigene_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::hgnc_link($cgi,$match) . &set_prot_links($cgi,$after);
1103      }      }
1104      elsif ($x =~ /^(.*)(IPI:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(UniGene:[a-zA-Z_0-9\.]+)(.*)/s)
1105      {      {
1106          $before = $1;          $before = $1;
1107          $match = $2;          $match = $2;
1108          $after = $3;          $after = $3;
1109          return &set_prot_links($cgi,$before) . &HTML::ipi_link($cgi,$match) . &set_prot_links($cgi,$after);          return &set_prot_links($cgi,$before) . &HTML::unigene_link($cgi,$match) . &set_prot_links($cgi,$after);
1110      }      }
1111    # IPI stopped working. turn off for now.
1112    #    elsif ($x =~ /^(.*)(IPI:[a-zA-Z_0-9\.]+)(.*)/s)
1113    #    {
1114    #        $before = $1;
1115    #        $match = $2;
1116    #        $after = $3;
1117    #        return &set_prot_links($cgi,$before) . &HTML::ipi_link($cgi,$match) . &set_prot_links($cgi,$after);
1118    #    }
1119      elsif ($x =~ /^(.*)(WP:[a-zA-Z_0-9\.]+)(.*)/s)      elsif ($x =~ /^(.*)(WP:[a-zA-Z_0-9\.]+)(.*)/s)
1120      {      {
1121          #wormbase          #wormbase
# Line 1295  Line 1306 
1306      {      {
1307          my $what=$1;          my $what=$1;
1308          my $key=$2;          my $key=$2;
1309          my $idx="all";          my $idx="All";
1310          if ($what eq "EnsemblGene") { $idx = "Gene" }          if ($what eq "EnsemblGene") { $idx = "Gene" }
1311          if ($what eq "EnsemblTranscript") { $idx = "all" }          if ($what eq "EnsemblTranscript") { $idx = "All" }
1312          if ($what eq "EnsemblProtein") { $idx = "all" }          if ($what eq "EnsemblProtein") { $idx = "All" }
1313    
1314          #I really want to get right to the transcript and peptide pages, but          #I really want to get right to the transcript and peptide pages, but
1315          #can't see how to do that without knowing the org name too, which          #can't see how to do that without knowing the org name too, which
1316          #I don't know at this point. (ensembl org name, not real org name)          #I don't know at this point. (ensembl org name, not real org name)
1317    
1318          return "<a href=http://www.ensembl.org/Homo_sapiens/textview?species=all&idx=$idx&q=$key>$ensembl</a>";          return "<a href=http://www.ensembl.org/Homo_sapiens/searchview?species=all&idx=$idx&q=$key>$ensembl</a>";
1319      }      }
1320      return $ensembl;      return $ensembl;
1321  }  }
# Line 1331  Line 1342 
1342      return $mim;      return $mim;
1343  }  }
1344    
1345    sub hgnc_link {
1346        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1347        my($cgi,$hgnc) = @_;
1348    
1349        if ($hgnc =~ /^HGNC:(\S+)$/)
1350        {
1351            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>$hgnc</a>";
1352        }
1353        return $mim;
1354    }
1355    
1356  sub unigene_link {  sub unigene_link {
1357      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
1358      my($cgi,$unigene) = @_;      my($cgi,$unigene) = @_;
# Line 1463  Line 1485 
1485      my($sub_link);      my($sub_link);
1486    
1487      my $user = $cgi->param('user');      my $user = $cgi->param('user');
     if ($user)  
     {  
1488          my $esc_sub = uri_escape( $sub );          my $esc_sub = uri_escape( $sub );
1489          $sub =~ s/\_/ /g;          $sub =~ s/\_/ /g;
1490        if ($user)
1491        {
1492          $sub_link = "<a href=./subsys.cgi?ssa_name=$esc_sub&request=show_ssa&user=$user>$sub</a>";          $sub_link = "<a href=./subsys.cgi?ssa_name=$esc_sub&request=show_ssa&user=$user>$sub</a>";
1493      }      }
1494      else      else
1495      {      {
1496          $sub_link = $sub;          $sub_link = "<a href=\"display_subsys.cgi?ssa_name=$esc_sub&request=show_ssa&sort=by_phylo\">$sub</a>";
1497      }      }
1498      return $sub_link;      return $sub_link;
1499  }  }

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.89

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3