Unlike other *-menu.inc files in the /intranet-tmpl/prog/en/includes directory, Koha plugin do not include such a file. This bug/patch is intended to add such sopport.
Created attachment 30973 [details] Screenshot of plugins-menu.inc patch in action
Created attachment 30974 [details] [review] plugins-menu.inc patch (commit msg without test plan)
Created attachment 30976 [details] [review] plugins-menu.inc patch (commit msg with test plan) 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 "<pluginsdir>/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/tool-step1.tt" Replace the line "<div id="doc3">" with : <div id="doc3" class="yui-t2"> <div id="bd"> <div id="yui-main"> <div class="yui-b"> Also, just before the line "[% INCLUDE 'intranet-bottom.inc' %]" at the end of the file, insert the following lines : </div> </div> <div class="yui-b noprint"> [% INCLUDE 'plugins-menu.inc' %] </div> </div> </div> Note: <pluginsdir> as defined in your koha-conf.xml 4) Edit "<pluginsdir>/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://<intranet_hostname>/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.
Created attachment 31069 [details] [review] Patch to add plugins-menu.inc nav menu 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 "<pluginsdir>/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/tool-step1.tt" Replace the line "<div id="doc3">" with : <div id="doc3" class="yui-t2"> <div id="bd"> <div id="yui-main"> <div class="yui-b"> Also, just before the line "[% INCLUDE 'intranet-bottom.inc' %]" at the end of the file, insert the following lines : </div> </div> <div class="yui-b noprint"> [% INCLUDE 'plugins-menu.inc' %] </div> </div> </div> Note: <pluginsdir> as defined in your koha-conf.xml 4) Edit "<pluginsdir>/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://<intranet_hostname>/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.
I see one issue with this patch. It may be usefull, but the way it's implemented if included to Koha, all existing plugins in the wild would have to be updated to work properly with it: points 3 & 4 of your test plan. Plugins system author opinion is required.
(In reply to Frédéric Demians from comment #5) > I see one issue with this patch. It may be usefull, but the way it's > implemented if included to Koha, all existing plugins in the wild would have > to be updated to work properly with it: points 3 & 4 of your test plan. > Plugins system author opinion is required. Considering such an enhancement won't break any existing plugin functionality I'm quite happy with this idea! That being said, I'm not sure what the adoption rate would be. We'd definitely want to this to the reference plugin ( i.e. KitchenSink )