[Bio] / SubsystemEditor / WebPage / ShowSubsystem.pm Repository:
ViewVC logotype

Diff of /SubsystemEditor/WebPage/ShowSubsystem.pm

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

revision 1.12, Thu Mar 20 19:26:57 2008 UTC revision 1.13, Fri Mar 21 15:54:30 2008 UTC
# Line 170  Line 170 
170      my @lits = split( ', ', $litstoset );      my @lits = split( ', ', $litstoset );
171      setLiteratures( $fig, $name, \@lits );      setLiteratures( $fig, $name, \@lits );
172    
173        my $wlstoset = $cgi->param( 'SUBSYSWL' );
174        if ( defined( $wlstoset ) && $wlstoset =~ /.+\s+.+/ ) {
175          my @wls = split( '\n', $wlstoset );
176          setWeblinks( $fig, $name, \@wls );
177        }
178    
179      # here we really edit the files in the subsystem directory #      # here we really edit the files in the subsystem directory #
180      $subsystem->incr_version();      $subsystem->incr_version();
181      $subsystem->db_sync();      $subsystem->db_sync();
# Line 215  Line 221 
221    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
222    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";
223    
224      # Literature #
225    my $lit = getLiteratures( $fig, $name );    my $lit = getLiteratures( $fig, $name );
226    my $litstring = '';    my $litstring = '';
227    my $litvoid = '';    my $litvoid = '';
# Line 228  Line 235 
235      $litvoid = join( ', ', @$lit );      $litvoid = join( ', ', @$lit );
236    }    }
237    
238      # Weblinks #
239      my ( $wl, $wlvoid ) = getLinks( $fig, $name );
240    
241    my $variants = $subsystem->get_variants();    my $variants = $subsystem->get_variants();
242    
243    if ( $can_alter ) {    if ( $can_alter ) {
244    
245      my $editLitButton = "<INPUT TYPE=BUTTON ID='EditLitButton' VALUE='Edit Literature' ONCLICK='MakeEditableLit( \"0\" );'><INPUT TYPE=BUTTON ID='ShowLitButton' VALUE='Show Links' STYLE='display: none;' ONCLICK='MakeEditableLit( \"1\" );'>";      my $editLitButton = "<INPUT TYPE=BUTTON ID='EditLitButton' VALUE='Edit Literature' ONCLICK='MakeEditableLit( \"0\" );'><INPUT TYPE=BUTTON ID='ShowLitButton' VALUE='Show Links' STYLE='display: none;' ONCLICK='MakeEditableLit( \"1\" );'>";
246        my $editWLButton = "<INPUT TYPE=BUTTON ID='EditWLButton' VALUE='Edit Weblinks' ONCLICK='MakeEditableWL( \"0\" );'><INPUT TYPE=BUTTON ID='ShowWLButton' VALUE='Show Weblinks' STYLE='display: none;' ONCLICK='MakeEditableWL( \"1\" );'>";
247    
248      $infotable .= "<TR><TH>Literature</TH><TD><TABLE><TR><TD><SPAN ID='LitSpan'>$litstring</SPAN></TD><TD>$editLitButton</TD><TD><INPUT TYPE=TEXT STYLE='width: 200px; display: none;' NAME='SUBSYSLIT' ID='SUBSYSLIT' VALUE='$litvoid'></TD><TD><SPAN ID='TEXTSPAN' STYLE='display: none;'>Multiple PMIDs should be separated by \', \'</SPAN></TD></TR></TABLE></TD></TR>";      $infotable .= "<TR><TH>Literature</TH><TD><TABLE><TR><TD><SPAN ID='LitSpan'>$litstring</SPAN></TD><TD>$editLitButton</TD><TD><INPUT TYPE=TEXT STYLE='width: 200px; display: none;' NAME='SUBSYSLIT' ID='SUBSYSLIT' VALUE='$litvoid'></TD><TD><SPAN ID='TEXTSPAN' STYLE='display: none;'>Multiple PMIDs should be separated by \', \'</SPAN></TD></TR></TABLE></TD></TR>";
249        $infotable .= "<TR><TH>Websites</TH><TD><TABLE><TR><TD><SPAN ID='WLSpan'>$wl</SPAN></TD><TD>$editWLButton</TD><TD><TEXTAREA ROWS=3 STYLE='width: 400px; display: none;' NAME='SUBSYSWL' ID='SUBSYSWL'>$wlvoid</TEXTAREA></TD><TD><SPAN ID='AREASPAN' STYLE='display: none;'>Please use the following format:<BR>Description1 http://www.xyz.org/...<BR>Description2 http://www.xzy.de/...</SPAN></TD></TR></TABLE></TD></TR>";
250      $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=6 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";      $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=6 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";
251      $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=6 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";      $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=6 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";
252    }    }
# Line 426  Line 439 
439    return $frpubs;    return $frpubs;
440  }  }
441    
442    ######################################
443    # get Weblinks-string for subsystems #
444    ######################################
445    sub getLinks {
446      my ( $fig, $name ) = @_;
447    
448      my $links;
449      my $linksstring = '';
450      my $linksvoid = '';
451      my @rel_link_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
452    
453      foreach my $k ( @rel_link_num ) {
454        my ( $ss, $key, @value ) = @$k;
455        $linksstring .= $value[0].": <a href=\"javascript:void(0)\"onclick=\"window.open('".$value[1]."','height=640,width=800,scrollbars=yes,toolbar=yes,status=yes')\">". $value[1]."</a><BR>";
456        $linksvoid .= $value[0]." ".$value[1]."\n";
457      }
458    
459      return ( $linksstring, $linksvoid );
460    }
461    
462  ########################################  ########################################
463  # set Literature-string for subsystems #  # set Literature-string for subsystems #
464  ########################################  ########################################
# Line 445  Line 478 
478    }    }
479  }  }
480    
481    ########################################
482    # set Literature-string for subsystems #
483    ########################################
484    sub setWeblinks {
485      my ( $fig, $name, $newpubs ) = @_;
486    
487      my @values;
488      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
489    
490      foreach my $k ( @rel_lit_num ) {
491        my ( $ss, $key, $value ) = @$k;
492        $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_WEBLINKS", $value );
493      }
494    
495      foreach my $np ( @$newpubs ) {
496        my @h = split( /\s+/, $np );
497        $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_WEBLINKS", @h );
498      }
499    }
500    
501  sub supported_rights {  sub supported_rights {
502    
503    return [ [ 'edit', 'subsystem', '*' ] ];    return [ [ 'edit', 'subsystem', '*' ] ];

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3