From da857afa089e79ad16fb833dd1ffe397055fd892 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Sat, 22 Nov 2003 11:50:36 +0000 Subject: Bug 208604 - Make data/template dir locations configurable --- Bugzilla/Template.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index f9342e11f..d981c7a59 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -29,7 +29,7 @@ package Bugzilla::Template; use strict; -use Bugzilla::Config; +use Bugzilla::Config qw(:DEFAULT $templatedir $datadir); use Bugzilla::Util; # for time2str - replace by TT Date plugin?? @@ -37,6 +37,7 @@ use Date::Format (); use base qw(Template); +# XXX - mod_perl my $template_include_path; # Make an ordered list out of a HTTP Accept-Language header see RFC 2616, 14.4 @@ -69,13 +70,16 @@ sub sortAcceptLanguage { # If no Accept-Language is present it uses the defined default sub getTemplateIncludePath () { # Return cached value if available + + # XXXX - mod_perl! if ($template_include_path) { return $template_include_path; } my $languages = trim(Param('languages')); if (not ($languages =~ /,/)) { return $template_include_path = - ["template/$languages/custom", "template/$languages/default"]; + ["$templatedir/$languages/custom", + "$templatedir/$languages/default"]; } my @languages = sortAcceptLanguage($languages); my @accept_language = sortAcceptLanguage($ENV{'HTTP_ACCEPT_LANGUAGE'} || "" ); @@ -92,7 +96,9 @@ sub getTemplateIncludePath () { } push(@usedlanguages, Param('defaultlanguage')); return $template_include_path = - [map(("template/$_/custom", "template/$_/default"), @usedlanguages)]; + [map(("$templatedir/$_/custom", + "$templatedir/$_/default"), + @usedlanguages)]; } @@ -177,7 +183,7 @@ sub create { PRE_CHOMP => 1, TRIM => 1, - COMPILE_DIR => 'data/', + COMPILE_DIR => "$datadir/template", # Functions for processing text within templates in various ways. # IMPORTANT! When adding a filter here that does not override a @@ -321,4 +327,3 @@ Cinstance-Etemplate> to get an already created module. =head1 SEE ALSO L, L