[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.1, Tue Jul 31 21:54:24 2007 UTC revision 1.21, Tue Oct 7 09:37:32 2008 UTC
# Line 12  Line 12 
12    
13  1;  1;
14    
15  ##################################################  ##############################################################
16  # Method for registering components etc. for the #  # Method for registering components etc. for the application #
17  # application                                    #  ##############################################################
 ##################################################  
18  sub init {  sub init {
19    my ( $self ) = @_;    my ( $self ) = @_;
20    
21    $self->application->register_component(  'Table', 'sstable'  );    $self->application->register_component(  'Table', 'sstable'  );
22      $self->application->register_component(  'Table', 'VarDescTable'  );
23    }
24    
25    #################################
26    # File where Javascript resides #
27    #################################
28    sub require_javascript {
29    
30      return [ './Html/showfunctionalroles.js' ];
31    
32  }  }
33    
34  ##############################################  ##############################################
# Line 31  Line 40 
40    my $fig = new FIG;    my $fig = new FIG;
41    my $cgi = $self->application->cgi;    my $cgi = $self->application->cgi;
42    
43      # subsystem name and 'nice name' #
44    my $name = $cgi->param( 'subsystem' );    my $name = $cgi->param( 'subsystem' );
45    my $ssname = $name;    my $ssname = $name;
46    $ssname =~ s/\_/ /g;    $ssname =~ s/\_/ /g;
47    
48      # look if someone is logged in and can write the subsystem #
49      my $can_alter = 0;
50      my $user = $self->application->session->user;
51    
52      my $dbmaster = DBMaster->new( -database => 'WebAppBackend' );
53      my $ppoapplication = $dbmaster->Backend->init( { name => 'SubsystemEditor' } );
54    
55      # get a seeduser #
56      my $seeduser = '';
57      if ( defined( $user ) && ref( $user ) ) {
58        my $preferences = $dbmaster->Preferences->get_objects( { user => $user,
59                                                                 name => 'SeedUser',
60                                                                 application => $ppoapplication } );
61        if ( defined( $preferences->[0] ) ) {
62          $seeduser = $preferences->[0]->value();
63        }
64      }
65    
66      if ( $user ) {
67        if ( $user->has_right( $self->application, 'edit', 'subsystem', $name ) ) {
68          $can_alter = 1;
69          $fig->set_user( $seeduser );
70        }
71        else {
72          # we might have the problem that the user has not yet got the right for editing the
73          # subsystem due to that it was created in the old seed or what do I know where.
74          my $curatorOfSS = $fig->subsystem_curator( $name );
75          my $su = lc( $seeduser );
76          my $cu = lc( $curatorOfSS );
77          if ( $su eq $cu ) {
78            # now set the rights...
79            my $right = $dbmaster->Rights->create( { name => 'edit',
80                                                     scope => $user->get_user_scope,
81                                                     data_type => 'subsystem',
82                                                     data_id => $name,
83                                                     granted => 1,
84                                                     delegated => 0 } );
85            if ( $right ) {
86              $can_alter = 1;
87              $fig->set_user( $seeduser );
88            }
89          }
90        }
91      }
92    
93    ######################    ######################
94    # Construct the menu #    # Construct the menu #
95    ######################    ######################
96    
97    my $menu = $self->application->menu();    my $menu = $self->application->menu();
98    
99      my $esc_name = uri_escape($name);
100    
101    # Build nice tab menu here    # Build nice tab menu here
102    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$name" );    $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$esc_name" );
103    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$name" );    $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$esc_name" );
104    $menu->add_category( 'Subsystem Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$name" );    $menu->add_category( 'Subsets', "SubsysEditor.cgi?page=ShowSubsets&subsystem=$esc_name" );
105    $menu->add_category( 'Subsystem Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$name" );    $menu->add_category( 'Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$esc_name" );
106    $menu->add_category( 'Subsystem Tree', "SubsysEditor.cgi?page=ShowTree&subsystem=$name" );    $menu->add_category( 'Illustrations', "SubsysEditor.cgi?page=ShowIllustrations&subsystem=$esc_name" );
107      $menu->add_category( 'Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$esc_name" );
108      $menu->add_category( 'Show Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$esc_name" );
109      $menu->add_category( 'Show Connections', "SubsysEditor.cgi?page=ShowTree&subsystem=$esc_name" );
110    
111    
112    ##############################    ##############################
113    # Construct the page content #    # Construct the page content #
114    ##############################    ##############################
115    
116    my $content = "<H2>Subsystem Info</H2>";    my $content = qq~
117    <STYLE>
118    .hideme {
119       display: none;
120    }
121    .showme {
122       display: all;
123    }
124    </STYLE>
125    ~;
126    
127      $content .= "<H2>Subsystem Info</H2>";
128      my $subsystem = new Subsystem( $name, $fig, 0 );
129    
130      if ( defined( $cgi->param( 'SUBMIT' ) ) ) {
131    
132        # set description and notes
133        my $descrp = $cgi->param( 'SSDESC' );
134        chomp $descrp;
135        $descrp .= "\n";
136        $subsystem->set_description( $descrp );
137        my $notes = $cgi->param( 'SSNOTES' );
138        chomp $notes;
139        $notes .= "\n";
140        $subsystem->set_notes( $notes );
141    
142        my $class1 = '';
143        my $class2 = '';
144    
145        if ( defined( $cgi->param( 'Classification' ) ) ) {
146          if ( $cgi->param( 'Classification' ) eq 'User-defined' ) {
147            if ( defined( $cgi->param( "SUBSYSH1TF" ) ) ) {
148              $class1 = $cgi->param( "SUBSYSH1TF" );
149            }
150          }
151          else {
152            if ( defined( $cgi->param( "SUBSYSH1" ) ) ) {
153              $class1 = $cgi->param( "SUBSYSH1" );
154            }
155          }
156        }
157    
158        if ( defined( $cgi->param( 'Classification' ) ) ) {
159          if ( $cgi->param( 'Classification' ) eq 'User-defined' ) {
160            if ( defined( $cgi->param( "SUBSYSH2TF" ) ) ) {
161              $class2 = $cgi->param( "SUBSYSH2TF" );
162            }
163          }
164          else {
165            if ( defined( $cgi->param( "SUBSYSH2" ) ) ) {
166              $class2 = $cgi->param( "SUBSYSH2" );
167            }
168          }
169        }
170        $subsystem->set_classification( [ $class1, $class2 ] );
171    
172        my $litstoset = $cgi->param( 'SUBSYSLIT' );
173        my @lits = split( ', ', $litstoset );
174        setLiteratures( $fig, $name, \@lits );
175    
176        my $wlstoset = $cgi->param( 'SUBSYSWL' );
177        if ( defined( $wlstoset ) && $wlstoset =~ /.+\s+.+/ ) {
178          my @wls = split( '\n', $wlstoset );
179          setWeblinks( $fig, $name, \@wls );
180        }
181    
182        # here we really edit the files in the subsystem directory #
183        $subsystem->incr_version();
184        $subsystem->db_sync();
185        $subsystem->write_subsystem();
186      }
187    
188      $subsystem = new Subsystem( $name, $fig, 0 );
189    
190      $content .= $self->start_form( 'form', { subsystem => $name } );
191    
192    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );    my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );
193    
194      my $versionlink = '';
195    
196      if ( $can_alter ) {
197        $versionlink = " -- <A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$esc_name'>Reset to Previous Timestamp</A>";
198      }
199    
200    my $mod_time = get_mod_time( $name );    my $mod_time = get_mod_time( $name );
201    my $class = $fig->subsystem_classification( $name );    my $class = $fig->subsystem_classification( $name );
   my $subsystem = new Subsystem( $name, $fig, 0 );  
202    my $ssnotes = $subsystem->get_notes();    my $ssnotes = $subsystem->get_notes();
   my $ssdesc = "";  
203    
204      if ( !defined( $ssnotes ) ) {
205        $ssnotes = '';
206      }
207      my $ssdesc = $subsystem->get_description();
208    
209      if ( !defined( $ssdesc ) ) {
210        $ssdesc = '';
211      }
212    
213    my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD><TR>";    my $classification_stuff;
214      if ( $can_alter ) {
215        $classification_stuff = get_classification_boxes( $fig, $cgi, $class->[0], $class->[1] );
216      }
217      else {
218        $classification_stuff = "<TR><TH>Classification:</TH><TD>$class->[0]</TD></TR>";
219        $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";
220      }
221    
222      my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD></TR>";
223    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";    $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";
224    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion</TD></TR>";    $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
225    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";    $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";
226    $infotable .= "<TR><TH>Classification:</TH><TD>$class->[0]</TD></TR>";  
227    $infotable .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";    # Literature #
228    $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=6 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";    my $lit = getLiteratures( $fig, $name );
229    $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=6 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";    my $litstring = '';
230      my $litvoid = '';
231      if ( defined( $lit ) && scalar( @$lit ) > 0 ) {
232        my @litlinks;
233        foreach my $l ( @$lit ) {
234          my $thislink = "<a href=\"javascript:void(0)\"onclick=\"window.open('http://www.ncbi.nlm.nih.gov/sites/entrez?cmd=retrieve&db=pubmed&list_uids=" . $l ."')\">$l</a>";
235          push @litlinks, $thislink;
236        }
237        $litstring = join( ', ', @litlinks );
238        $litvoid = join( ', ', @$lit );
239      }
240    
241      # Weblinks #
242      my ( $wl, $wlvoid ) = getLinks( $fig, $name );
243    
244      my $variants = $subsystem->get_variants();
245    
246      if ( $can_alter ) {
247    
248        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\" );'>";
249        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\" );'>";
250    
251        $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>";
252        $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>";
253        $infotable .= "<TR><TH>Description</TH><TD><TEXTAREA NAME='SSDESC' ROWS=15 STYLE='width: 772px;'>$ssdesc</TEXTAREA></TD></TR>";
254        $infotable .= "<TR><TH>Notes</TH><TD><TEXTAREA NAME='SSNOTES' ROWS=15 STYLE='width: 772px;'>$ssnotes</TEXTAREA></TD></TR>";
255      }
256      else {
257        # do a little formating because the notes often contain many many blanks and newlines
258        my $ssdesc_brs = $ssdesc;
259        $ssdesc_brs =~ s/\n/<BR>/g;
260        $ssdesc_brs =~ s/(\n\s)+/\n/g;
261        my $ssnotes_brs = $ssnotes;
262        $ssnotes_brs =~ s/(\n\s)+/\n/g;
263        $ssnotes_brs =~ s/\n/<BR>/g;
264        $infotable .= "<TR><TH>Literature</TH><TD>$litstring</TD></TR>";
265        $infotable .= "<TR><TH>Websites</TH><TD>$wl</TD></TR>";
266        $infotable .= "<TR><TH>Description</TH><TD>$ssdesc_brs</TD></TR>";
267        $infotable .= "<TR><TH>Notes</TH><TD>$ssnotes_brs</TD></TR>";
268      }
269      # variants
270      my $vartable = $self->application->component( 'VarDescTable' );
271      $vartable->columns( [ { name => "Variant" }, { name => "Description" } ] );
272    
273      my $vardata;
274      my $has_variants = 0;
275      foreach my $kv ( sort keys %$variants ) {
276        $has_variants = 1;
277        push @$vardata, [ $kv, $variants->{ $kv } ];
278      }
279      $vartable->data( $vardata );
280      $infotable .= "<TR><TH>Variants</TH><TD>";
281      if ( $has_variants ) {
282        $infotable .= $vartable->output();
283      }
284    
285      if ( $can_alter ) {
286        my $variant_outside = "<INPUT TYPE=BUTTON VALUE='Edit Variants in Variant Overview' NAME='EditVariantsOverview' ID='EditVariantsOverview' ONCLICK='window.open( \"".$self->application->url()."?page=ShowVariants&subsystem=$name\" )'>";
287      $infotable .= $variant_outside;
288      }
289    
290      $infotable .= "</TD</TR>";
291    
292      $infotable .= $classification_stuff;
293    $infotable .= "</TABLE>";    $infotable .= "</TABLE>";
294    
295      if ( $can_alter ) {
296        $infotable .= "<INPUT TYPE=SUBMIT VALUE='Save Changes' ID='SUBMIT' NAME='SUBMIT' STYLE='background-color: red;'>";
297      }
298    
299      if ( $can_alter ) {
300        $content .= "<INPUT TYPE=SUBMIT VALUE='Save Changes' ID='SUBMIT' NAME='SUBMIT'  STYLE='background-color: red;'>";
301      }
302    $content .= $infotable;    $content .= $infotable;
303      $content .= $self->end_form();
304    
305    return $content;    return $content;
306  }  }
# Line 99  Line 326 
326    }    }
327        return "$FIG_Config::data/Subsystems/$ssa/Backup";        return "$FIG_Config::data/Subsystems/$ssa/Backup";
328  }  }
329    
330    
331    sub get_classification_boxes {
332      my ( $fig, $cgi, $class1, $class2 ) = @_;
333      my $classified = 1;
334    
335      my $sdContent = '';
336      my $SUBSYSH1 = $class1;
337      my $SUBSYSH2 = $class2;
338    
339      # variables that monitor if we have selected a box
340      my $putinh1 = 0;
341      my $putinh2 = 0;
342    
343      if ( !defined( $SUBSYSH1 ) ){
344        $putinh1 = 1;
345      }
346      if ( !defined( $SUBSYSH2 ) ){
347        $putinh2 = 1;
348      }
349    
350      my $inh1 = '';
351      if ( defined( $cgi->param( 'SUBSYSH1TF' ) ) ) {
352        $inh1 = $cgi->param( 'SUBSYSH1TF' );
353      }
354      elsif ( defined( $SUBSYSH1 ) ) {
355        if ( !$putinh1 ) {
356          $inh1 = $SUBSYSH1;
357        }
358      }
359      my $inh2 = '';
360      if ( defined( $cgi->param( 'SUBSYSH2TF' ) ) ) {
361        $inh2 = $cgi->param( 'SUBSYSH2TF' );
362      }
363      elsif ( defined( $SUBSYSH2 ) ) {
364        if ( !$putinh2 ) {
365          $inh2 = $SUBSYSH2;
366        }
367      }
368    
369      my @ssclassifications = $fig->all_subsystem_classifications();
370      my $ssclass;
371      foreach my $ssc ( @ssclassifications ) {
372        next if ( ( !defined( $ssc->[0] ) ) || ( !defined( $ssc->[1] ) ) );
373        next if ( ( $ssc->[0] eq '' ) || ( $ssc->[1] eq '' ) );
374        next if ( ( $ssc->[0] =~ /^\s+$/ ) || ( $ssc->[1] =~ /^\s+$/ ) );
375        push @{ $ssclass->{ $ssc->[0] } }, $ssc->[1];
376      }
377    
378    
379      my @options;
380      foreach my $firstc ( keys %$ssclass ) {
381        my $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='hideme'>";
382        my $optstring = '';
383        foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {
384          if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc && $SUBSYSH1 eq $firstc ) {
385            $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";
386            # we have to show the selectbox if there is a selected value
387            $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='showme'>";
388            $putinh2 = 1;
389          }
390          else {
391            $optstring .= "<OPTION VALUE='$secc'>$secc</OPTION>";
392          }
393        }
394        $opt .= $optstring;
395        $opt .= "</SELECT>";
396        push @options, $opt;
397      }
398    
399      if ( $classified ) {
400        $sdContent .= "<TR><TH><INPUT TYPE=\"RADIO\" NAME=\"Classification\" VALUE=\"Classified\" CHECKED onchange='radioclassification();'>Classification:</TH><TD><SELECT SIZE=5 ID='SUBSYSH1' NAME='SUBSYSH1' STYLE='width: 386px;' onclick='gethiddenoption();'>";
401      }
402      else {
403        $sdContent .= "<TR><TD><INPUT TYPE=\"RADIO\" NAME=\"Classification\" VALUE=\"Classified\" onchange='radioclassification();'>Classification:</TD><TD><SELECT SIZE=5 ID='SUBSYSH1' NAME='SUBSYSH1' STYLE='width: 386px;' onclick='gethiddenoption();' DISABLED=DISABLED>";
404      }
405      foreach my $firstc ( sort keys %$ssclass ) {
406        if ( defined( $SUBSYSH1 ) && $SUBSYSH1 eq $firstc ) {
407          $sdContent .= "\n<OPTION SELECTED VALUE='$firstc'>$firstc</OPTION>\n";
408          $putinh1 = 1;
409        }
410        else {
411          $sdContent .= "\n<OPTION VALUE='$firstc'>$firstc</OPTION>\n";
412        }
413      }
414      $sdContent .= "</SELECT>";
415    
416      foreach my $opt ( @options ) {
417        $sdContent .= $opt;
418      }
419    
420      $sdContent .= "</TD></TR>";
421      if ( $classified ) {
422        $sdContent .= "<TR><TH><INPUT TYPE=\"RADIO\" NAME=\"Classification\" VALUE=\"User-defined\" onchange='radioclassification();'>User-defined:</TH><TD><INPUT TYPE=TEXT  STYLE='width: 386px;' NAME='SUBSYSH1TF' ID='SUBSYSH1TF' VALUE='' DISABLED=\"DISABLED\"><INPUT TYPE=TEXT  STYLE='width: 386px;' NAME='SUBSYSH2TF' ID='SUBSYSH2TF' VALUE='' DISABLED=DISABLED></TD></TR>";
423      }
424      else {
425        $sdContent .= "<TR><TH><INPUT TYPE=\"RADIO\" NAME=\"Classification\" VALUE=\"User-defined\" CHECKED onchange='radioclassification();'>User-defined:</TH><TD><INPUT TYPE=TEXT  STYLE='width: 386px;' NAME='SUBSYSH1TF' ID='SUBSYSH1TF' VALUE='$inh1'><INPUT TYPE=TEXT  STYLE='width: 386px;' NAME='SUBSYSH2TF' ID='SUBSYSH2TF' VALUE='$inh2'></TD></TR>";
426      }
427    
428    
429      return $sdContent;
430    }
431    
432    ########################################
433    # get Literature-string for subsystems #
434    ########################################
435    sub getLiteratures {
436      my ( $fig, $name ) = @_;
437    
438      my $esc_name = uri_escape($name);
439    
440      my $frpubs;
441      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
442    
443      foreach my $k ( @rel_lit_num ) {
444        my ( $ss, $key, $value ) = @$k;
445        push @$frpubs, $value;
446      }
447    
448      return $frpubs;
449    }
450    
451    ######################################
452    # get Weblinks-string for subsystems #
453    ######################################
454    sub getLinks {
455      my ( $fig, $name ) = @_;
456    
457      my $esc_name = uri_escape($name);
458    
459      my $links;
460      my $linksstring = '';
461      my $linksvoid = '';
462      my @rel_link_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
463    
464      foreach my $k ( @rel_link_num ) {
465        my ( $ss, $key, @value ) = @$k;
466        $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>";
467        $linksvoid .= $value[0]." ".$value[1]."\n";
468      }
469    
470      return ( $linksstring, $linksvoid );
471    }
472    
473    ########################################
474    # set Literature-string for subsystems #
475    ########################################
476    sub setLiteratures {
477      my ( $fig, $name, $newpubs ) = @_;
478    
479      my $esc_name = uri_escape($name);
480    
481      my @values;
482      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
483    
484      foreach my $k ( @rel_lit_num ) {
485        my ( $ss, $key, $value ) = @$k;
486        $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT" );
487      }
488    
489      foreach my $np ( @$newpubs ) {
490        $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT", $np );
491      }
492    }
493    
494    ########################################
495    # set Literature-string for subsystems #
496    ########################################
497    sub setWeblinks {
498      my ( $fig, $name, $newpubs ) = @_;
499    
500      my $esc_name = uri_escape($name);
501    
502      my @values;
503      my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
504    
505      foreach my $k ( @rel_lit_num ) {
506        my ( $ss, $key, $value ) = @$k;
507        $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_WEBLINKS" );
508      }
509    
510      foreach my $np ( @$newpubs ) {
511        my @h = split( /\s+/, $np );
512        $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_WEBLINKS", @h );
513      }
514    }
515    
516    sub supported_rights {
517    
518      return [ [ 'edit', 'subsystem', '*' ] ];
519    
520    }
521    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3