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 <gmcharlt@gmail.com>
This commit is contained in:
Galen Charlton 2010-05-08 18:59:41 -04:00
parent 3d8e99e5ec
commit e7f8cc8f5e
2 changed files with 20 additions and 2 deletions

View file

@ -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 );
}

View file

@ -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";
}