Skip Menu |

This queue is for tickets about the HTML-PopupTreeSelect CPAN distribution.

Report information
The Basics
Id: 5597
Status: open
Priority: 0/
Queue: HTML-PopupTreeSelect

People
Owner: Nobody in particular
Requestors: jonas [...] paranormal.se
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Template::PopupTreeSelect
Since I use Template-Toolkit for everything else, I wanted Template::PopupTreeSelect, in case I wanted to modify the code or integrate it more. Also for reusing the compiled code in memory. Do you mind if I publish this, or do you want to do it yourself?

Message body not shown because it is not plain text.

From: jonas [...] cpan.org
Oups. That file didn't containg anything. New version, now with a manifest. :)

Message body not shown because it is not plain text.

I have a version of your module here which inherits from Template::PopupTreeSelect instead of copying and pasting almost the whole thing. Also, I have a small patch to Template:: PopupTreeSelect itself to make inheriting easier. The patch is attached. I'll send the new version of Template::PopupTreeSelect separately, since I can only attach one file in this form. -- Chris Nandor pudge@pobox.com http://pudge.net/ Open Source Development Network pudge@osdn.com http://osdn.com/

Message body is not shown because it is too large.

[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; }
[CNANDOR - Wed Apr 14 18:04:21 2004]: Show quoted text
> [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.
Here it is, Template::PopupTreeSelect, the slim version. -- Chris Nandor pudge@pobox.com http://pudge.net/ Open Source Development Network pudge@osdn.com http://osdn.com/

Message body is not shown because it is too large.

I think I see where you're going, but the patch needs three things before I'll accept it. 1) Docs, 2) tests and 3) a better name for "_output_get". Thanks, -sam
Sure, go right ahead!
From: JONAS [...] cpan.org
On Thu Apr 15 13:19:30 2004, SAMTREGAR wrote: Show quoted text
> I think I see where you're going, but the patch needs three things > before I'll accept it. 1) Docs, 2) tests and 3) a better name for > "_output_get".
Sorry for the delay. :) ... I have applied the patch and put it in a new version of the module. I'll try to upload it to CPAN...

Message body not shown because it is not plain text.

From: JONAS [...] cpan.org
Template::PopupTreeSelect is now availible in CPAN. This ticket can now be closed. http://search.cpan.org/~jonas/Template-PopupTreeSelect-0.9/