Difference between revisions of "Talk:SoC config.php GUI"

From GeeklogWiki
Jump to: navigation, search
m
 
m
Line 4: Line 4:
 
$_CONF_GUI = array(
 
$_CONF_GUI = array(
 
     'site_url' = array(
 
     'site_url' = array(
        'value' => 'http://geeklog.net',
 
 
         'default' => 'http://geeklog.net',
 
         'default' => 'http://geeklog.net',
 +
        'islocked' => false,
 
         'help' => 'The url to your site, starting with http://, no trailing slash',
 
         '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
 
         'type' => 'string',  // the type can define a validation process such as for emails, urls, boolean, numbers etc
         'alternative' => '', // nothing give, so all allowed
+
         'alternative' => '', // nothing given, so all allowed
 
         'section' = 'Site Settings' // this is to group values in the GUI
 
         'section' = 'Site Settings' // this is to group values in the GUI
 
     )
 
     )
 +
);
 +
 +
$_CONF = array(
 +
    'site_url' => 'http://geeklog.net',
 +
    'db_pass' => 'password'
 
);
 
);
 
</pre>
 
</pre>
  
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.
+
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.
[[User:Tokyoahead|Tokyoahead]] 21:52, 10 March 2007 (EST)
+
[[User:Tokyoahead|Tokyoahead]] 21:28, 11 March 2007 (EDT)

Revision as of 01:28, 12 March 2007

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)