[dokuwiki] Re: Configuration Settings Presentation
- From: Chris Smith <chris@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sun, 07 May 2006 23:05:26 +0100
Martin Tschofen wrote:
Right now any plugin specific $conf variable shows up in a textare
instead of the appropriate type. Would it be possible to declare the
type somehow so it shows up accordingly in the configurator?
Somewhat besides the point. Can the system add $conf variables
declared in templates or plugins in the display of the configurator?
It seems I have to manually add them to local.php.
Yes, but your template or plugin needs to tell the configuration plugin
about any settings.
Create the following files (base directory is the main directory of the
plugin or template)
conf/default.php ........ default setting values
conf/metadata.php .... metadata describing the setting and its
possible values
lang/xx/settings.php ...... localised prompts for the setting
take a look at the lib/plugin/config/settings/config.metadata.php file
for details and examples of the use of metadata.
e.g.
$meta['title'] = array('string');
$meta['htmlok'] = array('onoff')
Also checkout the blog plugin.
textarea is the default method used for a setting. The base classes for
other methods of input are
'string' for a single line input.
'onoff' for a checkbox.
'multichoice' for a select.
there are other classes defined which provide more restrictive input.
It is possible to extend the class 'setting' or one of its extensions to
define a new class if a particular setting requires special handling.
Take a look at lib/plugin/config/settings/config.class.php &
extra.class.php. Currently the config plugin doesn't look for extra
class details along with the settings information of plugins and
templates, but I intend to add that along with the other changes.
Cheers,
Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
Other related posts: