[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.6, Sun Mar 21 02:20:55 2004 UTC revision 1.9, Fri Apr 2 18:02:20 2004 UTC
# Line 183  Line 183 
183          #  only, or every update?), I provide an alternative derivation          #  only, or every update?), I provide an alternative derivation
184          #  from $cgi_url. -- GJO          #  from $cgi_url. -- GJO
185          #          #
186            # BASE href needs to be absolute. RDO.
187          my $base_url = $FIG_Config::cgi_base;          #
188          if ( ! $base_url )                      # if cgi_base was not defined          #
189          {          $base_url = &FIG::cgi_url;
190              $base_url = $FIG_Config::cgi_url;   # get the full cgi url  #       my $base_url = $FIG_Config::cgi_base;
191              $base_url =~ s~^http://[^/]*~~;     # remove protocol and host  #       if ( ! $base_url )                      # if cgi_base was not defined
192              $base_url =~ m~/$~ || $base_url =~ s~$~/~; # check trailing slash  #       {
193          }  #           $base_url = $FIG_Config::cgi_url;   # get the full cgi url
194    #           $base_url =~ s~^http://[^/]*~~;     # remove protocol and host
195    #           $base_url =~ m~/$~ || $base_url =~ s~$~/~; # check trailing slash
196    #       }
197    
198          $base_line = $head_end_line;          $base_line = $head_end_line;
199          splice( @$html, $base_line, 0, "<BASE href=\"$base_url\">\n" );          splice( @$html, $base_line, 0, "<BASE href=\"$base_url/\">\n" );
200      }      }
201    
202      #      #
# Line 259  Line 262 
262  }  }
263    
264  sub make_table {  sub make_table {
265      my($col_hdrs,$tab,$title,$instr) = @_;      my($col_hdrs,$tab,$title) = @_;
266      my(@tab);      my(@tab);
267    
268      push( @tab, "\n<table border>\n",      push( @tab, "\n<table border>\n",
# Line 268  Line 271 
271                . join( "</th>\n\t\t<th>", @$col_hdrs )                . join( "</th>\n\t\t<th>", @$col_hdrs )
272                . "</th>\n\t</tr>\n"                . "</th>\n\t</tr>\n"
273          );          );
274      my($i,$nowrap);      my($i);
   
     for ($i=0; ($i < @$instr) && ($instr->[$i] !~ /nowrap/); $i++) {}  
     $nowrap = ($i == @$instr) ? "" : " nowrap";  
275    
276      my $row;      my $row;
277      foreach $row (@$tab)      foreach $row (@$tab)
278      {      {
279          push( @tab, "\t<tr>\n"          push( @tab, "\t<tr>\n"
280                    . join( "\n", map { &expand($_,$nowrap) } @$row )                    . join( "\n", map { &expand($_) } @$row )
281                    . "\n\t</tr>\n"                    . "\n\t</tr>\n"
282              );              );
283      }      }
# Line 286  Line 286 
286  }  }
287    
288  sub expand {  sub expand {
289      my($x,$nowrap) = @_;      my($x) = @_;
290    
291      if ($x =~ /^\@([^:]+)\:([^:]+)\:(.*)$/)      if ($x =~ /^\@([^:]+)\:(.*)$/)
292      {      {
293          return "\t\t<td$nowrap $1=\"$2\">$3</td>";          return "\t\t<td $1>$2</td>";
294      }      }
295      else      else
296      {      {
297          return "\t\t<td$nowrap>$x</td>";          return "\t\t<td>$x</td>";
298      }      }
299  }  }
300    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3