Talk:SoC config.php GUI

From GeeklogWiki
Revision as of 03:52, 11 March 2007 by Tokyoahead (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

One solution could be an array that holds all the information for the gui such as:

$_CONF_GUI = array(
    'site_url' = array(
        'value' => 'http://geeklog.net',
        'default' => 'http://geeklog.net',
        'help' => 'The url to your site, starting with http://, no trailing slash',
        'islocked' => true,  // those are excluded from the GUI to be changed
        'type' => 'string',  // the type can define a validation process such as for emails, urls, boolean, numbers etc
        'alternative' => '', // nothing give, so all allowed
        'section' = 'Site Settings' // this is to group values in the GUI
    )
);

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 eval() 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. Tokyoahead 21:52, 10 March 2007 (EST)