[geeklog-devel] Adding "Core" Configuration Items
vfuria at gmail.com
Wed Aug 10 03:31:28 EDT 2011
Needing to add some configuration items, I noticed that there isn't really
good documentation noting all the changes that have to be done to add Core
configuration items. I'm going to write a wiki with a summary of all the
steps. But just so I know I didn't miss anything, here is the list of files
that need to be modified and how to modify them:
This is one of two locations where the "->add" config methods need to be
called. The parameters for the add function are well documented in
config.class.php, but I did note some items to watch for.
- The second parameter is both the default value (also the initial value)
and can be an array.
- If the 'type' parameter (3rd parameter) is 'select', the sixth parater
is an index (numerical) into the $LANG_configselects['Core'] defined in the
- The last parameter is the tab to which the config value belongs. Note
it is not near the subgroup or the fieldset parameters as you would expect.
- The fieldset parameter doesn't seem to need to be set to any particular
value for adds of type 'tab', though by convention it seems to be set to the
first fieldset in the tab.
This is the second location that will need "->add" methods called. They
should be in the select statement associated with the current release that
the version you are working on will be superseding. You can copy and paste
the "->add" methods from the previous file, just be sure to replace "$me"
This is where validation information is kept for configuration items. It is
not well documented. Here are the the list of pre-defined validation rules:
You can also define your own configuration rules, which get prepended by
custom_validation_ (see below).
Custom validation functions go here. They should be named
custom_validation_<rule name>. Return true or false.
Every new config parameter needs to have documentation added to this file
with appropriate anchor tag.
There are separate language arrays for config names, tabs, fieldsets, and
subgroups. There is also an array for selects as mentioned previously.
Please let me know if I missed anything.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the geeklog-devel