[Jifty-commit] r6792 - jifty/trunk/lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Thu Apr 16 17:08:10 EDT 2009


Author: sartak
Date: Thu Apr 16 17:08:10 2009
New Revision: 6792

Modified:
   jifty/trunk/lib/Jifty/Web.pm

Log:
Add a Jifty->web->qualified_parent_region for munging your sibling
regions

Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Thu Apr 16 17:08:10 2009
@@ -1364,6 +1364,25 @@
             @{ $self->{'region_stack'} || [] }, @_;
 }
 
+=head3 qualified_parent_region [REGION]
+
+Returns the fully qualified name of the current
+L<Jifty::Web::PageRegion>'s parent, or the empty string if there is none.  If
+C<REGION> is supplied, gives the qualified name of C<REGION> were it
+placed in the parent region. You may also use a literal region name.
+
+=cut
+
+sub qualified_parent_region {
+    my $self = shift;
+    my @region_stack = @{ $self->{'region_stack'} || [] };
+    pop @region_stack;
+
+    join "-",
+        map { ref($_) ? $_->name : $_ }
+            @region_stack, @_;
+}
+
 =head2 is_ssl
 
 Indicates whether the current request was made using SSL.


More information about the Jifty-commit mailing list