##@file # Menu ##@class # Menu # # Display a menu on protected applications package Lemonldap::NG::Handler::ApacheMP2::Menu; use strict; use base qw(Lemonldap::NG::Handler::ApacheMP2::Main); use Apache2::Filter (); use constant BUFF_LEN => 8192; sub handler { my $r = pop; __PACKAGE__->run($r); } ## @rmethod Apache2::Const run(Apache2::Filter f) # Overload main run method # @param f Apache2 Filter # @return Apache2::Const::OK sub run { my $class = shift; my $f = $_[0]; unless ( $f->ctx ) { $f->r->headers_out->unset('Content-Length'); $f->ctx(1); } # CSS parameters my $background = "#ccc"; my $border = "#aaa"; my $width = "30%"; my $marginleft = "35%"; my $marginright = "35%"; my $menudiv = qq(
); while ( $f->read( my $buffer, BUFF_LEN ) ) { $buffer =~ s/<\/body>/$menudiv<\/body>/g; $f->print($buffer); } return $class->OK; } 1;