From d8df1674801ce2392cfdd78114c5a4f6eb96f840 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 16 Sep 2005 05:16:51 +0000 Subject: Bug 282686: Multiple projects sharing the same Bugzilla codebase (different datastores) - Patch by guillomovitch@zarb.org r=wurblzap a=justdave --- Bugzilla/Template.pm | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 92201507f..a4b8084d0 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -34,7 +34,7 @@ package Bugzilla::Template; use strict; use Bugzilla::Constants; -use Bugzilla::Config qw(:DEFAULT $templatedir $datadir); +use Bugzilla::Config qw(:DEFAULT $templatedir $datadir $project); use Bugzilla::Util; use Bugzilla::User; use Bugzilla::Error; @@ -110,10 +110,21 @@ sub getTemplateIncludePath { } my $languages = trim(Param('languages')); if (not ($languages =~ /,/)) { - return $template_include_path = - ["$templatedir/$languages/custom", - "$templatedir/$languages/extension", - "$templatedir/$languages/default"]; + if ($project) { + $template_include_path = [ + "$templatedir/$languages/$project", + "$templatedir/$languages/custom", + "$templatedir/$languages/extension", + "$templatedir/$languages/default" + ]; + } else { + $template_include_path = [ + "$templatedir/$languages/custom", + "$templatedir/$languages/extension", + "$templatedir/$languages/default" + ]; + } + return $template_include_path; } my @languages = sortAcceptLanguage($languages); my @accept_language = sortAcceptLanguage($ENV{'HTTP_ACCEPT_LANGUAGE'} || "" ); @@ -129,11 +140,27 @@ sub getTemplateIncludePath { } } push(@usedlanguages, Param('defaultlanguage')); - return $template_include_path = - [map(("$templatedir/$_/custom", - "$templatedir/$_/extension", - "$templatedir/$_/default"), - @usedlanguages)]; + if ($project) { + $template_include_path = [ + map(( + "$templatedir/$_/$project", + "$templatedir/$_/custom", + "$templatedir/$_/extension", + "$templatedir/$_/default" + ), @usedlanguages + ) + ]; + } else { + $template_include_path = [ + map(( + "$templatedir/$_/custom", + "$templatedir/$_/extension", + "$templatedir/$_/default" + ), @usedlanguages + ) + ]; + } + return $template_include_path; } sub put_header { -- cgit v1.2.3-24-g4f1b