diff --git a/files/index.php b/files/index.php index 4d612143dc7..c1677501047 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 ""; @@ -304,6 +315,12 @@ echo " "; echo ""; echo " | |