From ff38a9063eec41164ec72bab6a6d9ad521e8d3c7 Mon Sep 17 00:00:00 2001 From: Indranil Das Gupta Date: Fri, 22 Aug 2014 02:47:45 +0000 Subject: [PATCH 2/2] Bug 12780 [ENH] Addition of plugins-menu.inc for a nav menu for Koha Plugins Koha plugins system (http://manual.koha-community.org/3.16/en/pluginsystem.html) does not provide a ready method to show an auto-populated nav menu for the plugins installed in the system. This patch adds that capability and allows plugin authors to add this .inc file in the plugin's template file Test Plan: 1) Apply this patch 2) Upload a copy of "Kitchen Sink Example" plugin from ByWater Solutions's website http://git.bywatersolutions.com/koha-plugins.git/snapshot/tags/kitchen_sink_v1.01 3) Edit "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/tool-step1.tt" Replace the line "
" with :
Also, just before the line "[% INCLUDE 'intranet-bottom.inc' %]" at the end of the file, insert the following lines :
[% INCLUDE 'plugins-menu.inc' %]
Note: as defined in your koha-conf.xml 4) Edit "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" by adding: use Koha::Plugins; after the line : use base qw(Koha::Plugins::Base); Also, just after the line : my $template = $self->get_template({ file => 'tool-step1.tt' }); Insert the following : my @reports = Koha::Plugins->new()->GetPlugins("report"); $template->param( reports => \@reports, ); my @tools = Koha::Plugins->new()->GetPlugins("tool"); $template->param( tools => \@tools, ); 5) Go to http:///cgi-bin/koha/plugins/plugins-home.pl and click on "Run tool" link. 6) The page should now show the menu on the left, with the KitchenSink plugin under the "Plugin Tools" sub-menu being highlighted. --- .../prog/en/includes/plugins-menu.inc | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc new file mode 100644 index 0000000..2d36107 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc @@ -0,0 +1,68 @@ + + -- 1.8.1.2