diff options
author | mkanat%bugzilla.org <> | 2009-10-21 01:08:03 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-10-21 01:08:03 +0200 |
commit | 700f6a062970e2c23510e3f6a47c88e069047a04 (patch) | |
tree | d53c1c06e4f64c4978d666be6131258d1582e1bd /Bugzilla/Template.pm | |
parent | 41d57c9f222ccf154eda5ecc2db94b406029a71c (diff) | |
download | bugzilla-700f6a062970e2c23510e3f6a47c88e069047a04.tar.gz bugzilla-700f6a062970e2c23510e3f6a47c88e069047a04.tar.xz |
Bug 394438: Add a hook for adding template vars to any page (Override Template->process)
Patch by Matt Rogers <mattr@kde.org> r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index f94cb2e38..2e2ac4b08 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -79,6 +79,19 @@ sub _load_constants { return \%constants; } +# Overload Template::Process in order to add a hook to allow additional +# variables to be made available by an extension +sub process { + my $self = shift; + my ($file, $vars) = @_; + + Bugzilla::Hook::process("template-before_process", + { vars => $vars, file => $file, + template => $self }); + + return $self->SUPER::process(@_); +} + # Returns the path to the templates based on the Accept-Language # settings of the user and of the available languages # If no Accept-Language is present it uses the defined default |