[geeklog-devel] Online Config Setting question/enhancment

Blaine Lang devel at portalparts.com
Tue Sep 29 13:49:38 EDT 2009


I have an existing config array that I am converting to use the online 
config manager. The plugin uses an integer reference to the field style 
which is then a lookup to an array for the display name and matching CSS 
style.

I am using the **placeholder config type in other places and that works 
best if not using an integer for the main config setting key,  or there 
is a variable number of items. In my case, there is a variable number of 
items but the sub-item config has to have 2 and only 2 elements.

I also want to save the setting reference as an integer and not a 
textual reference.

The array that is used presently in the plugins config.php looks like

$CONF_FE['fieldstyles'] = array (
   '1'   => array('Default','frm_label1'),
   '2'   => array('Bold','frm_label2'),
   '3'   => array('Normal','frm_label3'),
   '4'   => array('Highlighted','frm_label4'),
   '5'   => array('Large Heading', 'frm_h1'),
   '6'   => array('Medium Heading1', 'frm_h2'),
   '7'   => array('Small Heading', 'frm_h3'),
   '8'   => array ('Boxed Look','frm_label4')
);

Example: I need is to save a reference to 4 and that defines the 
matching label to show as the current selection and it's associated  CSS 
definition.

With the online config feature, this is how it has now been defined:

$CONF_FE_DEFAULT['fieldstyles'] = array (
   1     => array('Default' => 1, 'frm_label1' => 1),
   2     => array('Bold' => 1, 'frm_label2' => 1),
   3     => array('Normal' => 1, 'frm_label3' => 1),
);

It makes it confusing to use in the online config manger this way as you 
need to create a matching pair of elements per style definition
refer to image: http://www.portalparts.com/temp/nexform2-onlineconfig.gif

We created the online config manager GUI to be generic and flexible 
which it has been but there are some issues.
This would be a good GSOC project to improve the UI but first we need to 
start documenting use cases and ideas for improving.

I should be able to define the template better for the config element
- new config option to create an array of options key'ed to integer 
value that we don't need to see in the config manager. So in this case 
it would just appear as a list of 2 fields per record - stored as an array.
- 2 and only 2 elements per config item - # is optional but defines the 
array record size
- labels for the config elements
- in my case, there is no need for the [x] by the sub-item elements. If 
I add a new config item, it will have 2 blank fields with the lables 
'DisplayName' and 'CSS Style'.
- no need for the [Add Element] under the sub-config item as there 
should only be 2 elements in my case.
- Adding a new style (config item using the main [Add Element]) would in 
my case automatically show the 2 new fields

Unless someone has a better idea how this kind of config define would be 
setup.

Blaine



More information about the geeklog-devel mailing list