--- trunk2/lib/WebPAC/Tree.pm 2004/10/19 17:43:52 530 +++ trunk2/lib/WebPAC/Tree.pm 2004/11/01 14:55:16 572 @@ -6,6 +6,7 @@ use Carp; use Log::Log4perl qw(get_logger :levels); use YAML; +use Template; =head1 NAME @@ -14,7 +15,7 @@ =head1 DESCRIPTION This module will create tree from lookup data. It requires quite complicated -data structure, but once you get hang of that, it's peace of case :-) +data structure, but once you get hang of that, it's peace of cake :-) Data structure for tree definition is non-recursive, and defines each level of tree individually (so you can limit depth of tree) like this: @@ -33,6 +34,7 @@ lookup_term => sub { shift @{$l->{"d:".$_[0]}} }, lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, have_children => sub { return $l->{$_[1]} }, + iframe => 1, },{ # level 1 code_arr => sub { @{$_[0]} }, @@ -45,6 +47,7 @@ lookup_term => sub { shift @{$l->{"d:".$_[0]}} }, lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, have_children => sub { 0 }, + style => 'display: none', )}; You can, however, create recursion with C discussed @@ -105,6 +108,15 @@ It's safe to return undef just for next level data (C<$next_lvl> in example above) to stop recursion. +=item iframe + +This optional option will create all children nodes in separate file, and iframe in tree html, +so that generated tee html will have resonable size with large number of nodes. + +=item style + +Optional option to specify style of this node. + =back =head1 METHODS @@ -157,7 +169,9 @@ $tree->output( dir => './out', html => 'browse.html', - template => './output_template/tree.tt', + template_dir => './output_template/', + template_tree => 'tree.tt', + template_node => 'node.tt', js => 'tree-ids.js', ); @@ -166,8 +180,12 @@ C is name of output html file. -C