From: moodler Date: Thu, 26 Dec 2002 16:26:55 +0000 (+0000) Subject: Use HTML editor for editing HTML files X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=04fa59d0152681729224bb49ec327787d0eb14aa;p=moodle.git Use HTML editor for editing HTML files --- diff --git a/files/index.php b/files/index.php index 4d612143dc..c167750104 100644 --- a/files/index.php +++ b/files/index.php @@ -279,20 +279,31 @@ displaydir($wdir); } else { + $streditfile = get_string("edit", "", "$file"); $fileptr = fopen($basedir.$file, "r"); $contents = fread($fileptr, filesize($basedir.$file)); fclose($fileptr); - echo "

Editing $file:"; + if (mimeinfo("type", $file) == "text/html") { + if ($usehtmleditor = can_use_richtext_editor()) { + $onsubmit = "onsubmit=\"copyrichtext(document.form.text);\""; + } else { + $onsubmit = ""; + } + } else { + $usehtmleditor = false; + $onsubmit = ""; + } + + print_heading("$streditfile"); + echo "
"; - echo "
"; + echo ""; echo " "; echo " "; echo " "; echo " "; - echo ""; + print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); echo "
"; echo " "; echo ""; @@ -304,6 +315,12 @@ echo " "; echo ""; echo "
"; + + if ($usehtmleditor) { + print_richedit_javascript("form", "text", "yes"); + } + + } html_footer(); break;