Skip to content

Commit

Permalink
MDL-42660 TinyMCE: Ensure upgrade is only performed when possible
Browse files Browse the repository at this point in the history
Conflicts:

	lib/editor/tinymce/db/upgrade.php
  • Loading branch information
jsnfwlr authored and Damyon Wiese committed Nov 8, 2013
1 parent d25e988 commit 46f763e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/editor/tinymce/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,20 @@ function xmldb_editor_tinymce_upgrade($oldversion) {
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');
$olddefaultorder = "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,nonbreaking,charmap,table
fontselect,fontsizeselect,wrap,code,search,replace,wrap,cleanup,removeformat,pastetext,pasteword,wrap,fullscreen";
$neworder = "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
fontselect,fontsizeselect,wrap,code,search,replace,wrap,nonbreaking,charmap,table,wrap,cleanup,removeformat,pastetext,pasteword,wrap,fullscreen";
if ($currentorder == $olddefaultorder) {
set_config('customtoolbar', $neworder, 'editor_tinymce');
}

upgrade_plugin_savepoint(true, 2013110600, 'editor', 'tinymce');
}

Expand Down

0 comments on commit 46f763e

Please sign in to comment.