[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.39, Sun Mar 20 00:08:39 2005 UTC revision 1.41, Thu Apr 28 20:56:37 2005 UTC
# Line 5  Line 5 
5  use Data::Dumper;  use Data::Dumper;
6  use LWP::UserAgent;  use LWP::UserAgent;
7  use LWP::Simple;  use LWP::Simple;
8    use URI::Escape;  # uri_escape()
9  use URI::URL;  use URI::URL;
10  use HTTP::Request::Common;  use HTTP::Request::Common;
11  use POSIX;  use POSIX;
# Line 250  Line 251 
251    
252      # RAE:      # RAE:
253      # Add css here      # Add css here
254      # Note that at the moment I define these two sheets here. I think this should be moved out, but I want to try it and see what happens      # Note that at the moment I define these two sheets here. I think this should
255      # css has the format      # be moved out, but I want to try it and see what happens.  css has the format:
256        #
257      # <link rel='stylesheet' title='default' href='/css/default.css' type='text/css'>      # <link rel='stylesheet' title='default' href='/css/default.css' type='text/css'>
258    
259      # convert the default key to the right case. and eliminate dups      # convert the default key to the right case. and eliminate dups
# Line 389  Line 391 
391          splice( @$html, $i, 0, @tags );          splice( @$html, $i, 0, @tags );
392      }      }
393    
394      # RAE the chomp will return any new lines at the ends of elements in the array, and then we can join  with a "\n"      # RAE the chomp will return any new lines at the ends of elements in the array,
395      # this is because somethings put newlines in, and others don't. This should make nicer looking html      # and then we can join  with a "\n". This is because somethings put newlines in,
396        # and others don't. This should make nicer looking html
397        #
398      #chomp(@$html);      #chomp(@$html);
399      #print join "\n", @$html;      #print join "\n", @$html;
400        #
401      # Apparently the above still breaks things. This is the correct code:      # Apparently the above still breaks things. This is the correct code:
402    
403      print @$html;      print @$html;
404  }  }
405    
# Line 429  Line 434 
434    
435      $tag = "td" unless $tag;      $tag = "td" unless $tag;
436      my $endtag=$tag;      my $endtag=$tag;
437      # RAE modified this so that you can pass in a reference to an array where the first element is the data to  
438      # display and the second element is optional things like colspan and align. Note that in this case you need to include the td      # RAE modified this so that you can pass in a reference to an array where
439        # the first element is the data to display and the second element is optional
440        # things like colspan and align. Note that in this case you need to include the td
441      # use something like ["some data to appear", "td colspan=4 bgcolor=gray"]      # use something like ["some data to appear", "td colspan=4 bgcolor=gray"]
442    
443      if (ref($x) eq "ARRAY") {($x, $tag)=@$x; if ($tag =~ /td/) {$endtag = "td"}}      if (ref($x) eq "ARRAY") {($x, $tag)=@$x; if ($tag =~ /td/) {$endtag = "td"}}
444    
445      if ($x =~ /^\@([^:]+)\:(.*)$/)      if ($x =~ /^\@([^:]+)\:(.*)$/)
# Line 542  Line 550 
550      return $family;      return $family;
551  }  }
552    
 use URI::Escape;  
553    
554  sub get_html {  sub get_html {
555      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
# Line 873  Line 880 
880      my $user = $cgi->param('user');      my $user = $cgi->param('user');
881      if ($user)      if ($user)
882      {      {
883          $sub_link = "<a href=./subsys.cgi?ssa_name=$sub&request=show_ssa&user=$user>$sub</a>";          my $esc_sub = uri_escape( $sub );
884            $sub_link = "<a href=./subsys.cgi?ssa_name=$esc_sub&request=show_ssa&user=$user>$sub</a>";
885      }      }
886      else      else
887      {      {

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.41

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3