From e7d2b86c2765c3a8e853526683ceacdb260a7996 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 22 Jul 2005 12:13:36 +0000 Subject: Bug 301507: Move PutHeader and PutFooter into Template.pm - Patch by Frédéric Buclin r/a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Template.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 7efd3a16e..5c5aff574 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -34,11 +34,13 @@ use strict; use Bugzilla::Config qw(:DEFAULT $templatedir $datadir); use Bugzilla::Util; use Bugzilla::User; +use Bugzilla::Error; # for time2str - replace by TT Date plugin?? use Date::Format (); use base qw(Template); +use vars qw($vars); # Convert the constants in the Bugzilla::Constants module into a hash we can # pass to the template object for reflection into its "constants" namespace @@ -130,6 +132,23 @@ sub getTemplateIncludePath () { @usedlanguages)]; } +# Write the header for non yet templatized .cgi files. +sub put_header { + my $self = shift; + ($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_); + + $self->process("global/header.html.tmpl", $vars) + || ThrowTemplateError($self->error()); + $vars->{'header_done'} = 1; +} + +# Write the footer for non yet templatized .cgi files. +sub put_footer { + my $self = shift; + $self->process("global/footer.html.tmpl", $vars) + || ThrowTemplateError($self->error()); +} + ############################################################################### # Templatization Code -- cgit v1.2.3-24-g4f1b