]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing Bug 812 and problems with slashes when editing text and HTML files
authormoodler <moodler>
Wed, 4 Aug 2004 16:26:44 +0000 (16:26 +0000)
committermoodler <moodler>
Wed, 4 Aug 2004 16:26:44 +0000 (16:26 +0000)
Again.

files/index.php

index 90910ab569cb7d78344c832b3ca2704cbfa29dac..287d59d1595efdee5938b163cf188c3c0c6f7b8c 100644 (file)
                 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>";
                 echo "</TD></TR></TABLE>";
 
                 if ($usehtmleditor) { 
-                    print_richedit_javascript("form", "text", "yes");
+                    use_html_editor();
                 }