From: Galen Charlton Date: Sat, 8 May 2010 22:59:41 +0000 (-0400) Subject: bug 4403: look in appropriate theme/lang for bib display XSL X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=e7f8cc8f5e8a699920e50a4b7dd2577e69f53be3;p=koha.git bug 4403: look in appropriate theme/lang for bib display XSL Note: approach used can be described as a hack at best; the current language should probably become a session attribute. Signed-off-by: Galen Charlton --- 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"; }