Merge branch 'w20_MDL-26901_m23_tinymceoptions' of git://github.com/skodak/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 14 May 2012 06:44:04 +0000 (14:44 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 14 May 2012 06:44:04 +0000 (14:44 +0800)
lib/editor/tinymce/lang/en/editor_tinymce.php
lib/editor/tinymce/lib.php
lib/editor/tinymce/settings.php
lib/editor/tinymce/version.php

index 484ed6b..587ed66 100644 (file)
@@ -31,6 +31,7 @@ $string['common:browsemedia'] = 'Find or upload a sound, video or applet...';
 $string['dragmath:dragmath_desc'] = 'Insert equation';
 $string['dragmath:dragmath_javaneeded'] = 'To use this page you need a Java-enabled browser. Download the latest Java plug-in from {$a}.';
 $string['dragmath:dragmath_title'] = 'DragMath Equation Editor';
+$string['fontselectlist'] = 'Available fonts list';
 $string['media_dlg:filename'] = 'Filename';
 $string['moodleemoticon:desc'] = 'Insert emoticon';
 $string['moodlenolink:desc'] = 'Prevent automatic linking';
index 3b1a691..885af15 100644 (file)
@@ -94,6 +94,14 @@ class tinymce_texteditor extends texteditor {
 
         $context = empty($options['context']) ? get_context_instance(CONTEXT_SYSTEM) : $options['context'];
 
+        $config = get_config('editor_tinymce');
+
+        $spelllanguagelist = empty($config->spelllanguagelist) ? '' : $config->spelllanguagelist;
+        $spellbutton = ($spelllanguagelist === '') ? '' : ',spellchecker';
+
+        $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'])) {
@@ -135,20 +143,20 @@ class tinymce_texteditor extends texteditor {
                     'theme_advanced_font_sizes' => "1,2,3,4,5,6,7",
                     'theme_advanced_layout_manager' => "SimpleLayout",
                     'theme_advanced_toolbar_align' => "left",
-                    'theme_advanced_buttons1' => "fontselect,fontsizeselect,formatselect",
+                    '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,spellchecker",
-                    'theme_advanced_fonts' => "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings",
+                    '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,
                     'theme_advanced_toolbar_location' => "top",
                     'theme_advanced_statusbar_location' => "bottom",
                     'spellchecker_rpc_url' => $CFG->wwwroot."/lib/editor/tinymce/tiny_mce/$this->version/plugins/spellchecker/rpc.php",
-                    'spellchecker_languages' => get_config('editor_tinymce', 'spelllanguagelist')
+                    'spellchecker_languages' => $spelllanguagelist
                   );
 
         if ($xemoticon) {
index db02700..d26d84b 100644 (file)
@@ -33,8 +33,11 @@ if ($ADMIN->fulltree) {
         'PSpellShell'=>'PSpellShell');
     $settings->add(new admin_setting_configselect('editor_tinymce/spellengine',
             get_string('spellengine', 'admin'), '', 'GoogleSpell', $options));
-    $settings->add(new admin_setting_configtext('editor_tinymce/spelllanguagelist',
+    $settings->add(new admin_setting_configtextarea('editor_tinymce/spelllanguagelist',
             get_string('spelllanguagelist', 'admin'), '',
             '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,' .
             'Portuguese=pt,Spanish=es,Swedish=sv', PARAM_RAW));
+    $settings->add(new admin_setting_configtextarea('editor_tinymce/fontselectlist',
+        get_string('fontselectlist', 'editor_tinymce'), '',
+        'Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings', PARAM_RAW));
 }
index 318d641..416fd95 100644 (file)
@@ -25,7 +25,7 @@
 
 defined('MOODLE_INTERNAL') || die();
 
-$plugin->version   = 2012030300;        // The current plugin version (Date: YYYYMMDDXX)
+$plugin->version   = 2012050800;        // The current plugin version (Date: YYYYMMDDXX)
 $plugin->requires  = 2011112900;        // Requires this Moodle version
 $plugin->component = 'editor_tinymce';  // Full name of the plugin (used for diagnostics)
-$plugin->release   = '3.4.9';
+$plugin->release   = '3.5.0';