| 1 | # $File: //member/autrijus/DBIx-ReportBuilder/lib/DBIx/ReportBuilder/Render/HTML.pm $ $Author: autrijus $ | ||
| 2 | # $Revision: #6 $ $Change: 8292 $ $DateTime: 2003/09/28 23:47:26 $ | ||
| 3 | |||
| 4 | package DBIx::ReportBuilder::Render::HTML; | ||
| 5 | use base 'DBIx::ReportBuilder::Render'; | ||
| 6 | use strict; | ||
| 7 | |||
| 8 | sub new { | ||
| 9 | my ($class, %args) = @_; | ||
| 10 | my $self = $class->SUPER::new( | ||
| 11 | %args, | ||
| 12 | twig_handlers => { | ||
| 13 | preamble => \§ion, | ||
| 14 | header => \§ion, | ||
| 15 | content => \§ion, | ||
| 16 | footer => \§ion, | ||
| 17 | postamble => \§ion, | ||
| 18 | graph => sub { $_[0]->plotGraph($_[1]) }, | ||
| 19 | }, | ||
| 20 | pretty_print => ($args{pretty_print} || 'none'), | ||
| 21 | ); | ||
| 22 | }; | ||
| 23 | |||
| 24 | sub section { | ||
| 25 | if ($_->att('separator')) { | ||
| 26 | if ($_->tag eq 'header') { | ||
| 27 | $_->insert_new_elt(last_child => 'hr'); | ||
| 28 | } | ||
| 29 | elsif ($_->tag eq 'footer') { | ||
| 30 | $_->insert_new_elt(first_child => 'hr'); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | $_->att('hidden') ? $_->delete : $_->erase; | ||
| 34 | } | ||
| 35 | |||
| 36 | 1; |