[geeklog-devel] Need to decouple config order from language file

Joe Mucchiello joe at ThrowingDice.com
Sun Feb 10 10:19:00 EST 2008


At 03:28 AM 2/10/2008, Dirk Haun wrote:
>But the order of the fieldsets has to match the order in the $LANG_fs array.

Does the same thing apply to the subgroup order? You probably need to 
fix them too.

>   'fs_story' => "Story",
>   'fs_trackback' => 'Trackback',
>   'fs_pingback' => 'Pingback'
>
>After the hypothetical change, we would only have to update one text
>string and add the new one anywhere in the $LANG_fs array, since the
>order is only defined in the database and is decoupled from the order in
>the $LANG_fs array.

If it's called $LANG_fs, why include the fs_ in the keys?

Personally, I'd like to see this solution on the database side. Make 
subgroups and fieldsets actual database elements, not fake entries in 
the config table:

table config_values (group, name, value) PK (group, name)
table config_config (group, name, type, default_value, selectarray, 
subgroup, fieldset, order_in_fs) PK (group, name)
table config_sg_order (group, subgroup, order_in_group) PK (group, subgroup)
table config_fs_order (group, subgroup, fieldset, order_in_sgroup) PK 
(group, subgroup, fieldset)

Selecting the entire GUI would be a bit ugly. But you only have to 
write that SELECT once.

SELECT cc.*
FROM config_config cc, config_sg_order sg, config_fs_order fs
WHERE cc.group = sg.group AND cc.group = fs.group
AND cc.sgroup = sg.subgroup AND cc.subgroup = fs.subgroup
AND cc.fieldset = fs.fieldset
AND cc.group = '$group'
ORDER BY sg.order_in_group, fs.order_in_sgroup, cc.order_in_fs


----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list