From 71e23f0c66d356af8a2d3e0c8806aacf7a1e3d03 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 9 Jan 2013 15:37:33 -0500 Subject: [PATCH] Bug 7804 - Add Koha Plugin System - Followup 1 - Add config level switch from plugin system --- Koha/Plugins.pm | 2 ++ Koha/Plugins/Base.pm | 2 ++ Koha/Plugins/Handler.pm | 2 ++ debian/templates/koha-conf-site.xml.in | 1 + .../admin/preferences/enhanced_content.pref | 2 +- 5 files changed, 8 insertions(+), 1 deletions(-) diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm index 702d551..f0385c1 100644 --- a/Koha/Plugins.pm +++ b/Koha/Plugins.pm @@ -26,6 +26,8 @@ use C4::Context; use C4::Output; BEGIN { + die('Plugins not enabled in config') unless ( C4::Context->config("enable_plugins") ); + push @INC, C4::Context->config("pluginsdir"); } diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index c638ae9..5bbe794 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -28,6 +28,8 @@ use Template; use C4::Context; BEGIN { + die('Plugins not enabled in config') unless ( C4::Context->config("enable_plugins") ); + push @INC, C4::Context->config("pluginsdir"); } diff --git a/Koha/Plugins/Handler.pm b/Koha/Plugins/Handler.pm index 5e0f690..f5cdafd 100644 --- a/Koha/Plugins/Handler.pm +++ b/Koha/Plugins/Handler.pm @@ -26,6 +26,8 @@ use Module::Load::Conditional qw(can_load); use C4::Context; BEGIN { + die('Plugins not enabled in config') unless ( C4::Context->config("enable_plugins") ); + push @INC, C4::Context->config("pluginsdir"); } diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 167b58f..f433487 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -258,6 +258,7 @@ authorities 1 __PLUGINS_DIR__ + 0 /usr/share/koha/intranet/cgi-bin /usr/share/koha/opac/cgi-bin/opac /usr/share/koha/opac/htdocs/opac-tmpl diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index ba61d51..ca26073 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -306,4 +306,4 @@ Enhanced Content: choices: yes: Enable no: "Don't enable" - - the ability to use Koha Plugins. + - the ability to use Koha Plugins. Note, the plugin system must also be enabled in the Koha configuration file to be fully enabled. -- 1.7.2.5