From 2106d4b351a059a59db8278ee8afaa2d74dc64df Mon Sep 17 00:00:00 2001 From: Jason Fowler Date: Wed, 6 Nov 2013 12:14:02 +0800 Subject: [PATCH] MDL-42660 TinyMCE: Shuffle icons in default toolbar layout --- lib/editor/tinymce/db/upgrade.php | 12 ++++++++++++ lib/editor/tinymce/settings.php | 2 +- lib/editor/tinymce/version.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/editor/tinymce/db/upgrade.php b/lib/editor/tinymce/db/upgrade.php index 7147da3f93104..07570049a0523 100644 --- a/lib/editor/tinymce/db/upgrade.php +++ b/lib/editor/tinymce/db/upgrade.php @@ -135,5 +135,17 @@ function xmldb_editor_tinymce_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2013102900, 'editor', 'tinymce'); } + if ($oldversion < 2013110600) { + // Reset redesigned editor toolbar setting. + $currentorder = get_config('editor_tinymce', 'customtoolbar'); + // Start with a wrap. + // Remove the nonbreaking,charmap,table buttons (to be placed else where). + $neworder = str_replace(",wrap,nonbreaking,charmap,table", "", $currentorder); + // Place the nonbreaking,charmap,table button where they belongs. + $neworder = str_replace("search,replace", "search,replace,wrap,nonbreaking,charmap,table", $neworder); + set_config('customtoolbar', $neworder, 'editor_tinymce'); + upgrade_plugin_savepoint(true, 2013110600, 'editor', 'tinymce'); + } + return true; } diff --git a/lib/editor/tinymce/settings.php b/lib/editor/tinymce/settings.php index d5fd61465ee87..b086d40c8fcde 100644 --- a/lib/editor/tinymce/settings.php +++ b/lib/editor/tinymce/settings.php @@ -33,7 +33,7 @@ $settings->add(new admin_setting_heading('tinymcegeneralheader', new lang_string('settings'), '')); $default = "wrap,formatselect,wrap,bold,italic,wrap,bullist,numlist,wrap,link,unlink,wrap,image -undo,redo,wrap,underline,strikethrough,sub,sup,wrap,justifyleft,justifycenter,justifyright,wrap,outdent,indent,wrap,forecolor,backcolor,wrap,ltr,rtl,wrap +undo,redo,wrap,underline,strikethrough,sub,sup,wrap,justifyleft,justifycenter,justifyright,wrap,outdent,indent,wrap,forecolor,backcolor,wrap,ltr,rtl fontselect,fontsizeselect,wrap,code,search,replace,wrap,nonbreaking,charmap,table,wrap,cleanup,removeformat,pastetext,pasteword,wrap,fullscreen"; $settings->add(new admin_setting_configtextarea('editor_tinymce/customtoolbar', diff --git a/lib/editor/tinymce/version.php b/lib/editor/tinymce/version.php index 0ea7cbd0700fc..72fc96de122b2 100644 --- a/lib/editor/tinymce/version.php +++ b/lib/editor/tinymce/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2013110500; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2013110600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2013110500; // Requires this Moodle version $plugin->component = 'editor_tinymce'; // Full name of the plugin (used for diagnostics) $plugin->release = '3.5.8'; // This is NOT a directory name, see lib.php if you need to know where is the editor code!