[dokuwiki] Re: 2 Questions

Gerry Weißbach wrote:
Hello everybody,

I've got a question about the configuration of a plugin. I'd like to create a plugin that can itself change/create some configuration items.
I thought about a solution using the config plugin to save this data. I could recreate the conf/*.php files, but that is not the option I'd prefer. Is there something else I did not find, that can be done?
Plugin and template can have their own configuration settings. If set up correctly, the config plugin will automatically generate appropriate fields for them on the settings page. The plugin:tutorial has information on doing this. You'll find several plugins and templates which implement it, e.g. blog (new version), loginredirector, googlemaps, folded & linebreak + sidebar template.

Second Question: my tplSwitcher Plugin creates some data within the local.protected.php if possible. If not it uses the local.php. If then, after writing this data, the config plugin recreates the local.php it does not reqrite it completely, but leaves some of my data (the problem is, that it does not leave all the data). Does anyone know what that is about and what could be done?
The config plugin will create a local.php with all non-default $conf array values. If you attempt to set another variable, it'll be lost next time the config plugin changes the wiki settings. If you need to set values, either use a file over which the plugin has complete control (locate it in the wiki's data section if necessary) or use the plugins configuration settings (as per above).


thanks in advance ...

Gerry

-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: