diff --git a/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl b/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl index 17ce7b5d6a30..93f004deaaa0 100644 --- a/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl +++ b/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl @@ -49,13 +49,23 @@ }" %] +[% 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" } ] %] +
[% FOREACH tab = tabs %] - [% IF tab.name == current_tab.name %] + [% IF tab.name == current_tab_name %] + [% current_tab = tab %] diff --git a/webtools/bugzilla/userprefs.cgi b/webtools/bugzilla/userprefs.cgi index 79690563c1b3..977dda7eef86 100755 --- a/webtools/bugzilla/userprefs.cgi +++ b/webtools/bugzilla/userprefs.cgi @@ -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) {
  [% tab.description %]