]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 137183 - tab names should be in the template not in the .cgi. Patch by gerv;...
authorgerv%gerv.net <>
Thu, 25 Apr 2002 05:21:56 +0000 (05:21 +0000)
committergerv%gerv.net <>
Thu, 25 Apr 2002 05:21:56 +0000 (05:21 +0000)
template/en/default/account/prefs/prefs.html.tmpl
userprefs.cgi

index 17ce7b5d6a3021ef40f0fdd389081a54b1c12d2b..93f004deaaa087b68292739cb5591a873b194631 100644 (file)
             }"
  %]
 
+[% tabs = [ { name => "account", description => "Account settings", 
+              saveable => "1" },
+            { name => "email", description => "Email settings", 
+              saveable => "1" },
+            { name => "footer", description => "Page footer", 
+              saveable => "1" },
+            { name => "permissions", description => "Permissions", 
+              saveable => "0" } ] %]
+
 <center>
   <table cellspacing="0" cellpadding="10" border="0" width="100%">
     <tr>
       <td class="spacer">&nbsp;</td>
  
       [% FOREACH tab = tabs %]
-        [% IF tab.name == current_tab.name %]
+        [% IF tab.name == current_tab_name %]
+          [% current_tab = tab %]
           <td align="center" bgcolor="lightblue" class="selected_tab">
             [% tab.description %]
           </td>
index 79690563c1b39146e83f13df2e578bb4eb0be781..977dda7eef86450d81cfd9e76f8b5f50ef5d31ba 100755 (executable)
@@ -365,24 +365,7 @@ $vars->{'changes_saved'} = $::FORM{'dosave'};
 
 my $current_tab_name = $::FORM{'tab'} || "account";
 
-my @tabs = ( { name => "account", description => "Account settings", 
-               saveable => "1" },
-             { name => "email", description => "Email settings", 
-               saveable => "1" },
-             { name => "footer", description => "Page footer", 
-               saveable => "1" },
-             { name => "permissions", description => "Permissions", 
-               saveable => "0" } );
-
-# Work out the current tab
-foreach my $tab (@tabs) {
-    if ($tab->{'name'} eq $current_tab_name) {
-        $vars->{'current_tab'} = $tab;
-        last;
-    }
-}
-
-$vars->{'tabs'} = \@tabs;
+$vars->{'current_tab_name'} = $current_tab_name;
 
 # Do any saving, and then display the current tab.
 SWITCH: for ($current_tab_name) {