fix tabs and tabsets in FormBuilder

This commit is contained in:
Doug Bell 2010-12-21 14:32:03 -06:00
parent 6dea8e8d05
commit 0b5614ad1c
2 changed files with 42 additions and 16 deletions

View file

@ -139,4 +139,30 @@ sub toHtml {
return $html;
}
#----------------------------------------------------------------------------
=head2 toTemplateVars ( )
Return a hashref of template vars to re-create this tabset
=cut
sub toTemplateVars {
my ( $self ) = @_;
my $var = {};
$var->{ tabs } = [];
for my $tab ( $self->tabs ) {
my $name = $tab->name;
my $props = $tab->toTemplateVars;
$var->{ "tabs_${name}" } = $tab->toHtml;
push @{$var->{tabs}}, $props;
for my $key ( %$props ) {
$var->{ "tabs_${name}_${key}" } = $props->{$key};
}
}
return $var;
}
1;