MDL-33041 (2) Tidy up tinymce lib.php before starting real changes

This commit is contained in:
sam marshall
2012-08-10 14:57:58 +02:00
committed by Petr Škoda
parent c57fc98b27
commit 1702fb6dda
+38 -44
View File
@@ -102,15 +102,6 @@ class tinymce_texteditor extends texteditor {
$fontselectlist = empty($config->fontselectlist) ? '' : $config->fontselectlist;
$fontbutton = ($fontselectlist === '') ? '' : 'fontselect,';
$xmedia = 'moodlemedia,'; // HQ thinks it should be always on, so it is no matter if it will actually work or not
/*
if (!empty($options['legacy'])) {
$xmedia = 'moodlemedia,';
} else {
if (!empty($options['noclean']) or !empty($options['trusted'])) {
}
}*/
$filters = filter_get_active_in_context($context);
if (array_key_exists('filter/tex', $filters)) {
$xdragmath = 'dragmath,';
@@ -124,41 +115,44 @@ class tinymce_texteditor extends texteditor {
}
$params = array(
'mode' => "exact",
'elements' => $elementid,
'relative_urls' => false,
'document_base_url' => $CFG->httpswwwroot,
'content_css' => $contentcss,
'language' => $lang,
'directionality' => $directionality,
'plugin_insertdate_dateFormat ' => $strdate,
'plugin_insertdate_timeFormat ' => $strtime,
'theme' => "advanced",
'skin' => "o2k7",
'skin_variant' => "silver",
'apply_source_formatting' => true,
'remove_script_host' => false,
'entity_encoding' => "raw",
'plugins' => "{$xmedia}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",
'theme_advanced_font_sizes' => "1,2,3,4,5,6,7",
'theme_advanced_layout_manager' => "SimpleLayout",
'theme_advanced_toolbar_align' => "left",
'theme_advanced_buttons1' => "{$fontbutton}fontsizeselect,formatselect",
'theme_advanced_buttons1_add' => "|,undo,redo,|,search,replace,|,fullscreen",
'theme_advanced_buttons2' => "bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright",
'theme_advanced_buttons2_add' => "|,cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl",
'theme_advanced_buttons3' => "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,|,image,{$xemoticon}{$xmedia}{$xdragmath}nonbreaking,charmap",
'theme_advanced_buttons3_add' => "table,|,code{$spellbutton}",
'theme_advanced_fonts' => $fontselectlist,
'theme_advanced_resize_horizontal' => true,
'theme_advanced_resizing' => true,
'theme_advanced_resizing_min_height' => 30,
'min_height' => 30,
'theme_advanced_toolbar_location' => "top",
'theme_advanced_statusbar_location' => "bottom",
'spellchecker_rpc_url' => $CFG->httpswwwroot."/lib/editor/tinymce/tiny_mce/$this->version/plugins/spellchecker/rpc.php",
'spellchecker_languages' => $spelllanguagelist
);
'mode' => "exact",
'elements' => $elementid,
'relative_urls' => false,
'document_base_url' => $CFG->httpswwwroot,
'content_css' => $contentcss,
'language' => $lang,
'directionality' => $directionality,
'plugin_insertdate_dateFormat ' => $strdate,
'plugin_insertdate_timeFormat ' => $strtime,
'theme' => "advanced",
'skin' => "o2k7",
'skin_variant' => "silver",
'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",
'theme_advanced_font_sizes' => "1,2,3,4,5,6,7",
'theme_advanced_layout_manager' => "SimpleLayout",
'theme_advanced_toolbar_align' => "left",
'theme_advanced_buttons1' => $fontbutton . 'fontsizeselect,formatselect,|,' .
'undo,redo,|,search,replace,|,fullscreen',
'theme_advanced_buttons2' => 'bold,italic,underline,strikethrough,sub,sup,|,' .
'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,
'theme_advanced_fonts' => $fontselectlist,
'theme_advanced_resize_horizontal' => true,
'theme_advanced_resizing' => true,
'theme_advanced_resizing_min_height' => 30,
'min_height' => 30,
'theme_advanced_toolbar_location' => "top",
'theme_advanced_statusbar_location' => "bottom",
'spellchecker_rpc_url' => $CFG->httpswwwroot."/lib/editor/tinymce/tiny_mce/$this->version/plugins/spellchecker/rpc.php",
'spellchecker_languages' => $spelllanguagelist
);
if ($xemoticon) {
$manager = get_emoticon_manager();