From 143ff0f836341ddd83dbb087ea227ca90eb1aea3 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 15 Oct 2013 13:23:01 +0200 Subject: improve visibility and PHPdocs of plugin controller --- inc/pluginutils.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'inc/pluginutils.php') diff --git a/inc/pluginutils.php b/inc/pluginutils.php index 7c37d4f7f..0c25ac411 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -14,31 +14,92 @@ if(!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z /** * Original plugin functions, remain for backwards compatibility */ + +/** + * Return list of available plugins + * + * @param string $type type of plugins; empty string for all + * @param bool $all; true to retrieve all, false to retrieve only enabled plugins + * @return array with plugin names or plugin component names + */ function plugin_list($type='',$all=false) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->getList($type,$all); } + +/** + * Returns plugin object + * Returns only new instances of a plugin when $new is true or if plugin is not Singleton, + * otherwise 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 DokuWiki_Plugin|DokuWiki_Syntax_Plugin the plugin object or null on failure + */ function plugin_load($type,$name,$new=false,$disabled=false) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->load($type,$name,$new,$disabled); } + +/** + * Whether plugin is disabled + * + * @param string $plugin name of plugin + * @return bool; true disabled, false enabled + */ function plugin_isdisabled($plugin) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->isdisabled($plugin); } + +/** + * Enable the plugin + * + * @param string $plugin name of plugin + * @return bool; true saving succeed, false saving failed + */ function plugin_enable($plugin) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->enable($plugin); } + +/** + * Disable the plugin + * + * @param string $plugin name of plugin + * @return bool; true saving succeed, false saving failed + */ function plugin_disable($plugin) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->disable($plugin); } + +/** + * Returns directory name of plugin + * + * @param string $plugin name of plugin + * @return string name of directory + */ function plugin_directory($plugin) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->get_directory($plugin); } + +/** + * Returns cascade of the config files + * + * @return array with arrays of plugin configs + */ function plugin_getcascade() { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; return $plugin_controller->getCascade(); } -- cgit v1.2.3 From f2fb3528e17e5d79660ee1a9c26319eb8edb1246 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 15 Oct 2013 15:09:05 +0200 Subject: phpdocs plugins util and controller --- inc/pluginutils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/pluginutils.php') diff --git a/inc/pluginutils.php b/inc/pluginutils.php index 0c25ac411..894bbefb6 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -37,7 +37,7 @@ function plugin_list($type='',$all=false) { * @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 DokuWiki_Plugin|DokuWiki_Syntax_Plugin the plugin object or null on failure + * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|null the plugin object or null on failure */ function plugin_load($type,$name,$new=false,$disabled=false) { /** @var $plugin_controller Doku_Plugin_Controller */ -- cgit v1.2.3