From 13fd73c731d3b5daeefa5419cbb199265e768077 Mon Sep 17 00:00:00 2001 From: Indranil Das Gupta Date: Tue, 19 Aug 2014 09:12:36 +0000 Subject: [PATCH 2/2] Bug 12780 [ENH] Adds plugins-menu.inc to support nav mexnu for plugins installed 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. --- koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc index 9bfa681..1f2b012 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/plugins-menu.inc @@ -1,3 +1,4 @@ + + \ No newline at end of file +
-- 1.8.1.2