From 28d977499e7b980504729c73b40e6925e2e8aa10 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 19 Apr 2023 11:23:23 +0000 Subject: [PATCH] Bug 32680: Add classes to template files This patch adds the classes to the template files so that the plugin hook can identify that cover images are required and where to inject them Test plan as per first commit Sponsored-by: PTFS Europe Signed-off-by: Nick Clemens --- .../prog/en/modules/catalogue/detail.tt | 11 ++++++---- .../prog/en/modules/catalogue/results.tt | 10 +++++++--- .../bootstrap/en/modules/opac-detail.tt | 8 +++++++- .../bootstrap/en/modules/opac-results.tt | 20 ++++++++++++------- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 1fdb6fe7eb..3ace22d877 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -9,6 +9,7 @@ [% USE Price %] [% USE TablesSettings %] [% PROCESS 'i18n.inc' %] +[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] [% IF Koha.Preference('AmazonAssocTag') %] [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] @@ -105,7 +106,7 @@ [% END %] - [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
[% ELSE %]
@@ -199,10 +200,10 @@ [% END %]
[%# .page-section %] - [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
-
+
[% IF ( LocalCoverImages ) %] [% IF localimages.count %] [% FOREACH image IN localimages %] @@ -2454,6 +2455,8 @@ Note that permanent location is a code, and location may be an authval. }); [% END %] - + [% IF ( CoverImagePlugins ) %] + [% KohaPlugins.get_plugins_intranet_cover_images | $raw %] + [% END %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index b6e4380640..3c4c68853c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -4,8 +4,11 @@ [% USE Koha %] [% USE Biblio %] [% USE KohaDates %] +[% USE KohaPlugins %] +[% USE To %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] +[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] [% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] @@ -449,7 +452,7 @@ - [% IF ( AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] [% END %] @@ -461,9 +464,9 @@ [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
 Results
-
+
[% IF ( LocalCoverImages ) %][% SEARCH_RESULT.localimage | html %]
@@ -914,6 +917,7 @@ [% END %] [% Asset.js("js/pages/results.js") | $raw %] + [% KohaPlugins.get_plugins_intranet_cover_images | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index ab2f28e615..1d24d44ae0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -6,8 +6,10 @@ [% USE Branches %] [% USE TablesSettings %] [% USE AuthorisedValues %] +[% USE KohaPlugins %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %] +[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] [% IF Koha.Preference('AmazonAssocTag') %] [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] [% ELSE %] @@ -59,7 +61,7 @@
-
+
[% IF ( OPACLocalCoverImages ) %] [% IF localimages.count %] [% FOREACH image IN localimages %] @@ -1454,6 +1456,10 @@ [% Asset.js("js/ratings.js") | $raw %] [% END %] + [% IF ( CoverImagePlugins ) %] + [% KohaPlugins.get_plugins_opac_cover_images | $raw %] + [% END %] + [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %][% END %] [% IF ( Koha.Preference('OPACDetailQRCode') ) %] [% Asset.js("lib/kjua/kjua.min.js") | $raw %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 95fa8d6304..d2754ec452 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -1,8 +1,11 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% USE KohaPlugins %] +[% USE To %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] +[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] [% IF firstPage %] [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] @@ -341,13 +344,14 @@ [% # Cell 4: Search result details and controls %]
-