DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:confmanager

confmanager Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" unknown
  • 2014-09-29 "Hrun" unknown

plugin Plugin to manage various .conf files

Last updated on
2016-07-22
Provides
Admin, Action, Remote
Repository
Source

Similar to txtconf

Tagged with admin, configuration

Download and Installation

A CosmoCode Plugin

Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually.

Changes

Usage

You can use this plugin to edit several *.conf files from the conf dir via the DokuWiki admin menu.

Plugins that support the confmanager

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>');
plugin/confmanager.txt · Last modified: 2016-07-22 14:23 by grosse