diff options
author | Klap-in <klapinklapin@gmail.com> | 2013-01-26 13:13:51 +0100 |
---|---|---|
committer | Klap-in <klapinklapin@gmail.com> | 2013-01-26 13:13:51 +0100 |
commit | fec2accc99487e0dee7300c58566bb82225f8afd (patch) | |
tree | c75929f0c0db969b0076e27a51ddf9c43c5b050e /lib/plugins | |
parent | fdf855d93183bf3eb0074877172dab6809d9ef7d (diff) | |
download | rpg-fec2accc99487e0dee7300c58566bb82225f8afd.tar.gz rpg-fec2accc99487e0dee7300c58566bb82225f8afd.tar.bz2 |
Added loadHelper() to DokuWiki_Syntax_Plugin.
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/syntax.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php index 552cc747a..f3f234316 100644 --- a/lib/plugins/syntax.php +++ b/lib/plugins/syntax.php @@ -278,6 +278,26 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { } /** + * Loads a given helper plugin (if enabled) + * + * @author Esther Brunner <wikidesign@gmail.com> + * + * @param string $name name of plugin to load + * @param bool $msg if a message should be displayed in case the plugin is not available + * + * @return object helper plugin object + */ + function loadHelper($name, $msg){ + if (!plugin_isdisabled($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; + } + + /** * Allow the plugin to prevent DokuWiki from reusing an instance * * @return bool false if the plugin has to be instantiated |