package Bryar::Renderer::TTBugfix;
use base 'Bryar::Renderer::TT';

=head1 NAME

Bryar::Renderer::TTBugfix - Fixed Template Toolkit Renderer for Bryar

=head1 DESCRIPTION

The Template Toolkit seems to be unable to access the $bryar->arguments()
member from the bryar variable (as bryar.arguments inside the template), so
this class adds it as a separate template variable.

NOTE! This is obsolete. See http://rt.cpan.org/NoAuth/Bug.html?id=6326 for
a discussion. Short answer: simply remove the calendar.

=cut


sub _tt_process {
    my ($class, $filename, $bryar, @documents) = @_;
    my $output;
    my $tt = $class->_tt($bryar);

    $tt->process($filename, {
        documents => \@documents,
        bryar     => $bryar,
	arguments => $bryar->arguments(),
    }, \$output);
    if (!$output) {
        $bryar->{config}->frontend->report_error("Template Error",
<<EOF
An error occurred while processing the templates for the blog. The
error as reported by Template Toolkit was:

<PRE>
@{[ $tt->error ]}
</PRE>
EOF
        );
    }
    return $output;
}

1;

