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

Annotation of /SubsystemEditor/WebPage/ShowSubsystem.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (view) (download) (as text)

1 : bartels 1.1 package SubsystemEditor::WebPage::ShowSubsystem;
2 :    
3 :     use strict;
4 :     use warnings;
5 :     use URI::Escape;
6 :     use HTML;
7 :     use Data::Dumper;
8 :    
9 :     use FIG;
10 :    
11 :     use base qw( WebPage );
12 :    
13 :     1;
14 :    
15 : bartels 1.2 ##############################################################
16 :     # Method for registering components etc. for the application #
17 :     ##############################################################
18 : bartels 1.1 sub init {
19 :     my ( $self ) = @_;
20 :    
21 : bartels 1.2 $self->application->register_component( 'Table', 'sstable' );
22 : bartels 1.12 $self->application->register_component( 'Table', 'VarDescTable' );
23 : bartels 1.2 }
24 :    
25 :     #################################
26 :     # File where Javascript resides #
27 :     #################################
28 :     sub require_javascript {
29 :    
30 :     return [ './Html/showfunctionalroles.js' ];
31 :    
32 : bartels 1.1 }
33 :    
34 :     ##############################################
35 :     # Website content is returned by this method #
36 :     ##############################################
37 :     sub output {
38 :     my ( $self ) = @_;
39 : bartels 1.2
40 : bartels 1.1 my $fig = new FIG;
41 :     my $cgi = $self->application->cgi;
42 :    
43 : bartels 1.2 # subsystem name and 'nice name' #
44 : bartels 1.1 my $name = $cgi->param( 'subsystem' );
45 :     my $ssname = $name;
46 :     $ssname =~ s/\_/ /g;
47 :    
48 : bartels 1.2 # look if someone is logged in and can write the subsystem #
49 :     my $can_alter = 0;
50 :     my $user = $self->application->session->user;
51 : bartels 1.4
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 : bartels 1.6 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 : bartels 1.7 my $su = lc( $seeduser );
76 :     my $cu = lc( $curatorOfSS );
77 :     if ( $su eq $cu ) {
78 : bartels 1.6 # 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 : bartels 1.2 }
92 : bartels 1.6
93 : bartels 1.1 ######################
94 :     # Construct the menu #
95 :     ######################
96 :    
97 :     my $menu = $self->application->menu();
98 :    
99 :     # Build nice tab menu here
100 :     $menu->add_category( 'Subsystem Info', "SubsysEditor.cgi?page=ShowSubsystem&subsystem=$name" );
101 :     $menu->add_category( 'Functional Roles', "SubsysEditor.cgi?page=ShowFunctionalRoles&subsystem=$name" );
102 : bartels 1.9 $menu->add_category( 'Diagram', "SubsysEditor.cgi?page=ShowDiagram&subsystem=$name" );
103 :     $menu->add_category( 'Illustrations', "SubsysEditor.cgi?page=ShowIllustrations&subsystem=$name" );
104 :     $menu->add_category( 'Spreadsheet', "SubsysEditor.cgi?page=ShowSpreadsheet&subsystem=$name" );
105 :     $menu->add_category( 'Show Check', "SubsysEditor.cgi?page=ShowCheck&subsystem=$name" );
106 : bartels 1.14 $menu->add_category( 'Show Connections', "SubsysEditor.cgi?page=ShowTree&subsystem=$name" );
107 : bartels 1.1
108 :    
109 :     ##############################
110 :     # Construct the page content #
111 :     ##############################
112 :    
113 : bartels 1.2 my $content = qq~
114 :     <STYLE>
115 :     .hideme {
116 :     display: none;
117 :     }
118 :     .showme {
119 :     display: all;
120 :     }
121 :     </STYLE>
122 :     ~;
123 :    
124 :     $content .= "<H2>Subsystem Info</H2>";
125 :     my $subsystem = new Subsystem( $name, $fig, 0 );
126 :    
127 :     if ( defined( $cgi->param( 'SUBMIT' ) ) ) {
128 :    
129 :     # set description and notes
130 :     my $descrp = $cgi->param( 'SSDESC' );
131 :     chomp $descrp;
132 :     $descrp .= "\n";
133 :     $subsystem->set_description( $descrp );
134 :     my $notes = $cgi->param( 'SSNOTES' );
135 :     chomp $notes;
136 :     $notes .= "\n";
137 :     $subsystem->set_notes( $notes );
138 :    
139 :     my $class1 = '';
140 :     my $class2 = '';
141 :    
142 :     if ( defined( $cgi->param( 'Classification' ) ) ) {
143 :     if ( $cgi->param( 'Classification' ) eq 'User-defined' ) {
144 :     if ( defined( $cgi->param( "SUBSYSH1TF" ) ) ) {
145 :     $class1 = $cgi->param( "SUBSYSH1TF" );
146 :     }
147 :     }
148 :     else {
149 :     if ( defined( $cgi->param( "SUBSYSH1" ) ) ) {
150 :     $class1 = $cgi->param( "SUBSYSH1" );
151 :     }
152 :     }
153 :     }
154 :    
155 :     if ( defined( $cgi->param( 'Classification' ) ) ) {
156 :     if ( $cgi->param( 'Classification' ) eq 'User-defined' ) {
157 :     if ( defined( $cgi->param( "SUBSYSH2TF" ) ) ) {
158 :     $class2 = $cgi->param( "SUBSYSH2TF" );
159 :     }
160 :     }
161 :     else {
162 :     if ( defined( $cgi->param( "SUBSYSH2" ) ) ) {
163 :     $class2 = $cgi->param( "SUBSYSH2" );
164 :     }
165 :     }
166 :     }
167 :     $subsystem->set_classification( [ $class1, $class2 ] );
168 :    
169 : bartels 1.10 my $litstoset = $cgi->param( 'SUBSYSLIT' );
170 :     my @lits = split( ', ', $litstoset );
171 :     setLiteratures( $fig, $name, \@lits );
172 :    
173 : bartels 1.13 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 : bartels 1.2 # here we really edit the files in the subsystem directory #
180 :     $subsystem->incr_version();
181 :     $subsystem->db_sync();
182 :     $subsystem->write_subsystem();
183 :     }
184 : bartels 1.1
185 : bartels 1.2 $subsystem = new Subsystem( $name, $fig, 0 );
186 :    
187 :     $content .= $self->start_form( 'form', { subsystem => $name } );
188 :    
189 : bartels 1.1 my ( $ssversion, $sscurator, $pedigree, $ssroles ) = $fig->subsystem_info( $name );
190 : bartels 1.3
191 :     my $versionlink = '';
192 : bartels 1.5
193 : bartels 1.3 if ( $can_alter ) {
194 : bartels 1.4 $versionlink = " -- <A HREF='".$self->application->url()."?page=ResetSubsystem&subsystem=$name'>Reset to Previous Timestamp</A>";
195 : bartels 1.3 }
196 :    
197 : bartels 1.1 my $mod_time = get_mod_time( $name );
198 :     my $class = $fig->subsystem_classification( $name );
199 :     my $ssnotes = $subsystem->get_notes();
200 :    
201 : bartels 1.2 if ( !defined( $ssnotes ) ) {
202 :     $ssnotes = '';
203 :     }
204 :     my $ssdesc = $subsystem->get_description();
205 :    
206 :     if ( !defined( $ssdesc ) ) {
207 :     $ssdesc = '';
208 :     }
209 :    
210 :     my $classification_stuff;
211 :     if ( $can_alter ) {
212 :     $classification_stuff = get_classification_boxes( $fig, $cgi, $class->[0], $class->[1] );
213 :     }
214 :     else {
215 :     $classification_stuff = "<TR><TH>Classification:</TH><TD>$class->[0]</TD></TR>";
216 :     $classification_stuff .= "<TR><TH></TH><TD>$class->[1]</TD></TR>";
217 :     }
218 : bartels 1.1
219 : bartels 1.11 my $infotable = "<TABLE><TR><TH>Name:</TH><TD>$ssname</TD></TR>";
220 : bartels 1.1 $infotable .= "<TR><TH>Author:</TH><TD>$sscurator</TD></TR>";
221 : bartels 1.3 $infotable .= "<TR><TH>Version:</TH><TD>$ssversion $versionlink</TD></TR>";
222 : bartels 1.1 $infotable .= "<TR><TH>Last Modified:</TH><TD>$mod_time</TD></TR>";
223 : bartels 1.10
224 : bartels 1.13 # Literature #
225 : bartels 1.10 my $lit = getLiteratures( $fig, $name );
226 :     my $litstring = '';
227 :     my $litvoid = '';
228 :     if ( defined( $lit ) && scalar( @$lit ) > 0 ) {
229 :     my @litlinks;
230 :     foreach my $l ( @$lit ) {
231 :     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>";
232 :     push @litlinks, $thislink;
233 :     }
234 :     $litstring = join( ', ', @litlinks );
235 :     $litvoid = join( ', ', @$lit );
236 :     }
237 :    
238 : bartels 1.13 # Weblinks #
239 :     my ( $wl, $wlvoid ) = getLinks( $fig, $name );
240 :    
241 : bartels 1.12 my $variants = $subsystem->get_variants();
242 :    
243 : bartels 1.2 if ( $can_alter ) {
244 : bartels 1.10
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\" );'>";
246 : bartels 1.13 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 : bartels 1.10 $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 : bartels 1.13 $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 : bartels 1.2 $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>";
252 :     }
253 :     else {
254 :     # do a little formating because the notes often contain many many blanks and newlines
255 :     my $ssdesc_brs = $ssdesc;
256 :     $ssdesc_brs =~ s/\n/<BR>/g;
257 :     $ssdesc_brs =~ s/(\n\s)+/\n/g;
258 :     my $ssnotes_brs = $ssnotes;
259 :     $ssnotes_brs =~ s/(\n\s)+/\n/g;
260 :     $ssnotes_brs =~ s/\n/<BR>/g;
261 : bartels 1.11 $infotable .= "<TR><TH>Literature</TH><TD>$litstring</TD></TR>";
262 : bartels 1.14 $infotable .= "<TR><TH>Websites</TH><TD>$wl</TD></TR>";
263 : bartels 1.2 $infotable .= "<TR><TH>Description</TH><TD>$ssdesc_brs</TD></TR>";
264 :     $infotable .= "<TR><TH>Notes</TH><TD>$ssnotes_brs</TD></TR>";
265 :     }
266 : bartels 1.12 # variants
267 :     my $vartable = $self->application->component( 'VarDescTable' );
268 :     $vartable->columns( [ { name => "Variant" }, { name => "Description" } ] );
269 :    
270 :     my $vardata;
271 :     my $has_variants = 0;
272 :     foreach my $kv ( sort keys %$variants ) {
273 :     $has_variants = 1;
274 :     push @$vardata, [ $kv, $variants->{ $kv } ];
275 :     }
276 :     $vartable->data( $vardata );
277 :     $infotable .= "<TR><TH>Variants</TH><TD>";
278 :     if ( $has_variants ) {
279 :     $infotable .= $vartable->output();
280 :     }
281 :    
282 :     if ( $can_alter ) {
283 :     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\" )'>";
284 :     $infotable .= $variant_outside;
285 :     }
286 :    
287 :     $infotable .= "</TD</TR>";
288 :    
289 : bartels 1.2 $infotable .= $classification_stuff;
290 : bartels 1.1 $infotable .= "</TABLE>";
291 :    
292 : bartels 1.2 if ( $can_alter ) {
293 :     $infotable .= "<INPUT TYPE=SUBMIT VALUE='Save Changes' ID='SUBMIT' NAME='SUBMIT'>";
294 :     }
295 :    
296 : bartels 1.1 $content .= $infotable;
297 : bartels 1.2 $content .= $self->end_form();
298 : bartels 1.1
299 :     return $content;
300 :     }
301 :    
302 :    
303 :     sub get_mod_time {
304 :    
305 :     my ( $ssa, $fig ) = @_;
306 :    
307 :     my( $t, @spreadsheets );
308 :     if ( opendir( BACKUP, "$FIG_Config::data/Subsystems/$ssa/Backup" ) ) {
309 :    
310 :     @spreadsheets = sort { $b <=> $a }
311 :     map { $_ =~ /^spreadsheet.(\d+)/; $1 }
312 :     grep { $_ =~ /^spreadsheet/ }
313 :     readdir(BACKUP);
314 :     closedir(BACKUP);
315 :    
316 :     if ( $t = shift @spreadsheets ) {
317 :     my $last_modified = &FIG::epoch_to_readable( $t );
318 :     return $last_modified;
319 :     }
320 :     }
321 : bartels 1.2 return "$FIG_Config::data/Subsystems/$ssa/Backup";
322 :     }
323 :    
324 :    
325 :     sub get_classification_boxes {
326 :     my ( $fig, $cgi, $class1, $class2 ) = @_;
327 :     my $classified = 1;
328 :    
329 :     my $sdContent = '';
330 :     my $SUBSYSH1 = $class1;
331 :     my $SUBSYSH2 = $class2;
332 :    
333 :     # variables that monitor if we have selected a box
334 :     my $putinh1 = 0;
335 :     my $putinh2 = 0;
336 :    
337 :     if ( !defined( $SUBSYSH1 ) ){
338 :     $putinh1 = 1;
339 :     }
340 :     if ( !defined( $SUBSYSH2 ) ){
341 :     $putinh2 = 1;
342 :     }
343 :    
344 :     my $inh1 = '';
345 :     if ( defined( $cgi->param( 'SUBSYSH1TF' ) ) ) {
346 :     $inh1 = $cgi->param( 'SUBSYSH1TF' );
347 :     }
348 :     elsif ( defined( $SUBSYSH1 ) ) {
349 :     if ( !$putinh1 ) {
350 :     $inh1 = $SUBSYSH1;
351 :     }
352 :     }
353 :     my $inh2 = '';
354 :     if ( defined( $cgi->param( 'SUBSYSH2TF' ) ) ) {
355 :     $inh2 = $cgi->param( 'SUBSYSH2TF' );
356 :     }
357 :     elsif ( defined( $SUBSYSH2 ) ) {
358 :     if ( !$putinh2 ) {
359 :     $inh2 = $SUBSYSH2;
360 :     }
361 :     }
362 :    
363 :     my @ssclassifications = $fig->all_subsystem_classifications();
364 :     my $ssclass;
365 :     foreach my $ssc ( @ssclassifications ) {
366 :     next if ( ( !defined( $ssc->[0] ) ) || ( !defined( $ssc->[1] ) ) );
367 :     next if ( ( $ssc->[0] eq '' ) || ( $ssc->[1] eq '' ) );
368 :     next if ( ( $ssc->[0] =~ /^\s+$/ ) || ( $ssc->[1] =~ /^\s+$/ ) );
369 :     push @{ $ssclass->{ $ssc->[0] } }, $ssc->[1];
370 :     }
371 :    
372 :    
373 :     my @options;
374 :     foreach my $firstc ( keys %$ssclass ) {
375 :     my $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='hideme'>";
376 :     my $optstring = '';
377 :     foreach my $secc ( sort @{ $ssclass->{ $firstc } } ) {
378 : bartels 1.8 if ( defined( $SUBSYSH2 ) && $SUBSYSH2 eq $secc && $SUBSYSH1 eq $firstc ) {
379 : bartels 1.2 $optstring .= "<OPTION SELECTED VALUE='$secc'>$secc</OPTION>";
380 :     # we have to show the selectbox if there is a selected value
381 :     $opt = "<SELECT SIZE=5 ID='$firstc' NAME='SUBSYSH2' STYLE='width: 386px;' class='showme'>";
382 :     $putinh2 = 1;
383 :     }
384 :     else {
385 :     $optstring .= "<OPTION VALUE='$secc'>$secc</OPTION>";
386 :     }
387 :     }
388 :     $opt .= $optstring;
389 :     $opt .= "</SELECT>";
390 :     push @options, $opt;
391 :     }
392 :    
393 :     if ( $classified ) {
394 :     $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();'>";
395 :     }
396 :     else {
397 :     $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>";
398 :     }
399 :     foreach my $firstc ( sort keys %$ssclass ) {
400 :     if ( defined( $SUBSYSH1 ) && $SUBSYSH1 eq $firstc ) {
401 :     $sdContent .= "\n<OPTION SELECTED VALUE='$firstc'>$firstc</OPTION>\n";
402 :     $putinh1 = 1;
403 :     }
404 :     else {
405 :     $sdContent .= "\n<OPTION VALUE='$firstc'>$firstc</OPTION>\n";
406 :     }
407 :     }
408 :     $sdContent .= "</SELECT>";
409 :    
410 :     foreach my $opt ( @options ) {
411 :     $sdContent .= $opt;
412 :     }
413 :    
414 :     $sdContent .= "</TD></TR>";
415 :     if ( $classified ) {
416 :     $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>";
417 :     }
418 :     else {
419 :     $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>";
420 :     }
421 :    
422 :    
423 :     return $sdContent;
424 :     }
425 :    
426 : bartels 1.10 ########################################
427 :     # get Literature-string for subsystems #
428 :     ########################################
429 :     sub getLiteratures {
430 :     my ( $fig, $name ) = @_;
431 :    
432 :     my $frpubs;
433 :     my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
434 :    
435 :     foreach my $k ( @rel_lit_num ) {
436 :     my ( $ss, $key, $value ) = @$k;
437 :     push @$frpubs, $value;
438 :     }
439 :    
440 :     return $frpubs;
441 :     }
442 :    
443 : bartels 1.13 ######################################
444 :     # get Weblinks-string for subsystems #
445 :     ######################################
446 :     sub getLinks {
447 :     my ( $fig, $name ) = @_;
448 :    
449 :     my $links;
450 :     my $linksstring = '';
451 :     my $linksvoid = '';
452 :     my @rel_link_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
453 :    
454 :     foreach my $k ( @rel_link_num ) {
455 :     my ( $ss, $key, @value ) = @$k;
456 :     $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>";
457 :     $linksvoid .= $value[0]." ".$value[1]."\n";
458 :     }
459 :    
460 :     return ( $linksstring, $linksvoid );
461 :     }
462 :    
463 : bartels 1.10 ########################################
464 :     # set Literature-string for subsystems #
465 :     ########################################
466 :     sub setLiteratures {
467 :     my ( $fig, $name, $newpubs ) = @_;
468 :    
469 :     my @values;
470 :     my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_PUBMED_RELEVANT" );
471 :    
472 :     foreach my $k ( @rel_lit_num ) {
473 :     my ( $ss, $key, $value ) = @$k;
474 :     $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT", $value );
475 :     }
476 :    
477 :     foreach my $np ( @$newpubs ) {
478 :     $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_PUBMED_RELEVANT", $np );
479 :     }
480 :     }
481 :    
482 : bartels 1.13 ########################################
483 :     # set Literature-string for subsystems #
484 :     ########################################
485 :     sub setWeblinks {
486 :     my ( $fig, $name, $newpubs ) = @_;
487 :    
488 :     my @values;
489 :     my @rel_lit_num = $fig->get_attributes( 'Subsystem:'.$name, "SUBSYSTEM_WEBLINKS" );
490 :    
491 :     foreach my $k ( @rel_lit_num ) {
492 :     my ( $ss, $key, $value ) = @$k;
493 :     $fig->delete_matching_attributes( "Subsystem:$name", "SUBSYSTEM_WEBLINKS", $value );
494 :     }
495 :    
496 :     foreach my $np ( @$newpubs ) {
497 :     my @h = split( /\s+/, $np );
498 :     $fig->add_attribute( "Subsystem:$name", "SUBSYSTEM_WEBLINKS", @h );
499 :     }
500 :     }
501 :    
502 : bartels 1.2 sub supported_rights {
503 :    
504 :     return [ [ 'edit', 'subsystem', '*' ] ];
505 :    
506 : bartels 1.1 }
507 : bartels 1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3