Bugzilla – Attachment 149868 Details for
Bug 32680
Add hooks to allow cover images to be provided by plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32680: Add cover images plugin hook
Bug-32680-Add-cover-images-plugin-hook.patch (text/plain), 2.38 KB, created by
Matt Blenkinsop
on 2023-04-19 11:24:58 UTC
(
hide
)
Description:
Bug 32680: Add cover images plugin hook
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-04-19 11:24:58 UTC
Size:
2.38 KB
patch
obsolete
>From 463262ce1ee84ac8b5742adbeb5aef0d026a7a74 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 19 Apr 2023 11:21:02 +0000 >Subject: [PATCH] Bug 32680: Add cover images plugin hook > >This patch adds a plugin hook to inject cover images into the templates > >Test plan: >1) Apply all patches >2) Go to https://github.com/PTFS-Europe/koha-plugin-addBDSCovers >3) In the releases section, download the .kpz file >4) Upload this in the plugins section and enable the plugin >5) In either the OPAC or staff client, search the catalog >6) The results should have cover art from BDS covers >7) Click on a result and the detail page should also have the cover art >--- > Koha/Template/Plugin/KohaPlugins.pm | 52 +++++++++++++++++++++++++++++ > 1 file changed, 52 insertions(+) > >diff --git a/Koha/Template/Plugin/KohaPlugins.pm b/Koha/Template/Plugin/KohaPlugins.pm >index 4a6e27c221..7d527b34e3 100644 >--- a/Koha/Template/Plugin/KohaPlugins.pm >+++ b/Koha/Template/Plugin/KohaPlugins.pm >@@ -230,4 +230,56 @@ sub get_plugins_intranet_catalog_biblio_tab { > return $tabs; > } > >+=head3 get_plugins_intranet_cover_images >+ >+[% KohaPlugins. get_plugins_intranet_cover_images %] >+ >+This method collects the output of all plugins for injecting cover images into the intranet template and appends it to the javascript at the bottom of the page. >+ >+=cut >+ >+sub get_plugins_intranet_cover_images { >+ return q{} unless C4::Context->config("enable_plugins"); >+ >+ my $p = Koha::Plugins->new(); >+ >+ return q{} unless $p; >+ >+ my @plugins = $p->GetPlugins( >+ { >+ method => 'intranet_cover_images', >+ } >+ ); >+ >+ my @data = map { $_->intranet_cover_images || q{} } @plugins; >+ >+ return join( "\n", @data ); >+} >+ >+=head3 get_plugins_opac_cover_images >+ >+[% KohaPlugins. get_plugins_opac_cover_images %] >+ >+This method collects the output of all plugins for injecting cover images into the opac template and appends it to the javascript at the bottom of the page. >+ >+=cut >+ >+sub get_plugins_opac_cover_images { >+ return q{} unless C4::Context->config("enable_plugins"); >+ >+ my $p = Koha::Plugins->new(); >+ >+ return q{} unless $p; >+ >+ my @plugins = $p->GetPlugins( >+ { >+ method => 'opac_cover_images', >+ } >+ ); >+ >+ my @data = map { $_->opac_cover_images || q{} } @plugins; >+ >+ return join( "\n", @data ); >+} >+ > 1; >-- >2.37.1 (Apple Git-137.1)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32680
:
145457
|
145458
|
145459
|
145474
|
145475
|
145898
|
145899
|
146695
|
147992
|
147993
|
147996
|
147997
|
148129
|
148158
|
148159
|
149868
|
149869
|
149886
|
149887
|
149888
|
149889
|
151191
|
151192
|
151193