Skip to content

Commit

Permalink
Fixing Bug 812 and problems with slashes when editing text and HTML f…
Browse files Browse the repository at this point in the history
…iles

Again.
  • Loading branch information
moodler committed Aug 4, 2004
1 parent f7dea93 commit ffae3d4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions files/index.php
Original file line number Diff line number Diff line change
@@ -317,25 +317,20 @@ function html_header($course, $wdir, $formfield=""){
fclose($fileptr);

if (mimeinfo("type", $file) == "text/html") {
if ($usehtmleditor = can_use_richtext_editor()) {
$onsubmit = "onsubmit=\"copyrichtext(document.form.text);\"";
} else {
$onsubmit = "";
}
$usehtmleditor = can_use_html_editor();
} else {
$usehtmleditor = false;
$onsubmit = "";
}

print_heading("$streditfile");

echo "<TABLE><TR><TD COLSPAN=2>";
echo "<FORM ACTION=\"index.php\" METHOD=\"post\" NAME=\"form\" $onsubmit>";
echo "<FORM ACTION=\"index.php\" METHOD=\"post\" NAME=\"form\">";
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\">";
echo " <INPUT TYPE=hidden NAME=action VALUE=edit>";
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", addslashes($contents));
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
echo "</TD></TR><TR><TD>";
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\">";
echo "</FORM>";
@@ -349,7 +344,7 @@ function html_header($course, $wdir, $formfield=""){
echo "</TD></TR></TABLE>";

if ($usehtmleditor) {
print_richedit_javascript("form", "text", "yes");
use_html_editor();
}


0 comments on commit ffae3d4

Please sign in to comment.