summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorEsther Brunner <wikidesign@gmail.com>2007-02-27 13:26:35 +0100
committerEsther Brunner <wikidesign@gmail.com>2007-02-27 13:26:35 +0100
commit7d992a19ddbd43e02d75c01721bfa4ddcecdcb3c (patch)
tree9d4b46af78c220004d1737874d50e770ed3d3c3a /inc
parent3b974784da10039325d46e5355effb7b1badfde0 (diff)
downloadrpg-7d992a19ddbd43e02d75c01721bfa4ddcecdcb3c.tar.gz
rpg-7d992a19ddbd43e02d75c01721bfa4ddcecdcb3c.tar.bz2
helper plugin patch
darcs-hash:20070227122635-20862-e10e801a5224585fa32d8dc3401fd5eb98d70930.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/plugin.php17
-rw-r--r--inc/pluginutils.php2
2 files changed, 18 insertions, 1 deletions
diff --git a/inc/plugin.php b/inc/plugin.php
index 045f3d229..b5b221fcd 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -155,6 +155,23 @@ class DokuWiki_Plugin {
return $conf;
}
+
+ /**
+ * Loads a given helper plugin (if enabled)
+ *
+ * @author Esther Brunner <wikidesign@gmail.com>
+ *
+ * @param $name name of plugin to load
+ * @param $msg message to display in case the plugin is not available
+ *
+ * @return object helper plugin object
+ */
+ function loadHelper($name, $msg){
+ if (!plugin_isdiabled($name)) $obj =& plugin_load('helper',$name);
+ else $obj = NULL;
+ if (is_null($obj) && $msg) msg("Helper plugin $name is not available or invalid.",-1);
+ return $obj;
+ }
// standard functions for outputing email addresses and links
// use these to avoid having to duplicate code to produce links in line with the installation configuration
diff --git a/inc/pluginutils.php b/inc/pluginutils.php
index 8e0d686b6..5898e550e 100644
--- a/inc/pluginutils.php
+++ b/inc/pluginutils.php
@@ -8,7 +8,7 @@
// plugin related constants
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
-$plugin_types = array('admin','syntax','action','renderer');
+$plugin_types = array('admin','syntax','action','renderer', 'helper');
/**
* Returns a list of available plugins of given type