]> git.mjollnir.org Git - moodle.git/commitdiff
Updated use_html_editor() and print_editor_config()
authorvyshane <vyshane>
Wed, 15 Mar 2006 03:12:28 +0000 (03:12 +0000)
committervyshane <vyshane>
Wed, 15 Mar 2006 03:12:28 +0000 (03:12 +0000)
lib/weblib.php

index f31597c07d238602a6fbdd8792b687dae2cad816..bbff827136f823e15be15b6243efe164a8b068f3 100644 (file)
@@ -3215,22 +3215,22 @@ function print_richedit_javascript($form, $name, $source='no') {
  */
 function use_html_editor($name='', $editorhidebuttons='') {
     echo '<script language="javascript" type="text/javascript" defer="defer">'."\n";
-    echo "editor = new HTMLArea('edit-$name');\n";
+    echo "edit_$name = new HTMLArea('edit-$name');\n";
+    echo "var config = edit_$name.config;\n";
     
     echo print_editor_config($editorhidebuttons);
     
     if (empty($name)) {
         echo "\n".'HTMLArea.replaceAll(editor.config);'."\n";
     } else {
-        echo "\neditor.generate();\n";
+        echo "\nedit_$name.generate();\n";
     }
     echo '</script>'."\n";
 }
 
 function print_editor_config($editorhidebuttons='', $return=false) {
     global $CFG;
-        
-    $str = "var config = editor.config;\n";
+    
     $str .= "config.pageStyle = \"body {";
     
     if (!(empty($CFG->editorbackgroundcolor))) {