diff --git a/doc/Developing/Dynamic-Config.md b/doc/Developing/Dynamic-Config.md new file mode 100644 index 000000000..a1d2309f8 --- /dev/null +++ b/doc/Developing/Dynamic-Config.md @@ -0,0 +1,48 @@ +# Adding new config options to WebUI + +Adding support for users to update a new config option via the WebUI is now a lot easier for general options. This +document shows you how to add a new config option and even section to the WebUI. + +#### Update DB + +Firstly you will need to add the config option to the database. Here's an example: + +```sql +insert into config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.tolerance_window','','','Tolerance window in seconds','alerting',0,'general',0,'0','0'); +``` + +This will determine the default config option for `$config['alert']['tolerance_window']`. + +#### Update WebUI + +If the sub-section you want to add the new config option already exists then update the relevant file within +`html/pages/settings/` otherwise you will need to create the new sub-section page. Here's an example of this: + +```php + 'alert.tolerance_window', + 'descr' => 'Tolerance window for cron', + 'type' => 'text', + ), +); + +echo ' +