Extending RT: Avoiding the Footer

Hello List,
this may be a no-brainer, but I get shot down trying to create pngs
using GD::Graph directly the way I do it right now because /share/html/Elements/Footer gets appended to everything called via
Mason. I have two files:
/share/html/Statistics/CallsQueueDay/index.html and
/share/html/Statistics/Elements/Chart.

CallsQueueDay/index.html is where the statistics data is collected.
Within is the following code, which is presumed to generate a png graph
courtesy of Elements/Chart and GD::Graph (see code samples below).
Unfortunately, what I get is the png data, followed by the html needed
for the footer
"

<div class…"

Any hints how I can easily avoid this footer?

Regards,
Harald

<CallsQueueDay/index.html>:
[snip]
<%perl>
my $url = $RT::WebURL.’/Statistics/Elements/Chart?’;
for (0…$#data) {
$url .= “x_labels=” . $data[0][$] . “&”;
}
shift @data;
for (0…$#data) {
$url .= “data”.(1+$
)."=".(join “,”, @{$data[$_]})."&";
}
chop $url;
</%perl>



[snip]

<Elements/Chart>:
<%perl>
print $graph->plot(@data)->$format();
</%perl>
<%INIT>
use GD::Graph::lines;
my $graph = GD::Graph::lines->new(400,300);
$graph->set(export_format => “png”);
my @data;
my @argslist;
push @data, $ARGS{x_labels};
push @argslist, split /,/ , $ARGS{data1};
push @data, @argslist;
push @argslist, split /,/ , $ARGS{data2};
push @data, @argslist;
push @argslist, split /,/ , $ARGS{data3};
push @data, @argslist;
my $format = $graph->export_format;
$r->header_out(“image/$format”);
</%INIT>
<%ARGS>
</%ARGS>

Well, you can call $m->abort() which will prevent RT3’s autohandler from
doing anymore work. A better solution would be to modify the autohandler
to look at the URI ($r->uri()) and decide based on the uri if it makes
sense to include headers/footers/etc.

Matt

Well, you can call $m->abort() which will prevent RT3’s autohandler
from
doing anymore work.

Great that will do for the first incarnation. Expect a preliminary
release of the Statistics tool this week (after I fixed the parameter
passing issues), thanks to Matt Knopp!

Regards,
Harald