function toHtml(){
if ($this->_canUseHtmlEditor && !$this->_flagFrozen){
- ob_start();
- use_html_editor($this->getName(), '', $this->getAttribute('id'));
- $script=ob_get_clean();
+ global $htmlEditorObject;
+ $script = $htmlEditorObject->activateEditor($this->getName(), $this->getAttribute('id'));
} else {
$script='';
}
return $html . $this->_getPersistantData();
} //end func getFrozenHtml
}
-?>
\ No newline at end of file
+?>
return false;
}
+ /**
+ * Get the list of available HTML editors
+ */
+function get_available_html_editors() {
+ global $CFG;
+ static $editors = null;
+
+ if ($editors != null) {
+ return $editors;
+ }
+
+ $editors = array();
+
+ $dir = opendir($CFG->libdir .'/editor');
+ while (($file = readdir($dir)) !== false) {
+ if ($file != '.' and $file != '..') {
+ $path_file = $CFG->libdir ."/editor/{$file}";
+ if (is_dir($path_file) and file_exists($path_file .'.js.php')) {
+ $editors[] = $file;
+ }
+ }
+ }
+ closedir($dir);
+
+ return $editors;
+}
+
/**
* Determines if the HTML editor is enabled.
*
$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();