diff --git a/C4/Output.pm b/C4/Output.pm index b512f30ccd..49a0ff0407 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -134,6 +134,17 @@ sub gettemplate { return $template; } +# FIXME - this is a horrible hack to cache +# the current known-good language, temporarily +# put in place to resolve bug 4403. It is +# used only by C4::XSLT::XSLTParse4Display; +# the language is set via the usual call +# to themelanguage. +my $_current_language = 'en'; +sub _current_language { + return $_current_language; +} + #--------------------------------------------------------------------------------------------------------- # FIXME - POD sub themelanguage { @@ -193,6 +204,8 @@ sub themelanguage { #} } } + + $_current_language = $lang; # FIXME part of bad hack to paper over bug 4403 return ( $theme, $lang ); } diff --git a/C4/XSLT.pm b/C4/XSLT.pm index e67aa54b10..6fd93b480f 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -27,6 +27,7 @@ use C4::Koha; use C4::Biblio; use C4::Circulation; use C4::Reserves; +use C4::Output qw//; use Encode; use XML::LibXML; use XML::LibXSLT; @@ -146,12 +147,16 @@ sub XSLTParse4Display { my $xslfile; if ($interface eq 'intranet') { $xslfile = C4::Context->config('intrahtdocs') . - "/prog/en/xslt/" . + '/' . C4::Context->preference("template") . + '/' . C4::Output::_current_language() . + '/xslt/' . C4::Context->preference('marcflavour') . "slim2intranet$xsl_suffix.xsl"; } else { $xslfile = C4::Context->config('opachtdocs') . - "/prog/en/xslt/" . + '/' . C4::Context->preference("opacthemes") . + '/' . C4::Output::_current_language() . + '/xslt/' . C4::Context->preference('marcflavour') . "slim2OPAC$xsl_suffix.xsl"; }