[geeklog-devel] Need to decouple config order from language file
Joe Mucchiello
joe at ThrowingDice.com
Sun Feb 3 16:54:47 EST 2008
Okay I just looked at the code for a few seconds and it seems simple
to fix this (In other words I didn't test this...):
The SQL in function _get_extended is ordered by "sort_order" which I
assume is what you want. So:
while ($row = DB_fetchArray($Qresult)) {
$cur = $row;
$res[$cur[3]][] = // don't change the sort order
array('name' => $cur[0], // include name in
result array
'display_name' =>
(array_key_exists($cur[0], $LANG_confignames[$group]) ?
$LANG_confignames[$group][$cur[0]]
: $cur[0]),
'type' =>
(($cur[4] == 'unset') ?
'unset' : $cur[1]),
'selectionArray' =>
(($cur[2] != -1) ?
$LANG_configselects[$group][$cur[2]] : null),
'value' =>
(($cur[4] == 'unset') ?
'unset' : unserialize($cur[4])));
}
and then in get_ui ignore the key value.
foreach ($params as $e) {
$fs_contents .=
$this->_UI_get_conf_element(
$e['name'],
$e['display_name'],
$e['type'],
$e['value'],
$e['selectionArray']);
}
Am I missing something here?
This config stuff is a great idea but it being still unready for
release at this time is annoying. There are too many areas of it that
are not well thought out.
* The UI code should be moved to another class. There's no reason to
load the UI code except in admin/configuration.php so why does it get
loaded for every hit to lib-common?
* The config class checks that you are in group root in _get_ui and
updateConfig but set_param and restore_param rely on checks in
admin/configuration.php to avoid hacking of settings.
* Don't you love the mix of _ between words and camelCase found in
the function and var names!
At 03:03 PM 2/3/2008, Dirk Haun wrote:
>Currently, the order of some things on the configuration screens is
>actually controlled by the order of their respective text entries in the
>language file.
----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com
More information about the geeklog-devel
mailing list