[Rt-commit] r4695 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Sun Mar 5 13:52:44 EST 2006


Author: ruz
Date: Sun Mar  5 13:52:38 2006
New Revision: 4695

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout

Log:
 r2103 at cubic-pc:  cubic | 2006-03-05 21:58:17 +0300
 * if deepest branch is inactive in tabs hashes then code could
   choose such level as page tabs for non 3.4-compat stylesheets.
   fix this in .menu_recurse subcomps by following only active
   branches.


Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/PageLayout	Sun Mar  5 13:52:38 2006
@@ -175,7 +175,7 @@
 my ($menu_depth, $almost_last, $page_tabs);
 
 if (RT->Config->Get( 'WebDefaultStylesheet', $session{'CurrentUser'} ) ne '3.4-compat') {
-    ($menu_depth, $almost_last) = @{$m->comp('.menu_recurse', data => $toptabs)};
+    ($menu_depth, $almost_last) = @{ $m->comp('.menu_recurse', data => $toptabs, current => $current_toptab ) };
 
     if (defined $almost_last->{subtabs} and %{$almost_last->{subtabs}}) {
         $page_tabs = {
@@ -199,20 +199,25 @@
 %# the last submenu.
 <%def .menu_recurse>
   <%args>
-      $data   => { }
-      $pdata  => { }
-      $ppdata => { }
-      $level  => 0
+      $data    => { }
+      $current => ''
+      $pdata   => { }
+      $ppdata  => { }
+      $level   => 0
   </%args>
   <%init>
       for my $key (keys %$data) {
-          return $m->comp('.menu_recurse', data   => $data->{$key}->{subtabs},
-                                           pdata  => $data->{$key},
-                                           ppdata => $pdata,
-                                           level  => $level+1)
-              if ref($data->{$key}) eq 'HASH'
-                 and defined $data->{$key}->{subtabs}
-                 and %{$data->{$key}->{subtabs}};
+          next if $data->{$key}->{'path'} ne $current;
+          next unless    ref( $data->{$key} ) eq 'HASH'
+                      && ref( $data->{$key}->{'subtabs'} ) eq 'HASH'
+                      && keys %{ $data->{$key}->{'subtabs'} };
+          return $m->comp('.menu_recurse',
+              data    => $data->{$key}->{'subtabs'},
+              current => $data->{$key}->{'current_subtab'} || '',
+              pdata   => $data->{$key},
+              ppdata  => $pdata,
+              level   => $level + 1,
+          );
       }
       $ppdata->{last_system_menu_level}++;
       return [$level, $pdata];


More information about the Rt-commit mailing list