Subject: | Multiple roots? |
I need multiple root categories. By allowing an array to be passed to _output_node and looping over it, that seems to accomplish what I need. Here's a patch. Thanks.
--- PopupTreeSelect.pm Thu Sep 11 14:11:36 2003
+++ /usr/local/lib/perl5/site_perl/5.8.2/HTML/PopupTreeSelect.pm Thu Apr 15 08:05:46 2004
@@ -325,9 +325,18 @@
# recursively add nodes to the output loop
sub _output_node {
my ($self, %arg) = @_;
- my $node = $arg{node};
+ my $node1 = $arg{node};
+ my @nodes;
+ if (ref $node1 eq 'ARRAY') {
+ @nodes = @$node1;
+ } else {
+ @nodes = ($node1);
+ }
+
+ for my $node (@nodes) {
my $id = next_id();
+
push @{$arg{loop}}, { label => $node->{label},
value => $node->{value},
id => $id,
@@ -343,7 +352,7 @@
}
push @{$arg{loop}}, { end_block => 1 };
}
-
+ }
}
{