Talk:SoC config.php GUI
One solution could be an array that holds all the information for the gui such as:
$_CONF_GUI = array( 'site_url' = array( 'default' => 'http://geeklog.net', 'islocked' => false, 'help' => 'The url to your site, starting with http://, no trailing slash', 'type' => 'string', // the type can define a validation process such as for emails, urls, boolean, numbers etc 'alternative' => '', // nothing given, so all allowed 'section' = 'Site Settings' // this is to group values in the GUI ) ); $_CONF = array( 'site_url' => 'http://geeklog.net', 'db_pass' => 'password' );
The actual $_CONF array will only use the value for the code. When starting the gui, this $_CONF is merged with the $_CONF_GUI so that the gui displays the correct values. To save ressources, the $_CONF_GUI is reset during execution and stored in a textfile and on running the gui, an include() is done on the textfile. Same goes for $_CONF, only that the value is read and used normally. The help and default values are printed into it as comments in case someone wants to edit it locally, and so that the locked values are explained properly. The locked values are not displayed in the gui however. Since they should be printed into the text file for editing however, and contain the necessary help text, they should to be in this array. Optionally they can be split into another array with a similar structure, so locked and non-locked settings are more securely split away from each other. Tokyoahead 21:28, 11 March 2007 (EDT)
Just to add what I already sent to Oliver in an email:
- putting "locked" fields in their own list would probably make a much shorter list that's also easier to maintain
- tooltips ("help") are nice but have to be localized and kept in sync at the same time - that could be tricky
Dirk 15:59, 18 March 2007 (EDT)