[Rt-commit] rt branch, admin-menu-tweak, updated. rt-3.9.7-12-gd627176

Jesse Vincent jesse at bestpractical.com
Wed Dec 8 16:01:22 EST 2010


The branch, admin-menu-tweak has been updated
       via  d627176b7b41b9098aa6740ff51773896fd11745 (commit)
      from  e984f34892725def8df50a4d64479056b79447f9 (commit)

Summary of changes:
 share/html/Elements/Tabs |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit d627176b7b41b9098aa6740ff51773896fd11745
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Dec 8 16:00:50 2010 -0500

    Give Global Scrips&Templates a bit of navigation love

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 3d5e8a5..8cf8b41 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -347,19 +347,32 @@ if ( $request_path !~ qr{^/SelfService/} ) {
 
     if ( $request_path =~ qr{^/Admin/Global/(Scrip|Template)(s)?\.html} ) {
         my $type = $1;
-        my $plural = $2;
         my $tabs = PageMenu();
-        if ( $plural ) {
-            if ( $request_path eq "/Admin/Global/$type$plural.html" ) {
-                $tabs->child( create => title => loc('Create'), path => "/Admin/Global/$type.html?Create=1" );
-            }
-        }
-        else {
-            $tabs->child( select => title => loc('Select'), path => "/Admin/Global/${type}s.html" );
-            if ( ! $m->request_args->{Create} ) {
-                $tabs->child( create => title => loc('Create'), path => "/Admin/Global/$type.html?Create=1" );
-            }
-        }
+
+        my %labels = (
+            Scrip       => loc('Scrips'),
+            Template    => loc('Templates')
+                     );
+
+        my $section;
+        #if ( $request_path =~ qr{^/Admin/Global/(\w+)s.html$} || $m->request_args->{'Create'} )
+
+        #{
+        #    $section = $tabs;
+
+        #} else {
+            $section = $tabs->child( select => title => $labels{$type},
+                                     path => "/Admin/Global/${type}s.html" );
+        #}
+
+        # With only two elements, swapping between dropdown and menu is kinda dumb
+        # In the glorious future this should be cleaner.
+
+        $section->child( select => title => loc('Select'),
+                         path   => "/Admin/Global/${type}s.html" );
+        $section->child( create => title => loc('Create'),
+                         path => "/Admin/Global/${type}.html?Create=1" );
+
     }
 
     if ( $request_path =~ qr{^/Ticket/} ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list