From 801eeb2cf9b1417a3bc8f25f1eec33cb9204be22 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 20 Jun 2008 11:52:39 +0000 Subject: Actually closes #60: Enable/disable plugins on a site by site basis http://trac.elgg.org/elgg/ticket/60 git-svn-id: https://code.elgg.org/elgg/trunk@1018 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'engine') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 8ead863a1..0edf46bfb 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -57,14 +57,17 @@ if ($handle = opendir($CONFIG->pluginspath)) { while ($mod = readdir($handle)) { - if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) { - if (!@include($CONFIG->pluginspath . $mod . "/start.php")) - throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); - if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) { - autoregister_views("",$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views/"); - } - if (is_dir($CONFIG->pluginspath . $mod . "/languages")) { - register_translations($CONFIG->pluginspath . $mod . "/languages/"); + if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) { + if (is_plugin_enabled($mod)) + { + if (!@include($CONFIG->pluginspath . $mod . "/start.php")) + throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); + if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) { + autoregister_views("",$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views/"); + } + if (is_dir($CONFIG->pluginspath . $mod . "/languages")) { + register_translations($CONFIG->pluginspath . $mod . "/languages/"); + } } } } -- cgit v1.2.3