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 @@ -63,7 +63,6 @@ $rtl = $language_direction === 'rtl' ? '_rtl' : ''; $build_button_item = function($button, $rtl) { - // Set additional attribute on the button if it can occur multiple times. if (!empty($button['multiple'])) { $button['attributes']['class'][] = 'ckeditor-multiple-button'; @@ -78,8 +77,17 @@ $attributes = array_merge($attributes, $button['attributes']); } + // Check for the image button to be present and convert URI to URL. + if (isset($button['image'])) { + $button['image'] = file_create_url($button['image' . $rtl]); + } // Build the button item. - $button_item = $button + array( + // Clone $button and remove unwanted array keys for HTML rendering. + $button_build = $button; + unset($button_build['group']); + unset($button_build['attributes']); + unset($button_build['multiple']); + $button_item = $button_build + array( 'rtl' => $rtl, 'attributes' => new Attribute($attributes), ); 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 @@ -252,7 +252,8 @@ ), 'Format' => array( 'label' => t('HTML block format'), - 'image_alternative' => '', + 'button_text' => t('Format'), + 'image_alternative' => 'format', ), // "table" plugin. 'Table' => array( @@ -278,7 +279,8 @@ // No plugin, separator "button" for toolbar builder UI use only. '-' => array( 'label' => t('Separator'), - 'image_alternative' => '', + 'image_alternative' => 'separator', + 'button_text' => t('Button separator'), 'attributes' => array( 'class' => array('ckeditor-button-separator'), 'data-drupal-ckeditor-type' => 'separator', 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 @@ -16,14 +16,25 @@ {% macro button(button) %} {# Value of the button item. #} {% if button.image_alternative %} - - + {% if button.image_alternative == 'format' %} + - + + {% elseif button.image_alternative == 'styles' %} + + + + {% elseif button.image_alternative == 'separator' %} + + + {% else %} + + + {% endif %} {% elseif button.image %} + {% else %} @@ -48,7 +59,7 @@
only in patch2: unchanged: --- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php +++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php @@ -59,7 +59,8 @@ public function getButtons() { return array( 'Styles' => array( 'label' => t('Font style'), - 'image_alternative' => ' ', + 'button_text' => t('Styles'), + 'image_alternative' => 'styles', ), ); }