3 function phorum_htmlpurifier_save_settings() {
5 if (phorum_htmlpurifier_config_file_exists()) {
6 echo "Cannot update settings, <code>mods/htmlpurifier/config.php</code> already exists. To change
7 settings, edit that file. To use the web form, delete that file.<br />";
9 $config = phorum_htmlpurifier_get_config(true);
10 if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']);
11 $PHORUM['mod_htmlpurifier']['config'] = $config->getAll();
13 $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']);
14 $PHORUM['mod_htmlpurifier']['suppress_message'] = !empty($_POST['suppress_message']);
15 if(!phorum_htmlpurifier_commit_settings()){
16 $error="Database error while updating settings.";
18 echo "Settings Updated<br />";
22 function phorum_htmlpurifier_commit_settings() {
24 return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"]));