From 9ee16191ec3ff095985372e391e3284e4d0b4f1a Mon Sep 17 00:00:00 2001 From: scyrma Date: Tue, 15 Jul 2008 09:43:14 +0000 Subject: [PATCH] MDL-14741: load editor automatically, from footer/after page is loaded. --- lib/weblib.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index fe5bdc611b..db39a54762 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".'