fixed cleaning before editing SC#163; merged from MOODLE_15_STABLE

This commit is contained in:
skodak
2005-10-29 21:40:41 +00:00
parent e7a4715302
commit cda94ae1b8
2 changed files with 24 additions and 6 deletions
+12 -3
View File
@@ -1,3 +1,15 @@
<?php //$Id$
if (!isset($form->format)) {
$form->format = $defaultformat;
}
if ($usehtmleditor) { //clean and convert before editing
$options = new object();
$options->smiley = false;
$options->filter = false;
$form->text = format_text($form->text, $form->format, $options);
$form->format = FORMAT_HTML;
}
?>
<form name="form" method="post" action="comment.php">
<table class="generalbox">
<tr valign="top">
@@ -30,9 +42,6 @@
print_string('formathtml');
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
if (!isset($form->format)) {
$form->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $form->format, "");
}
helpbutton("textformat", get_string("helpformatting"));
+12 -3
View File
@@ -1,3 +1,15 @@
<?php //$Id$
if (!isset($newentry->format)) {
$newentry->format = $defaultformat;
}
if ($usehtmleditor) { //clean and convert before editing
$options = new object();
$options->smiley = false;
$options->filter = false;
$newentry->definition = format_text($newentry->definition, $newentry->format, $options);
$newentry->format = FORMAT_HTML;
}
?>
<form name="form" method="post" action="edit.php" enctype="multipart/form-data">
<table border="0" cellpadding="5">
<?php
@@ -137,9 +149,6 @@ if (isset($errors)) {
print_string('formathtml');
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
if (!isset($newentry->format)) {
$newentry->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $newentry->format, "");
}
helpbutton("textformat", get_string("helpformatting"));