diff options
author | lpsolit%gmail.com <> | 2005-07-22 14:13:36 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-07-22 14:13:36 +0200 |
commit | e7d2b86c2765c3a8e853526683ceacdb260a7996 (patch) | |
tree | 90fc70fd199e7bfc5ae5656ceadafbe6c8afe4d7 /Bugzilla | |
parent | d0303ab3ecb54eef2ed1b5e55839eada16748416 (diff) | |
download | bugzilla-e7d2b86c2765c3a8e853526683ceacdb260a7996.tar.gz bugzilla-e7d2b86c2765c3a8e853526683ceacdb260a7996.tar.xz |
Bug 301507: Move PutHeader and PutFooter into Template.pm - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Template.pm | 19 |
1 files changed, 19 insertions, 0 deletions
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 |