Bug 23050: Plugin hook to add tabs in intranet biblio details page
Test Plan: 1) Enable plugins 2) Download and install the latest version of this plugin https://git.biblibre.com/biblibre/koha-plugin-intranet-detail-hook 3) Browse to catalogue/detail.pl for a record 4) Note you see two new tabs with content Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
73c0100a3d
commit
d753993290
2 changed files with 25 additions and 1 deletions
|
@ -69,8 +69,23 @@ if ( C4::Context->preference('UseKohaPlugins') &&
|
|||
my @plugins = Koha::Plugins->new()->GetPlugins({
|
||||
method => 'intranet_catalog_biblio_enhancements_toolbar_button'
|
||||
});
|
||||
|
||||
my @tab_plugins = Koha::Plugins->new()->GetPlugins({
|
||||
method => 'intranet_catalog_biblio_tab',
|
||||
});
|
||||
my @tabs;
|
||||
foreach my $tab_plugin (@tab_plugins) {
|
||||
my @biblio_tabs = $tab_plugin->intranet_catalog_biblio_tab();
|
||||
foreach my $tab (@biblio_tabs) {
|
||||
$tab->{id} = $tab->{title};
|
||||
$tab->{id} =~ s/[^\w]+/-/g;
|
||||
push @tabs, $tab,
|
||||
}
|
||||
}
|
||||
|
||||
$template->param(
|
||||
plugins => \@plugins
|
||||
plugins => \@plugins,
|
||||
tabs => \@tabs,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,9 @@
|
|||
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
|
||||
<li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
|
||||
[% END %]
|
||||
[% FOREACH tab IN tabs %]
|
||||
<li><a href="#[% tab.id %]">[% tab.title %]</a></li>
|
||||
[% END %]
|
||||
</ul>
|
||||
|
||||
[% items_table_block_iter = 0 %]
|
||||
|
@ -722,6 +725,12 @@
|
|||
</div>
|
||||
[% END %]
|
||||
|
||||
[% FOREACH tab IN tabs %]
|
||||
<div id="[% tab.id | html %]">
|
||||
[% tab.content | $raw %]
|
||||
</div>
|
||||
[% END %]
|
||||
|
||||
</div><!-- /bibliodetails -->
|
||||
|
||||
<div id="export" style="margin-top: 1em;">
|
||||
|
|
Loading…
Reference in a new issue