View | Details | Raw Unified | Return to bug 9570
Collapse All | Expand All

(-)a/opac/opac-showmarc.pl (-5 / +12 lines)
Lines 58-75 else { Link Here
58
if ($view eq 'card' || $view eq 'html') {
58
if ($view eq 'card' || $view eq 'html') {
59
    my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
59
    my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
60
    my $xslfile;
60
    my $xslfile;
61
    my $themelang = '/' . C4::Context->preference("opacthemes") .  '/' . C4::Templates::_current_language();
61
    my $xslfilename;
62
    my $htdocs  = C4::Context->config('opachtdocs');
63
    my $theme   = C4::Context->preference("opacthemes");
64
    my $lang = C4::Templates::_current_language();
62
65
63
    if ($view eq 'card'){
66
    if ($view eq 'card'){
64
        $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/compact.xsl";
67
        $xslfile = "compact.xsl";
65
    }
68
    }
66
    else { # must be html
69
    else { # must be html
67
        $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/MARC21slim2OPACMARCdetail.xsl";
70
        $xslfile = C4::Context->preference('marcflavour') . "slim2OPACMARCdetail.xsl";
68
    }
71
    }
72
    $xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile";
73
    $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
74
    $xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( -f $xslfile );
75
    $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
76
69
    my $parser = XML::LibXML->new();
77
    my $parser = XML::LibXML->new();
70
    my $xslt   = XML::LibXSLT->new();
78
    my $xslt   = XML::LibXSLT->new();
71
    my $source = $parser->parse_string($xmlrecord);
79
    my $source = $parser->parse_string($xmlrecord);
72
    my $style_doc = $parser->parse_file($xslfile);
80
    my $style_doc = $parser->parse_file($xslfilename);
73
    my $stylesheet = $xslt->parse_stylesheet($style_doc);
81
    my $stylesheet = $xslt->parse_stylesheet($style_doc);
74
    my $results = $stylesheet->transform($source);
82
    my $results = $stylesheet->transform($source);
75
    my $newxmlrecord = $stylesheet->output_string($results);
83
    my $newxmlrecord = $stylesheet->output_string($results);
76
- 

Return to bug 9570