diff --git a/lib/weblib.php b/lib/weblib.php
index fe5bdc611b7..db39a547626 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -4027,6 +4027,16 @@ function print_container_end($return=false) {
$output = '';
}
+ if ($idbase == 'footer' and !empty($THEME->htmleditors)) {
+ $output .= "\n".''."\n";
+ }
+
if ($return) {
return $output;
} else {
@@ -4792,7 +4802,7 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
/// $width and height are legacy fields and no longer used as pixels like they used to be.
/// However, you can set them to zero to override the mincols and minrows values below.
- global $CFG, $COURSE, $HTTPSPAGEREQUIRED;
+ global $CFG, $COURSE, $HTTPSPAGEREQUIRED, $THEME;
//static $scriptcount = 0; // For loading the htmlarea script only once.
$mincols = 65;
@@ -4837,6 +4847,11 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
}
}
}
+
+ if ($usehtmleditor) {
+ $THEME->htmleditors[] = $id;
+ }
+
$str .= "\n".'