summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/plugincontroller.class.php17
-rw-r--r--inc/pluginutils.php4
-rw-r--r--lib/plugins/plugin/classes/ap_info.class.php2
3 files changed, 15 insertions, 8 deletions
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php
index 61f460414..ad394e11f 100644
--- a/inc/plugincontroller.class.php
+++ b/inc/plugincontroller.class.php
@@ -55,15 +55,23 @@ class Doku_Plugin_Controller {
*
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @param $type string type of plugin to load
- * @param $name string name of the plugin to load
- * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance
+ * @param $type string type of plugin to load
+ * @param $name string name of the plugin to load
+ * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance
+ * @param $disabled bool true to load even disabled plugins
* @return objectreference the plugin object or null on failure
*/
- function &load($type,$name,$new=false){
+ function &load($type,$name,$new=false,$disabled=false){
//we keep all loaded plugins available in global scope for reuse
global $DOKU_PLUGINS;
+ list($plugin,$component) = $this->_splitName($name);
+
+ // check if disabled
+ if(!$disabled && $this->isdisabled($plugin)){
+ return null;
+ }
+
//plugin already loaded?
if(!empty($DOKU_PLUGINS[$type][$name])){
if ($new || !$DOKU_PLUGINS[$type][$name]->isSingleton()) {
@@ -75,7 +83,6 @@ class Doku_Plugin_Controller {
}
//try to load the wanted plugin file
- list($plugin,$component) = $this->_splitName($name);
$dir = $this->get_directory($plugin);
$file = $component ? "$type/$component.php" : "$type.php";
diff --git a/inc/pluginutils.php b/inc/pluginutils.php
index da0704bec..85bcaee1e 100644
--- a/inc/pluginutils.php
+++ b/inc/pluginutils.php
@@ -16,9 +16,9 @@ function plugin_list($type='',$all=false) {
global $plugin_controller;
return $plugin_controller->getList($type,$all);
}
-function &plugin_load($type,$name,$new=false) {
+function &plugin_load($type,$name,$new=false,$disabled=false) {
global $plugin_controller;
- return $plugin_controller->load($type,$name,$new);
+ return $plugin_controller->load($type,$name,$new,$disabled);
}
function plugin_isdisabled($plugin) {
global $plugin_controller;
diff --git a/lib/plugins/plugin/classes/ap_info.class.php b/lib/plugins/plugin/classes/ap_info.class.php
index fcadb4599..cebbf090a 100644
--- a/lib/plugins/plugin/classes/ap_info.class.php
+++ b/lib/plugins/plugin/classes/ap_info.class.php
@@ -15,7 +15,7 @@ class ap_info extends ap_manage {
foreach ($component_list as $component) {
- if ($obj = & plugin_load($component['type'],$component['name']) === NULL) continue;
+ if ($obj = & plugin_load($component['type'],$component['name'],false,true) === NULL) continue;
$compname = explode('_',$component['name']);
if($compname[1]){