From fec2accc99487e0dee7300c58566bb82225f8afd Mon Sep 17 00:00:00 2001 From: Klap-in Date: Sat, 26 Jan 2013 13:13:51 +0100 Subject: Added loadHelper() to DokuWiki_Syntax_Plugin. --- lib/plugins/syntax.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib') 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 @@ -277,6 +277,26 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode { return $conf; } + /** + * Loads a given helper plugin (if enabled) + * + * @author Esther Brunner + * + * @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 * -- cgit v1.2.3