mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-19580 cleanup of require css and js filepicker code
This commit is contained in:
parent
b14e77c966
commit
ff5fe31160
14 changed files with 169 additions and 121 deletions
|
@ -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() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue