Table of Contents
confmanager Plugin
Compatible with DokuWiki
- 2024-02-06 "Kaos" yes
- 2023-04-04 "Jack Jackrum" yes
- 2022-07-31 "Igor" yes
- 2020-07-29 "Hogfather" yes
Similar to acronymedit, advanced, txtconf
Download and Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Changes
- Version upped (2024-07-29 23:50)
- Merge pull request #59 from Klap-in/icons (2024-07-29 08:20)
- Merge pull request #60 from dokuwiki-translate/lang_update_831_170962… (2024-03-05 08:40)
- translation update (2024-03-05 08:00)
- Merge pull request #58 from dokuwiki-translate/lang_update_661_168695… (2023-12-13 14:33)
- some phpdocs and use local variable (2023-07-08 13:39)
- set height of the icons (assumes heights of default dokuwiki template) (2023-07-08 13:38)
- translation update (2023-06-17 00:45)
Usage
You can use this plugin to edit several *.conf
files from the conf/
directory via the DokuWiki admin menu: Configuration File Manager.
After selecting a configuration file in the dropdown menu, you can add your own lines, or overwrite or disable the default lines.
Plugins that support the confmanager
Development notes: Use the conf manager for your plugin
You can use the ConfManager with your very own plugin. The ConfManager plugin supports different types of config files descripted below. To add the config you have to add an action component that hooks the CONFMANAGER_CONFIGFILES_REGISTER
event. You can add your config file to the $event→data
array.
The following example shows the usage of the ConfigManagerTwoLine
config type.
<?php class action_plugin_docsearch_confmanager extends DokuWiki_Action_Plugin { public function register(Doku_Event_Handler $controller) { $controller->register_hook('CONFMANAGER_CONFIGFILES_REGISTER', 'BEFORE', $this, 'addConfigFile', array()); } public function addConfigFile(Doku_Event $event, $params) { if (class_exists('ConfigManagerTwoLine')) { $config = new ConfigManagerTwoLine('My Config', 'Description of my plugin', DOKU_INC . 'path to my config'); $event->data[] = $config; } } }
Config cascade config types
The ConfManager provides support for some config formats used by DokuWiki. DokuWiki use the global $config_cascade array to get the path to the config file.
The following config types are available:
Class name | Description |
---|---|
ConfigManagerSingleLineCoreConfig | Every line is a config option. The config values are basically an array. I.e. the blacklist config. |
ConfigManagerTwoLineCascadeConfig | Every line is a config option. The first word in the line is a config key . The config is a associative array. I.e. the abbreviations config |
ConfigManagerTwoLineLeftImageConfigCascade | Like ConfigManagerTwoLineCascadeConfig but with image support. An image can be assigned for every key. I.e. the mime config |
The following code shows how to create an instance of each config type from the table above. The following placeholder are used:
- <name> Name of the config in the
$config_cascade
array. - <image path> Path starting from DOKU_INC to the image folder.
- <image extension> Extension of the images to use. I.e. mime icons use png.
$scheme = new ConfigManagerSingleLineCoreConfig('<name>'); $acronyms = new ConfigManagerTwoLineCascadeConfig('<name>'); $mime = new ConfigManagerTwoLineLeftImageConfigCascade('<name>', '<image path>', '<image extension>');
These three config types all have the following methods to provide additional information:
- setName (string): The name of the config file. This is shown in the drop down box and as headline.
- setDescription (string): A description text to explain the config file. DokuWiki markup is allowed.
ConfigManagerTwoLine config type
The ConfigManagerTwoLine config type stores an associative array like the abbreviations config.
The following code shows how to create an instance of the ConfigManagerTwoLine config type. The following placeholder are used:
- <Title> (string): The name of the config file. This is shown in the drop down box and as headline.
- <Description> (string): A description text to explain the config file. DokuWiki markup is allowed.
- <Config path> (string): Absolute path to the config file. If the file is not present it will be created.
$config = new ConfigManagerTwoLine('<Title>', '<Description>', '<Config path>');