Release 3.3.0.
[htmlpurifier/darkodev.git] / plugins / phorum / settings / save.php
blob7dbb767d0ff107796a878a719cc4bbb1ffc6214c
1 <?php
3 function phorum_htmlpurifier_save_settings() {
4 global $PHORUM;
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 />";
8 } else {
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.";
17 } else {
18 echo "Settings Updated<br />";
22 function phorum_htmlpurifier_commit_settings() {
23 global $PHORUM;
24 return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"]));
27 // vim: et sw=4 sts=4