From ea25630305fbd3b55c142c32aab82f9cc7afccfa Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 11 Aug 2009 04:34:17 +0000 Subject: Bug 509045: Make "use_keywords" a global template variable instead of having to pass it to templates all the time Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- Bugzilla/Template.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 49954a521..22ea4b7cc 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -37,7 +37,9 @@ use strict; use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Install::Requirements; -use Bugzilla::Install::Util qw(install_string template_include_path include_languages); +use Bugzilla::Install::Util qw(install_string template_include_path + include_languages); +use Bugzilla::Keyword; use Bugzilla::Util; use Bugzilla::User; use Bugzilla::Error; @@ -752,6 +754,10 @@ sub create { return $cache->{template_bug_fields}; }, + # Whether or not keywords are enabled, in this Bugzilla. + 'use_keywords' => sub { return Bugzilla::Keyword->any_exist; }, + + # These don't work as normal constants. DB_MODULE => \&Bugzilla::Constants::DB_MODULE, REQUIRED_MODULES => -- cgit v1.2.3-24-g4f1b