]> git.p6c8.net - selfforum.git/commitdiff
change_posting_visibility(): works now recursive, todo: delete 'invisible'
authorfox_two <>
Tue, 27 Feb 2001 21:30:10 +0000 (21:30 +0000)
committerfox_two <>
Tue, 27 Feb 2001 21:30:10 +0000 (21:30 +0000)
flag instead of setting it to 0

selfforum-cgi/shared/Posting/Handle.pm

index 27c211b64ac8d4b187ed5af5d2cd5a360777d7d9..11ec9aa6d8960ee8d39e64b011ccf8e577b0dd50 100644 (file)
@@ -17,7 +17,7 @@ use base qw(Exporter);
 
 @EXPORT = qw(hide_posting recover_posting);
 
-use Posting::_lib;
+use Posting::_lib qw(get_message_node);
 
 use XML::DOM;
 
@@ -80,9 +80,16 @@ sub change_posting_visibility($$$)
     my $parser = new XML::DOM::Parser;
     my $xml = $parser->parsefile($fname);
 
+    # Set flag in given msg
     my $mnode = get_message_node($xml, $tid, $mid);
     $mnode->setAttribute('invisible', $invisible);
 
+    # Set flag in sub nodes
+    for ($mnode->getElementsByTagName('Message'))
+    {
+        $_->setAttribute('invisible', $invisible);
+    }
+
     $xml->printToFile($fname.'.temp');
     rename $fname.'.temp', $fname;
 }

patrick-canterino.de