[Koha-bugs] [Bug 12780] Addition of plugins-menu.inc for adding a nav menu for Koha Plugins

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 22 05:12:24 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12780

Indranil Das Gupta <indradg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30974|0                           |1
        is obsolete|                            |
  Attachment #30976|0                           |1
        is obsolete|                            |

--- Comment #4 from Indranil Das Gupta <indradg at gmail.com> ---
Created attachment 31069
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31069&action=edit
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.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list