You are here

function _wysiwyg_tinymce_4_to_3_plugin_remap in Wysiwyg 6.2

Same name and namespace in other branches
  1. 7.2 editors/tinymce.inc \_wysiwyg_tinymce_4_to_3_plugin_remap()

Helper for converting plugins and buttons between TinyMCE 4 and 3.

1 call to _wysiwyg_tinymce_4_to_3_plugin_remap()
_wysiwyg_tinymce_migrate_settings in editors/tinymce.inc
Callback to migrate settings between known TinyMCE versions.

File

editors/tinymce.inc, line 1543
Editor integration functions for TinyMCE.

Code

function _wysiwyg_tinymce_4_to_3_plugin_remap($plugin, $button) {
  switch ($button) {
    case 'link':
    case 'unlink':
    case 'anchor':
    case 'image':
    case 'code':
    case 'charmap':
    case 'cleanup':
    case 'hr':
      return array(
        'default',
        $button,
      );
    case 'alignleft':
      return array(
        'default',
        'justifyleft',
      );
    case 'alignright':
      return array(
        'default',
        'justifyright',
      );
    case 'aligncenter':
      return array(
        'default',
        'justifycenter',
      );
    case 'alignjustify':
      return array(
        'default',
        'justifyfull',
      );
    case 'forecolor':
    case 'backcolor':
      return array(
        'default',
        $button,
      );
    case 'searchreplace':
      return array(
        array(
          'searchreplace',
          'search',
        ),
        array(
          'searchreplace',
          'replace',
        ),
      );
    case 'emoticons':
      return array(
        'emotions',
        'emotions',
      );
    case 'superscript':
      return array(
        'default',
        'sup',
      );
    case 'subscript':
      return array(
        'default',
        'sub',
      );
    case 'selectall':
      return array(
        'paste',
        'selectall',
      );
    case 'table':
      return array(
        array(
          'table',
          'table',
        ),
        array(
          'table',
          'tablecontrols',
        ),
      );
    default:
      return array(
        $plugin,
        $button,
      );
  }
}