sub get_plugins_opac_head {
return q{}
- unless C4::Context->preference('UseKohaPlugins')
- && C4::Context->config("enable_plugins");
+ unless C4::Context->preference('UseKohaPlugins');
- my @plugins = Koha::Plugins->new()->GetPlugins(
+ my $p = Koha::Plugins->new();
+
+ return q{} unless $p;
+
+ my @plugins = $p->GetPlugins(
{
method => 'opac_head',
}
sub get_plugins_opac_js {
return q{}
- unless C4::Context->preference('UseKohaPlugins')
- && C4::Context->config("enable_plugins");
+ unless C4::Context->preference('UseKohaPlugins');
+
+ my $p = Koha::Plugins->new();
+
+ return q{} unless $p;
- my @plugins = Koha::Plugins->new()->GetPlugins(
+ my @plugins = $p->GetPlugins(
{
method => 'opac_js',
}