[CNANDOR - Wed Apr 14 17:59:26 2004]:
Argh, and I attached the full file, not the diff. Sigh. Sam, please accept this patch. :-)
Module coming next.
--
Chris Nandor pudge@pobox.com
http://pudge.net/
Open Source Development Network pudge@osdn.com
http://osdn.com/
--- /usr/local/lib/perl5/site_perl/5.8.2/HTML/PopupTreeSelect.pm Wed Apr 14 14:07:10 2004
+++ /Users/pudge/Desktop/PopupTreeSelect.pm Wed Apr 14 14:05:57 2004
@@ -290,9 +290,9 @@
}
sub output {
- my $self = shift;
+ my($self, $template) = @_;
our $TEMPLATE_SRC;
- my $template = HTML::Template->new(scalarref => \$TEMPLATE_SRC,
+ $template ||= HTML::Template->new(scalarref => \$TEMPLATE_SRC,
die_on_bad_params => 0,
global_vars => 1,
);
@@ -304,8 +304,8 @@
);
# setup template parameters
- $template->param(loop => \@loop);
- $template->param(map { ($_, $self->{$_}) } qw(name height width
+ my %param = (loop => \@loop,
+ map { ($_, $self->{$_}) } qw(name height width
indent_width onselect
form_field form_field_form
button_label
@@ -314,10 +314,15 @@
scrollbars hide_selects
hide_textareas
));
-
-
+
# get output for the widget
- my $output = $template->output;
+ my $output;
+ if ($self->can('_output_get')) {
+ $output = $self->_output_get($template, \%param, $TEMPLATE_SRC);
+ } else {
+ $template->param(map { ($_, $param{$_}) } keys %param );
+ $output = $template->output;
+ }
return $output;
}