From d0b442b4782ac9da3fb7dc5995b7af9a8e4d5743 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 Signed-off-by: Tomas Cohen Arazi --- .../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 2d71b20a19..9ee61c05cf 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 %] @@ -2447,6 +2448,8 @@ }); [% 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 1d7fae8377..67f09c5603 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' %] @@ -446,7 +449,7 @@ - [% IF ( AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] [% END %] @@ -458,9 +461,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 %]
@@ -911,6 +914,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 c3593330a7..02b72cfeb6 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 86626d55c7..0d1e8fcae9 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 %]
-