mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-33041 (4) Use new system for existing added TinyMCE plugins
AMOS BEGIN MOV [dragmath:dragmath_desc,editor_tinymce],[dragmath_desc,tinymce_dragmath] MOV [dragmath:dragmath_javaneeded,editor_tinymce],[dragmath_javaneeded,tinymce_dragmath] MOV [dragmath:dragmath_title,editor_tinymce],[dragmath_title,tinymce_dragmath] MOV [moodleemoticon:desc,editor_tinymce],[desc,tinymce_moodleemoticon] MOV [moodlenolink:desc,editor_tinymce],[desc,tinymce_moodlenolink] CPY [desc,tinymce_moodleemoticon],[pluginname,tinymce_moodleemoticon] CPY [desc,tinymce_moodlenolink],[pluginname,tinymce_moodlenolink] AMOS END
This commit is contained in:
parent
fae911708e
commit
204903363f
37 changed files with 465 additions and 74 deletions
|
@ -103,18 +103,6 @@ class tinymce_texteditor extends texteditor {
|
|||
$fontselectlist = empty($config->fontselectlist) ? '' : $config->fontselectlist;
|
||||
$fontbutton = ($fontselectlist === '') ? '' : 'fontselect,';
|
||||
|
||||
$filters = filter_get_active_in_context($context);
|
||||
if (array_key_exists('filter/tex', $filters)) {
|
||||
$xdragmath = 'dragmath,';
|
||||
} else {
|
||||
$xdragmath = '';
|
||||
}
|
||||
if (array_key_exists('filter/emoticon', $filters)) {
|
||||
$xemoticon = 'moodleemoticon,';
|
||||
} else {
|
||||
$xemoticon = '';
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'mode' => "exact",
|
||||
'elements' => $elementid,
|
||||
|
@ -131,7 +119,10 @@ class tinymce_texteditor extends texteditor {
|
|||
'apply_source_formatting' => true,
|
||||
'remove_script_host' => false,
|
||||
'entity_encoding' => "raw",
|
||||
'plugins' => "moodlemedia,advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,{$xemoticon}{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak,spellchecker",
|
||||
'plugins' => 'advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,' .
|
||||
'searchreplace,paste,directionality,fullscreen,nonbreaking,contextmenu,' .
|
||||
'insertdatetime,save,iespell,preview,print,noneditable,visualchars,' .
|
||||
'xhtmlxtras,template,pagebreak,spellchecker',
|
||||
'theme_advanced_font_sizes' => "1,2,3,4,5,6,7",
|
||||
'theme_advanced_layout_manager' => "SimpleLayout",
|
||||
'theme_advanced_toolbar_align' => "left",
|
||||
|
@ -141,9 +132,7 @@ class tinymce_texteditor extends texteditor {
|
|||
'justifyleft,justifycenter,justifyright,|,' .
|
||||
'cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl',
|
||||
'theme_advanced_buttons3' => 'bullist,numlist,outdent,indent,|,' .
|
||||
'link,unlink,moodlenolink,|,' .
|
||||
"image,{$xemoticon}moodlemedia,{$xdragmath}nonbreaking,charmap,table,|," .
|
||||
'code' . $spellbutton,
|
||||
'link,unlink,|,image,nonbreaking,charmap,table,|,code' . $spellbutton,
|
||||
'theme_advanced_fonts' => $fontselectlist,
|
||||
'theme_advanced_resize_horizontal' => true,
|
||||
'theme_advanced_resizing' => true,
|
||||
|
@ -155,19 +144,6 @@ class tinymce_texteditor extends texteditor {
|
|||
'spellchecker_languages' => $spelllanguagelist
|
||||
);
|
||||
|
||||
if ($xemoticon) {
|
||||
$manager = get_emoticon_manager();
|
||||
$emoticons = $manager->get_emoticons();
|
||||
$imgs = array();
|
||||
// see the TinyMCE plugin moodleemoticon for how the emoticon index is (ab)used :-S
|
||||
$index = 0;
|
||||
foreach ($emoticons as $emoticon) {
|
||||
$imgs[$emoticon->text] = $OUTPUT->render(
|
||||
$manager->prepare_renderable_emoticon($emoticon, array('class' => 'emoticon emoticon-index-'.$index++)));
|
||||
}
|
||||
$params['moodleemoticon_emoticons'] = json_encode($imgs);
|
||||
}
|
||||
|
||||
if (!empty($options['legacy']) or !empty($options['noclean']) or !empty($options['trusted'])) {
|
||||
// now deal somehow with non-standard tags, people scream when we do not make moodle code xtml strict,
|
||||
// but they scream even more when we strip all tags that are not strict :-(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue