function save_settings() { global $wb; wb_set_text($wb->statusbar, "Saving configuration..."); // Get values save_window_geom($wb->mainwin, "main", true); // Get various settings foreach ($wb->options_array as $var) { $var = strtolower($var); if ($wb->{$var} === '') { $wb->settings["Settings"][$var] = ''; } elseif (preg_match("/[\\d\\.\\,]+/", $wb->{$var})) { $wb->settings["Settings"][$var] = (int) $wb->{$var}; } else { $wb->settings["Settings"][$var] = $wb->{$var}; } } // Save options to INI file $contents = generate_ini($wb->settings, "; Make Release INI file\r\n"); if ($contents) { file_put_contents(SYS_INIFILE, $contents); wb_set_text($wb->statusbar, "Configuration saved."); } else { wb_message_box($wb->mainwin, "Problem saving file " . SYS_INIFILE); } }
function main($server_cfg) { generate_ini($server_cfg); }