[Bio] / FigWebServices / genome_statistics.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/genome_statistics.cgi

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

revision 1.11, Fri Mar 4 18:29:21 2005 UTC revision 1.12, Sat Mar 5 00:31:36 2005 UTC
# Line 367  Line 367 
367   # if the optional edit boolean is set and a user is supplied, we will make a table where you can edit the KV pairs   # if the optional edit boolean is set and a user is supplied, we will make a table where you can edit the KV pairs
368   # else we will just make a blank table   # else we will just make a blank table
369    
370     # prepare the html so we can add form fields here
371     push(@$html, "\n<div class=\"attributes\">\n<p><h2>Attributes for ", $fig->genus_species($genome), "</h2></p>\n");
372     if ($edit) {push(@$html, $cgi->start_form(-action=>"genome_statistics.cgi"))}
373    
374    
375   my $tab=[];   my $tab=[];
376   my $user=$cgi->param('user');   my $user=$cgi->param('user');
377   my $col_hdrs=["Attribute", "Value"];   my $col_hdrs=["Attribute", "Value"];
# Line 411  Line 416 
416          $cgi->textfield(-name=>"url.$i", -size=>50),          $cgi->textfield(-name=>"url.$i", -size=>50),
417       ];       ];
418    }    }
419      # we need to know how many possibilities we have to look through later. Just pass it as a hidden, rather than counting it next time
420      push(@$html, $cgi->hidden(-name=>"max new keys", -value=>scalar @options + 5));
421   }   }
422    
423   # now just write the html   # now just write the html
  if ($edit) {push(@$html, $cgi->start_form(-action=>"genome_statistics.cgi"))}  
  push(@$html, "\n<div class=\"attributes\">\n<p><h2>Attributes for ", $fig->genus_species($genome), "</h2></p>\n");  
424   push(@$html,&HTML::make_table($col_hdrs,$tab,"Attributes"));   push(@$html,&HTML::make_table($col_hdrs,$tab,"Attributes"));
425   if ($edit) {   if ($edit) {
426    push(@$html, $cgi->hidden("genome"), $cgi->hidden("user"), $cgi->hidden("request"));    push(@$html, $cgi->hidden("genome"), $cgi->hidden("user"), $cgi->hidden("request"));
# Line 447  Line 452 
452    }    }
453    
454    my $added;    my $added;
455    for (my $i=0; $i <=6; $i++) {    for (my $i=0; $i <= $cgi->param("max new keys"); $i++) {
456     if ($cgi->param("key.$i")) {     if ($cgi->param("key.$i")) {
457      $fig->add_attribute($genome, $cgi->param("key.$i"), $cgi->param("value.$i"), $cgi->param("url.$i"));      $fig->add_attribute($genome, $cgi->param("key.$i"), $cgi->param("value.$i"), $cgi->param("url.$i"));
458      push @$added, [$cgi->param("key.$i"), ["added", "td colspan=2 style=\"text-align: center\""], $cgi->param("value.$i"), $cgi->param("url.$i")];      push @$added, [$cgi->param("key.$i"), ["added", "td colspan=2 style=\"text-align: center\""], $cgi->param("value.$i"), $cgi->param("url.$i")];

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3