MDL-19580 cleanup of require css and js filepicker code

This commit is contained in:
skodak 2009-06-24 22:34:29 +00:00
parent b14e77c966
commit ff5fe31160
14 changed files with 169 additions and 121 deletions

View file

@ -111,6 +111,30 @@ function get_available_editors() {
return $editors;
}
/**
* Setup all JS and CSS needed for editors.
* @return void
*/
function editors_head_setup() {
global $CFG;
if (empty($CFG->texteditors)) {
$CFG->texteditors = 'tinymce,textarea';
}
$active = explode(',', $CFG->texteditors);
foreach ($active as $editorname) {
if (!$editor = get_texteditor($editorname)) {
continue;
}
if (!$editor->supported_by_browser()) {
// bad luck, this editor is not compatible
continue;
}
$editor->head_setup();
}
}
/**
* Base abstract text editor class.
*
@ -150,6 +174,13 @@ abstract class texteditor {
* @return void
*/
public abstract function use_editor($elementid, array $options=null);
/**
* Setup all JS and CSS needed for editor.
* @return void
*/
public function head_setup() {
}
}