Permalink
Browse files

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

  • Loading branch information...
1 parent c57fc98 commit 1702fb6ddaa923792f42fb79a696a81870844be7 @sammarshallou sammarshallou committed with skodak May 16, 2012
Showing with 38 additions and 44 deletions.
  1. +38 −44 lib/editor/tinymce/lib.php
View
@@ -102,15 +102,6 @@ protected function get_init_params($elementid, array $options=null) {
$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 @@ protected function get_init_params($elementid, array $options=null) {
}
$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();

0 comments on commit 1702fb6

Please sign in to comment.