Skip to content
Snippets Groups Projects
Commit fec2accc authored by Klap-in's avatar Klap-in
Browse files

Added loadHelper() to DokuWiki_Syntax_Plugin.

parent fdf855d9
No related branches found
No related tags found
No related merge requests found
......@@ -277,6 +277,26 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
return $conf;
}
/**
* 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
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment