[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.12, Sat Mar 5 00:31:36 2005 UTC revision 1.13, Fri Apr 8 20:22:23 2005 UTC
# Line 378  Line 378 
378   if ($user && $edit) {$col_hdrs=["Attribute", "Value", "URL"]}   if ($user && $edit) {$col_hdrs=["Attribute", "Value", "URL"]}
379    
380   my $known;   my $known;
381   foreach my $key (sort {$a->[0] cmp $b->[0]} $fig->get_attributes($genome)) {   foreach my $key (sort {$a->[1] cmp $b->[1]} $fig->get_attributes($genome)) {
382    $known->{$key->[0]}=1;    $known->{$key->[1]}=1;
383    if ($user && $edit) {    if ($user && $edit) {
384     push @$tab,     push @$tab,
385      [      [
386         $key->[0],         $key->[1],
387         $cgi->textfield(-name=>"value.".$key->[0], -default=>$key->[1], -size=>50),         $cgi->textfield(-name=>"value.".$key->[1], -default=>$key->[2], -size=>50),
388         $cgi->textfield(-name=>"url.".$key->[0], -default=>$key->[2], -size=>50),         $cgi->textfield(-name=>"url.".$key->[1], -default=>$key->[3], -size=>50),
389      ];      ];
390    } else {    } else {
391     if ($key->[2] && $key->[2] =~ /^http/) {$key->[1] = "<a href=\"" . $key->[2] . "\">". $key->[1] . "</a>"}     if ($key->[3] && $key->[3] =~ /^http/) {$key->[2] = "<a href=\"" . $key->[3] . "\">". $key->[2] . "</a>"}
392     push @$tab,     push @$tab,
393      [      [
        $key->[0],  
394         $key->[1],         $key->[1],
395           $key->[2],
396      ];      ];
397     }     }
398    }    }
# Line 439  Line 439 
439    # get the old kv pairs so we can see what has changed    # get the old kv pairs so we can see what has changed
440    my $changed; my $deleted;    my $changed; my $deleted;
441    foreach my $key ($fig->get_attributes($genome)) {    foreach my $key ($fig->get_attributes($genome)) {
442     if (!$cgi->param('value.'.$key->[0]) && !$cgi->param('url.'.$key->[0])) {     if (!$cgi->param('value.'.$key->[1]) && !$cgi->param('url.'.$key->[1])) {
443      $fig->delete_attribute($genome, $key->[0]);      $fig->delete_attribute($genome, $key->[1]);
444      push @$key, ["deleted", "td colspan=2 style=\"text-align: center\""];      push @$key, ["deleted", "td colspan=2 style=\"text-align: center\""];
445      push @$deleted, $key;      push @$deleted, $key;
446     }     }
447     elsif (($cgi->param('value.'.$key->[0]) ne $key->[1]) || ($cgi->param('url.'.$key->[0]) ne $key->[2]))  {     elsif (($cgi->param('value.'.$key->[1]) ne $key->[2]) || ($cgi->param('url.'.$key->[1]) ne $key->[3]))  {
448       $fig->change_attribute($genome, $key->[0], $cgi->param('value.'.$key->[0]), $cgi->param('url.'.$key->[0]));       $fig->change_attribute($genome, $key->[1], $cgi->param('value.'.$key->[1]), $cgi->param('url.'.$key->[1]));
449       push @$key, $cgi->param('value.'.$key->[0]), $cgi->param('url.'.$key->[0]);       push @$key, $cgi->param('value.'.$key->[1]), $cgi->param('url.'.$key->[1]);
450       push @$changed, $key;       push @$changed, $key;
451     }     }
452    }    }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3