Bug 137183 - tab names should be in the template not in the .cgi. Patch by gerv; r=afranke, myk.

This commit is contained in:
gerv%gerv.net 2002-04-24 22:21:59 +00:00
Родитель ce5200db57
Коммит c14e575755
2 изменённых файлов: 12 добавлений и 19 удалений

Просмотреть файл

@ -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" } ] %]
<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>

Просмотреть файл

@ -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) {