MDL-14741: use the default html editor, as chosen in the admin settings
[moodle.git] / lib / weblib.php
index af9fe88..616878b 100644 (file)
@@ -2557,11 +2557,18 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
 
     $bodytags .= ' class="'.$pageclass.'" id="'.$pageid.'"';
 
+    require_once($CFG->libdir .'/editor/htmlEditor.class.php');
+    global $htmlEditorObject;
+    $htmlEditorObject = new htmlEditor();
+    $htmlEditor = $htmlEditorObject->configure();
+
     ob_start();
     include($CFG->header);
     $output = ob_get_contents();
     ob_end_clean();
 
+    $output = str_replace('</head>', "\n\n$htmlEditor\n\n</head>", $output);
+
     // container debugging info
     $THEME->open_header_containers = open_containers();