X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FPages%2FGraph.pm;fp=ND%2FWeb%2FPages%2FGraph.pm;h=599051a53cf40b42f1e5b9dc5f559918ea062829;hb=256609e2df07f5dd40a33ace6163d2b72a269246;hp=605c60774cbfc4ef707c2740aa4f3221164963de;hpb=06830a05ebd5541e52f8ca4e421286c1313420c7;p=ndwebbie.git diff --git a/ND/Web/Pages/Graph.pm b/ND/Web/Pages/Graph.pm index 605c607..599051a 100644 --- a/ND/Web/Pages/Graph.pm +++ b/ND/Web/Pages/Graph.pm @@ -24,23 +24,17 @@ use CGI qw/:standard/; use ND::Include; use ND::Web::Graph; -$ND::PAGES{graph} = {parse => \&parse, process => \&process, render=> \&render}; +our @ISA = qw/ND::Web::Image/; -sub parse { - my ($uri) = @_; - $ND::USETEMPLATE = 0; -} +$ND::Web::Page::PAGES{graph} = 'ND::Web::Pages::Graph'; -sub process { - -} - -sub render { - my ($DBH,$uri) = @_; +sub render_body { + my $self = shift; + my $DBH = $self->{DBH}; my $type; my ($x,$y,$z); - if ($uri =~ m{^/\w+/(stats|ranks)/(.*)}){ + if ($self->{URI} =~ m{^/\w+/(stats|ranks)/(.*)}){ $type = $1; if ($2 =~ m{(\d+)(?: |:)(\d+)(?:(?: |:)(\d+))?$}){ $x = $1; @@ -92,9 +86,7 @@ sub render { die 'no image' unless defined $img; - print header(-type=> 'image/png', -Content_Length => length $img); - binmode STDOUT; - print $img; -} + return $img; +}; 1;