|
Lines 23-28
package C4::XSLT;
Link Here
|
| 23 |
|
23 |
|
| 24 |
use Modern::Perl; |
24 |
use Modern::Perl; |
| 25 |
use base 'Exporter'; |
25 |
use base 'Exporter'; |
|
|
26 |
use Koha::Caches; |
| 26 |
use Koha::XSLT::Base; |
27 |
use Koha::XSLT::Base; |
| 27 |
use XML::LibXML; |
28 |
use XML::LibXML; |
| 28 |
use Encode; |
29 |
use Encode; |
|
Lines 486-491
sub CustomXSLTExportList {
Link Here
|
| 486 |
my $opac = shift; # opac (1) vs intranet (0) |
487 |
my $opac = shift; # opac (1) vs intranet (0) |
| 487 |
return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; |
488 |
return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; |
| 488 |
|
489 |
|
|
|
490 |
# Check the cache first |
| 491 |
my $cache = Koha::Caches->get_instance; |
| 492 |
my $key = $opac ? 'CustomXSLTExportListOPAC' : 'CustomXSLTExportListIntra'; |
| 493 |
my $cached_val = $cache->get_from_cache($key); |
| 494 |
return $cached_val if $cached_val; |
| 495 |
|
| 489 |
my @tabFiles; |
496 |
my @tabFiles; |
| 490 |
|
497 |
|
| 491 |
my $dir = C4::Context->config( $opac ? 'opachtdocs' : 'intrahtdocs') . |
498 |
my $dir = C4::Context->config( $opac ? 'opachtdocs' : 'intrahtdocs') . |
|
Lines 522-527
sub CustomXSLTExportList {
Link Here
|
| 522 |
push @tabFiles, \%row; |
529 |
push @tabFiles, \%row; |
| 523 |
} |
530 |
} |
| 524 |
} |
531 |
} |
|
|
532 |
$cache->set_in_cache( $key, [ @tabFiles ] ); |
| 525 |
return \@tabFiles; |
533 |
return \@tabFiles; |
| 526 |
} |
534 |
} |
| 527 |
1; |
535 |
1; |