[MKDoc-commit] [1.6] make hidden child documents showable to hidden documents

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Thu Aug 4 12:19:46 BST 2005


Log Message:
-----------
[1.6] make hidden child documents showable to hidden documents

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/flo/Record:
        Document.pm

-------------- next part --------------
Index: Document.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/Record/Document.pm,v
retrieving revision 1.25.2.69
retrieving revision 1.25.2.70
diff -Lflo/Record/Document.pm -Lflo/Record/Document.pm -u -r1.25.2.69 -r1.25.2.70
--- flo/Record/Document.pm
+++ flo/Record/Document.pm
@@ -82,7 +82,7 @@
 ##
 # $self->is_showable()
 # --------------------
-# Returns TRUE if this object is hidden, FALSE otherwise.
+# Returns FALSE if this object is hidden or a versioned backup, TRUE otherwise.
 ##
 sub is_showable
 {
@@ -92,6 +92,21 @@
 		 $self->is_deleted_version() );
 }
 
+=pod
+
+  $self->is_showable_to_hidden()
+
+Returns FALSE if this object is a versioned backup, TRUE otherwise.
+
+=cut
+
+sub is_showable_to_hidden
+{
+    my $self = shift;
+    return not ( $self->is_modified_version() ||
+		 $self->is_deleted_version() );
+}
+
 
 ##
 # $self->is_hidden();
@@ -1691,7 +1706,15 @@
 sub children_showable
 {
     my $self = shift;
-    my @res  = map { $_->is_showable() ? $_ : () } $self->children;
+    my @res;
+    if ($self->is_showable)
+    {
+        @res  = map { $_->is_showable() ? $_ : () } $self->children;
+    }
+    else
+    {
+        @res  = map { $_->is_showable_to_hidden() ? $_ : () } $self->children;
+    }
     return wantarray ? @res : \@res;
 }
 


More information about the MKDoc-commit mailing list