\n\n" ;
}
else
{
my $a_ids = join "\n\t\t, ", @{$setup->{RENDERER}{NODES}{A_IDS}} ;
my $collapsable_ids = join "\n\t\t\t\t, ", @{$setup->{RENDERER}{NODES}{COLLAPSABLE_IDS}} ;
my $collapsed = 0 ;
$collapsed++ if($setup->{RENDERER}{COLLAPSED}) ;
my $class = $setup->{RENDERER}{CLASS} || DHTML_CLASS ;
<
EOS
}
}
#-------------------------------------------------------------------------------------------
1 ;
__END__
=head1 NAME
Data::TreeDumper::Renderer::DHTML - DHTML renderer for B
=head1 SYNOPSIS
use Data::TreeDumper ;
#-------------------------------------------------------------------------------
my $style ;
my $body = DumpTree
(
GetData(), 'Data'
, DISPLAY_ROOT_ADDRESS => 1
, DISPLAY_PERL_ADDRESS => 1
, DISPLAY_PERL_SIZE => 1
, RENDERER =>
{
NAME => 'DHTML'
, STYLE => \$style
, BUTTON =>
{
COLLAPSE_EXPAND => 1
, SEARCH => 1
}
}
) ;
print <Data
$style
$body
EOT
=head1 DESCRIPTION
Simple DHTML renderer for B.
Thanks to Stevan Little author of Tree::Simple::View
for giving me the idea and providing some code I could snatch.
=head1 EXAMPLE
Check B for a complete example of two structure dumps within the same HTML file.
=head1 OPTIONS
=head2 Style
CSS style is dumped to $setup->{RENDERER}{STYLE} (a ref to a scalar) if it exists. This allows you to collect
all the CSS then output it at the top of the HTML code.
my $style ;
my $body = DumpTree
(
...
, RENDERER =>
{
NAME => 'DHTML'
, STYLE => \$style
}
) ;
{RENDERER}{NO_STYLE} removes style section generation. This is usefull when you defined your styles by hand.
my $style ;
my $body = DumpTree
(
...
, RENDERER =>
{
NAME => 'DHTML'
, NO_STYLE => 1
}
) ;
=head2 Class
The output will use class 'data_tree_dumper_dhtml' for
and
. The class can be renamed with the help of
{RENDERER}{CLASS}. This allows you to dump multiple data structures and display them with a diffrent styles.
my $style ;
my $body = DumpTree
(
...
, RENDERER =>
{
NAME => 'DHTML'
, CLASS => 'my_class_name'
}
) ;
=head2 Glyphs
B outputs the tree lines as ASCII text by default. If {RENDERER}{NO_GLYPH} and RENDERER}{NO_STYLE}
are defined, no lines are output and the indentation will be the default
style. If you would like to specify a
specific style for your tree dump, defined you own CSS and set the appropriate class through {RENDERER}{CLASS}.
=head2 Expand/Collapse
Setting {RENDERER}{COLLAPSED} to a true value will display the tree collapsed. this is false by default.
$setup->{RENDERER}{COLLAPSED}++ ;
If {RENDERER}{BUTTON}{COLLAPSE_EXPAND} is set, the rendered will add a button to allow the user to collapse and expand the
tree.
$setup->{RENDERER}{BUTTON}{COLLAPSE_EXPAND}
=head2 Search
If {RENDERER}{BUTTON}{SEARCH} is set, the rendered will add a button to allow the user to search the tree. This is
a primitive search and has no other value than for test.
=head1 Bugs
I'll hapilly hand this module over to someone who knows what he does :-)
Check the TODO file.
=head1 EXPORT
None
=head1 AUTHORS
Khemir Nadim ibn Hamouda.
Staffan Maahlén.
Copyright (c) 2003 Nadim Ibn Hamouda el Khemir and
Staffan Maahlén. All rights reserved.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perlitself.
If you find any value in this module, mail me! All hints, tips, flames and wishes
are welcome at .
=head1 SEE ALSO
B.
=cut