diff -u b/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc --- b/core/modules/ckeditor/ckeditor.admin.inc +++ b/core/modules/ckeditor/ckeditor.admin.inc @@ -61,7 +61,7 @@ $language_direction = $language_interface->getDirection(); - $build_button_item = function($button, $language_direction) { + $build_button = function($button, $language_direction) { // Set additional attribute on the button if it can occur multiple times. if (!empty($button['multiple'])) { $button['attributes']['class'][] = 'ckeditor-multiple-button'; @@ -75,7 +75,7 @@ // Add language direction property. $button['language_direction'] = $language_direction; - // Check for the image button to be present and convert URI to URL. + // Check for the image button to be present and convert file URI to URL. if (!empty($button['image']) || !empty($button['image_rtl'])) { // The language direction is RTL, check for image_rtl otherwise use the // default image button path. @@ -103,17 +103,17 @@ }); foreach ($buttons as $button) { - $variables['active_buttons'][$row_number][$group_name]['buttons'][] = $build_button_item($button, $language_direction); + $variables['active_buttons'][$row_number][$group_name]['buttons'][] = $build_button($button, $language_direction); } } } // Assemble list of disabled buttons (which are always a single row). $variables['disabled_buttons'] = array(); foreach ($disabled_buttons as $button) { - $variables['disabled_buttons'][] = $build_button_item($button, $language_direction); + $variables['disabled_buttons'][] = $build_button($button, $language_direction); } // Assemble list of multiple buttons that may be added multiple times. $variables['multiple_buttons'] = array(); foreach ($multiple_buttons as $button) { - $variables['multiple_buttons'][] = $build_button_item($button, $language_direction); + $variables['multiple_buttons'][] = $build_button($button, $language_direction); } } diff -u b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php --- b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Internal.php @@ -131,157 +131,157 @@ // "basicstyles" plugin. 'Bold' => array( 'label' => t('Bold'), - 'image_alternative' => 'bold', + 'internal_button' => 'bold', ), 'Italic' => array( 'label' => t('Italic'), - 'image_alternative' => 'italic', + 'internal_button' => 'italic', ), 'Underline' => array( 'label' => t('Underline'), - 'image_alternative' => 'underline', + 'internal_button' => 'underline', ), 'Strike' => array( 'label' => t('Strike-through'), - 'image_alternative' => 'strike', + 'internal_button' => 'strike', ), 'Superscript' => array( 'label' => t('Superscript'), - 'image_alternative' => 'superscript', + 'internal_button' => 'superscript', ), 'Subscript' => array( 'label' => t('Subscript'), - 'image_alternative' => 'subscript', + 'internal_button' => 'subscript', ), // "removeformat" plugin. 'RemoveFormat' => array( 'label' => t('Remove format'), - 'image_alternative' => 'removeformat', + 'internal_button' => 'removeformat', ), // "justify" plugin. 'JustifyLeft' => array( 'label' => t('Align left'), - 'image_alternative' => 'justifyleft', + 'internal_button' => 'justifyleft', ), 'JustifyCenter' => array( 'label' => t('Align center'), - 'image_alternative' => 'justifycenter', + 'internal_button' => 'justifycenter', ), 'JustifyRight' => array( 'label' => t('Align right'), - 'image_alternative' => 'justifyright', + 'internal_button' => 'justifyright', ), 'JustifyBlock' => array( 'label' => t('Justify'), - 'image_alternative' => 'justifyblock', + 'internal_button' => 'justifyblock', ), // "list" plugin. 'BulletedList' => array( 'label' => t('Bullet list'), - 'image_alternative' => 'bulletedlist', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'bulletedlist', + 'internal_button_has_rtl' => TRUE, ), 'NumberedList' => array( 'label' => t('Numbered list'), - 'image_alternative' => 'numberedlist', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'numberedlist', + 'internal_button_has_rtl' => TRUE, ), // "indent" plugin. 'Outdent' => array( 'label' => t('Outdent'), - 'image_alternative' => 'outdent', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'outdent', + 'internal_button_has_rtl' => TRUE, ), 'Indent' => array( 'label' => t('Indent'), - 'image_alternative' => 'indent', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'indent', + 'internal_button_has_rtl' => TRUE, ), // "undo" plugin. 'Undo' => array( 'label' => t('Undo'), - 'image_alternative' => 'undo', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'undo', + 'internal_button_has_rtl' => TRUE, ), 'Redo' => array( 'label' => t('Redo'), - 'image_alternative' => 'redo', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'redo', + 'internal_button_has_rtl' => TRUE, ), // "blockquote" plugin. 'Blockquote' => array( 'label' => t('Blockquote'), - 'image_alternative' => 'blockquote', + 'internal_button' => 'blockquote', ), // "horizontalrule" plugin 'HorizontalRule' => array( 'label' => t('Horizontal rule'), - 'image_alternative' => 'horizontalrule', + 'internal_button' => 'horizontalrule', ), // "clipboard" plugin. 'Cut' => array( 'label' => t('Cut'), - 'image_alternative' => 'cut', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'cut', + 'internal_button_has_rtl' => TRUE, ), 'Copy' => array( 'label' => t('Copy'), - 'image_alternative' => 'copy', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'copy', + 'internal_button_has_rtl' => TRUE, ), 'Paste' => array( 'label' => t('Paste'), - 'image_alternative' => 'paste', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'paste', + 'internal_button_has_rtl' => TRUE, ), // "pastetext" plugin. 'PasteText' => array( 'label' => t('Paste Text'), - 'image_alternative' => 'pastetext', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'pastetext', + 'internal_button_has_rtl' => TRUE, ), // "pastefromword" plugin. 'PasteFromWord' => array( 'label' => t('Paste from Word'), - 'image_alternative' => 'pastefromword', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'pastefromword', + 'internal_button_has_rtl' => TRUE, ), // "specialchar" plugin. 'SpecialChar' => array( 'label' => t('Character map'), - 'image_alternative' => 'specialchar', + 'internal_button' => 'specialchar', ), 'Format' => array( 'label' => t('HTML block format'), 'button_text' => t('Format'), - 'image_alternative' => 'format', + 'internal_button' => 'format', 'is_dropdown' => TRUE, ), // "table" plugin. 'Table' => array( 'label' => t('Table'), - 'image_alternative' => 'table', + 'internal_button' => 'table', ), // "showblocks" plugin. 'ShowBlocks' => array( 'label' => t('Show blocks'), - 'image_alternative' => 'showblocks', - 'image_alternative_rtl' => TRUE, + 'internal_button' => 'showblocks', + 'internal_button_has_rtl' => TRUE, ), // "sourcearea" plugin. 'Source' => array( 'label' => t('Source code'), - 'image_alternative' => 'source', + 'internal_button' => 'source', ), // "maximize" plugin. 'Maximize' => array( 'label' => t('Maximize'), - 'image_alternative' => 'maximize', + 'internal_button' => 'maximize', ), // No plugin, separator "button" for toolbar builder UI use only. '-' => array( 'label' => t('Separator'), - 'image_alternative' => 'separator', + 'internal_button' => 'separator', 'button_text' => t('Button separator'), 'is_separator' => TRUE, 'attributes' => array( diff -u b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php --- b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php @@ -60,7 +60,7 @@ 'Styles' => array( 'label' => t('Font style'), 'button_text' => t('Styles'), - 'image_alternative' => 'styles', + 'internal_button' => 'styles', 'is_dropdown' => TRUE, ), ); diff -u b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php --- b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php @@ -33,14 +33,13 @@ protected function setUp() { parent::setUp(); - // Create a Full HTML filter format and associate this with CKEditor. + // Create a text format and associate this with CKEditor. FilterFormat::create(array( 'format' => 'full_html', 'name' => 'Full HTML', 'weight' => 1, 'filters' => array(), ))->save(); - Editor::create(array( 'format' => 'full_html', 'editor' => 'ckeditor', @@ -56,7 +55,7 @@ } /** - * Tests loading of CKEditor CSS, JS and JS settings. + * Tests that CKEditor RTL classes are being added. */ public function testLanguageDirectionChange() { $this->drupalLogin($this->admin_user); @@ -69,7 +68,7 @@ $edit = array('site_default_language' => 'ar'); $this->drupalPostForm('admin/config/regional/settings', $edit, t('Save configuration')); - // Once the language is changed then goto CKEditor Full HTML configuration. + // Once the default language is changed, go to the tested text format configuration page. $this->drupalGet('admin/config/content/formats/manage/full_html'); $this->assertPattern('|cke_rtl|', 'Correct language direction classes are being added.'); } diff -u b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig --- b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig +++ b/core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig @@ -3,12 +3,12 @@ * @file * Default theme implementation for the CKEditor settings toolbar. * - * This template uses twig macro to create the CKEditor buttons. + * This template uses Twig macro to create the CKEditor buttons. * @see http://twig.sensiolabs.org/doc/tags/macro.html * * Available variables: * - button: A list containing the CKEditor buttons. - * - image_alternative: HTML string representing the contents of this button. + * - internal_button: Indentifier of internal button. * - is_dropdown: Flag for showing a dropdown type button (Optional). If the * value is true then a dropdown button is generated. * - is_separator: Flag for showing a separator "button" (Optional). If the @@ -29,7 +29,7 @@ #} {% macro button(button) %} {# Buttons with text as labels #} - {% if button.image_alternative %} + {% if button.internal_button %} {# Dropdown Buttons. #} {% if button.is_dropdown %} @@ -41,7 +41,7 @@ {# Normal Buttons. #} {% else %} - {{ button.label }} + {{ button.label }} {% endif %} {# Buttons with image as labels. #} only in patch2: unchanged: --- a/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php +++ b/core/modules/ckeditor/src/CKEditorPluginButtonsInterface.php @@ -45,10 +45,9 @@ * - image: An image for the button to be used in the toolbar. * - image_rtl: If the image needs to have a right-to-left version, specify * an alternative file that will be used in RTL editors. - * - image_alternative: If this button does not render as an image, specify - * an HTML string representing the contents of this button. - * - image_alternative_rtl: Similar to image_alternative, but a - * right-to-left version. + * - internal_button: Identifier of internal button. + * - image_internal_has_rtl: Flag indicating whether there's RTL version + * available. * - attributes: An array of HTML attributes which should be added to this * button when rendering the button in the administrative section for * assembling the toolbar.