Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

New function to print richtext javascript

  • Loading branch information...
commit 3df49694a9ca6532d9362db8100dc513a9a31b32 1 parent 901f9f7
moodler authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/moodlelib.php
View
13 lib/moodlelib.php
@@ -321,17 +321,24 @@ function print_textarea($richedit, $rows, $cols, $width, $height, $name, $value=
echo "<object id=richedit style=\"BACKGROUND-COLOR: buttonface\"";
echo " data=\"$CFG->wwwroot/lib/rte/richedit.html\"";
echo " width=\"$width\" height=\"$height\" ";
- echo " type=\"text/x-scriptlet\" VIEWASTEXT></object>";
+ echo " type=\"text/x-scriptlet\" VIEWASTEXT></object>\n";
echo "<TEXTAREA style=\"display:none\" NAME=\"$name\" ROWS=1 COLS=1>";
p($value);
- echo "</TEXTAREA>";
+ echo "</TEXTAREA>\n";
} else {
echo "<TEXTAREA name=\"$name\" rows=\"$rows\" cols=\"$cols\" wrap=virtual>";
p($value);
- echo "</TEXTAREA>";
+ echo "</TEXTAREA>\n";
}
}
+function print_richedit_javascript($form, $name, $source="no") {
+ echo "<SCRIPT language=\"JavaScript\" event=\"onload\" for=\"window\">\n";
+ echo " document.richedit.options = \"history=no;source=$source\";";
+ echo " document.richedit.docHtml = $form.$name.innerText;";
+ echo "</SCRIPT>";
+}
+
function update_course_icon($courseid) {
global $CFG, $USER;
Please sign in to comment.
Something went wrong with that request. Please try again.