mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
Tidy up Phorum extension. Add svn:ignore, add img to the default list of allowed tags (for smileys), improve naming convention, move loading code out of main namespace, and add reset. Probably the last thing to do before this is feature complete is to have a WYSIWYG flag that turns on escaping for edit posts.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1270 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -32,6 +32,10 @@ $directives = array(
|
||||
'Output.TidyFormat',
|
||||
);
|
||||
|
||||
if (isset($_POST['reset'])) {
|
||||
unset($PHORUM['mod_htmlpurifier']['config']);
|
||||
}
|
||||
|
||||
// instantiate $config object
|
||||
$config_exists = file_exists(dirname(__FILE__) . '/config.php');
|
||||
if ($config_exists || !isset($PHORUM['mod_htmlpurifier']['config'])) {
|
||||
@@ -51,7 +55,7 @@ if(!empty($_POST)){
|
||||
echo "Cannot update settings, <code>mods/htmlpurifier/config.php</code> already exists. To change
|
||||
settings, edit that file. To use the web form, delete that file.<br />";
|
||||
} else {
|
||||
$config->mergeArrayFromForm($_POST, 'config', $directives);
|
||||
if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $directives);
|
||||
$PHORUM['mod_htmlpurifier']['config'] = $config->getAll();
|
||||
if(!phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"]))){
|
||||
$error="Database error while updating settings.";
|
||||
@@ -114,6 +118,8 @@ if ($config_exists) {
|
||||
$frm->addMessage($htmlpurifier_form->render($config, $directives, false));
|
||||
|
||||
$frm->addMessage($warning);
|
||||
|
||||
$frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false));
|
||||
|
||||
// hack to include extra styling
|
||||
echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . '
|
||||
|
Reference in New Issue
Block a user