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

Diff of /FigWebServices/protein.cgi

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

revision 1.104, Fri Apr 8 18:36:29 2005 UTC revision 1.105, Fri Apr 8 20:22:23 2005 UTC
# Line 619  Line 619 
619        my ($deleted, $added, $changed)=(undef, undef, undef);        my ($deleted, $added, $changed)=(undef, undef, undef);
620    
621        foreach my $key (@attr) {        foreach my $key (@attr) {
622           unless ($cgi->param("key.".$key->[0])) {           unless ($cgi->param("key.".$key->[1])) {
623              if (&delete_attribute($fig_or_sprout, $peg, $key->[0])) {              if (&delete_attribute($fig_or_sprout, $peg, $key->[1])) {
624                push @$deleted, [@$key, ["deleted", "td colspan=2 style=\"text-align: center\""]];                push @$deleted, [@$key, ["deleted", "td colspan=2 style=\"text-align: center\""]];
625              }              }
626           }           }
627           if (($cgi->param("value.".$key->[0]) ne $key->[1]) || ($cgi->param("url.".$key->[0]) ne $key->[2])) {           if (($cgi->param("value.".$key->[1]) ne $key->[2]) || ($cgi->param("url.".$key->[1]) ne $key->[3])) {
628              if (&change_attribute($fig_or_sprout,$peg, $key->[0], $cgi->param("value.".$key->[0]), $cgi->param("url.".$key->[0]))) {              if (&change_attribute($fig_or_sprout,$peg, $key->[1], $cgi->param("value.".$key->[1]), $cgi->param("url.".$key->[1]))) {
629                push @$changed, [@$key, $cgi->param("value.".$key->[0]), $cgi->param("url.".$key->[0])];                push @$changed, [@$key, $cgi->param("value.".$key->[1]), $cgi->param("url.".$key->[1])];
630              }              }
631           }           }
632        }        }
# Line 656  Line 656 
656      my $tab = [];      my $tab = [];
657      if ($cgi->param('Edit Attributes') && $cgi->param('user')) {      if ($cgi->param('Edit Attributes') && $cgi->param('user')) {
658         push @$col_hdrs, "URL";         push @$col_hdrs, "URL";
659         foreach my $key (sort {$a->[0] cmp $b->[0]} @attr) {         foreach my $key (sort {$a->[1] cmp $b->[1]} @attr) {
660            push @$tab,            push @$tab,
661                [                [
662                    $cgi->textfield(-name=>"key.".$key->[0], -default=>$key->[0], -size=>30),                    $cgi->textfield(-name=>"key.".$key->[1], -default=>$key->[1], -size=>30),
663                    $cgi->textfield(-name=>"value.".$key->[0], -default=>$key->[1], -size=>30),                    $cgi->textfield(-name=>"value.".$key->[1], -default=>$key->[2], -size=>30),
664                    $cgi->textfield(-name=>"url.".$key->[0], -default=>$key->[2], -size=>30),                    $cgi->textfield(-name=>"url.".$key->[1], -default=>$key->[3], -size=>30),
665                ];                ];
666         }         }
667         for (my $i=0; $i<=5; $i++) {         for (my $i=0; $i<=5; $i++) {
# Line 676  Line 676 
676      #RAE we need to check that this is a scalar      #RAE we need to check that this is a scalar
677      elsif (ref($attr[0]) eq "ARRAY") {      elsif (ref($attr[0]) eq "ARRAY") {
678         foreach $_ (sort {$a->[0] cmp $b->[0]} @attr) {         foreach $_ (sort {$a->[0] cmp $b->[0]} @attr) {
679             my($tag,$val,$url) = @$_;             my($peg,$tag,$val,$url) = @$_;
680             next unless ($url =~ /^http/);             next unless ($url =~ /^http/);
681             push(@$tab,[$tag,$url ? "<a href=\"$url\">$val</a>" : $val]);             push(@$tab,[$tag,$url ? "<a href=\"$url\">$val</a>" : $val]);
682         }         }
# Line 693  Line 693 
693      push(@$html,$cgi->start_form(-action=>"protein.cgi"), $cgi->hidden("prot"), $cgi->hidden("user"));      push(@$html,$cgi->start_form(-action=>"protein.cgi"), $cgi->hidden("prot"), $cgi->hidden("user"));
694      push(@$html,$cgi->br,$cgi->hr,&HTML::make_table($col_hdrs, $tab,"Attributes"),$cgi->hr);      push(@$html,$cgi->br,$cgi->hr,&HTML::make_table($col_hdrs, $tab,"Attributes"),$cgi->hr);
695      #  Add end of form -- GJO      #  Add end of form -- GJO
696        #  RAE: sorry about that Gary.
697      push( @$html, $cgi->end_form );      push( @$html, $cgi->end_form );
698  }  }
699    

Legend:
Removed from v.1.104  
changed lines
  Added in v.1.105

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3