should speed up most template processing where there is more than 1 form variable.

This commit is contained in:
Matthew Wilson 2006-04-25 12:39:05 +00:00
parent 8657769993
commit 8aa438fa67

View file

@ -26,7 +26,7 @@ Appends session variables to the variable list.
=head3 vars
A reference the template variable hash.
A reference to the template variable hash.
=cut
@ -41,8 +41,14 @@ sub addSessionVars {
$vars->{"session.var.adminOn"} = $self->session->var->isAdminOn;
$vars->{"session.setting.companyName"} = $self->session->setting->get("companyName");
$vars->{"session.setting.anonymousRegistration"} = $self->session->setting->get("anonymousRegistration");
foreach my $field ($self->session->form->param) {
$vars->{"session.form.".$field} = $self->session->form->param($field);
my $forms = $self->session->form->paramsHashRef();
foreach my $field (keys %$forms) {
if $forms->{$field} {
$vars->{"session.form.".$field} =
(ref($forms->{$field}) eq 'ARRAY')
?$forms->{$field}[$forms->{$field}[-1]]
:$forms->{$field};
}
}
$vars->{"webgui.version"} = $WebGUI::VERSION;
$vars->{"webgui.status"} = $WebGUI::STATUS;