Issue #2792077 by thpoul, amit.drupal, shruti1803, Sonal.Sangale, Wim Leers: Replace usage of t() in plugins with $this->t()
parent
aef08f50f3
commit
6a83671d70
|
@ -39,8 +39,8 @@ class DrupalImage extends CKEditorPluginBase implements CKEditorPluginConfigurab
|
||||||
*/
|
*/
|
||||||
public function getConfig(Editor $editor) {
|
public function getConfig(Editor $editor) {
|
||||||
return array(
|
return array(
|
||||||
'drupalImage_dialogTitleAdd' => t('Insert Image'),
|
'drupalImage_dialogTitleAdd' => $this->t('Insert Image'),
|
||||||
'drupalImage_dialogTitleEdit' => t('Edit Image'),
|
'drupalImage_dialogTitleEdit' => $this->t('Edit Image'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class DrupalImage extends CKEditorPluginBase implements CKEditorPluginConfigurab
|
||||||
public function getButtons() {
|
public function getButtons() {
|
||||||
return array(
|
return array(
|
||||||
'DrupalImage' => array(
|
'DrupalImage' => array(
|
||||||
'label' => t('Image'),
|
'label' => $this->t('Image'),
|
||||||
'image' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupalimage/icons/drupalimage.png',
|
'image' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupalimage/icons/drupalimage.png',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Drupal\ckeditor\Plugin\CKEditorPlugin;
|
namespace Drupal\ckeditor\Plugin\CKEditorPlugin;
|
||||||
|
|
||||||
use Drupal\Component\Plugin\PluginBase;
|
use Drupal\Core\Plugin\PluginBase;
|
||||||
use Drupal\editor\Entity\Editor;
|
use Drupal\editor\Entity\Editor;
|
||||||
use Drupal\ckeditor\CKEditorPluginInterface;
|
use Drupal\ckeditor\CKEditorPluginInterface;
|
||||||
use Drupal\ckeditor\CKEditorPluginContextualInterface;
|
use Drupal\ckeditor\CKEditorPluginContextualInterface;
|
||||||
|
@ -57,7 +57,7 @@ class DrupalImageCaption extends PluginBase implements CKEditorPluginInterface,
|
||||||
return array(
|
return array(
|
||||||
'image2_captionedClass' => 'caption caption-img',
|
'image2_captionedClass' => 'caption caption-img',
|
||||||
'image2_alignClasses' => array('align-left', 'align-center', 'align-right'),
|
'image2_alignClasses' => array('align-left', 'align-center', 'align-right'),
|
||||||
'drupalImageCaption_captionPlaceholderText' => t('Enter caption here'),
|
'drupalImageCaption_captionPlaceholderText' => $this->t('Enter caption here'),
|
||||||
// Only enable those parts of DrupalImageCaption for which the
|
// Only enable those parts of DrupalImageCaption for which the
|
||||||
// corresponding Drupal text filters are enabled.
|
// corresponding Drupal text filters are enabled.
|
||||||
'drupalImageCaption_captionFilterEnabled' => $format->filters('filter_caption')->status,
|
'drupalImageCaption_captionFilterEnabled' => $format->filters('filter_caption')->status,
|
||||||
|
|
|
@ -37,8 +37,8 @@ class DrupalLink extends CKEditorPluginBase {
|
||||||
*/
|
*/
|
||||||
public function getConfig(Editor $editor) {
|
public function getConfig(Editor $editor) {
|
||||||
return array(
|
return array(
|
||||||
'drupalLink_dialogTitleAdd' => t('Add Link'),
|
'drupalLink_dialogTitleAdd' => $this->t('Add Link'),
|
||||||
'drupalLink_dialogTitleEdit' => t('Edit Link'),
|
'drupalLink_dialogTitleEdit' => $this->t('Edit Link'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,11 +49,11 @@ class DrupalLink extends CKEditorPluginBase {
|
||||||
$path = drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink';
|
$path = drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink';
|
||||||
return array(
|
return array(
|
||||||
'DrupalLink' => array(
|
'DrupalLink' => array(
|
||||||
'label' => t('Link'),
|
'label' => $this->t('Link'),
|
||||||
'image' => $path . '/icons/drupallink.png',
|
'image' => $path . '/icons/drupallink.png',
|
||||||
),
|
),
|
||||||
'DrupalUnlink' => array(
|
'DrupalUnlink' => array(
|
||||||
'label' => t('Unlink'),
|
'label' => $this->t('Unlink'),
|
||||||
'image' => $path . '/icons/drupalunlink.png',
|
'image' => $path . '/icons/drupalunlink.png',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -146,183 +146,183 @@ class Internal extends CKEditorPluginBase implements ContainerFactoryPluginInter
|
||||||
return array(
|
return array(
|
||||||
// "basicstyles" plugin.
|
// "basicstyles" plugin.
|
||||||
'Bold' => array(
|
'Bold' => array(
|
||||||
'label' => t('Bold'),
|
'label' => $this->t('Bold'),
|
||||||
'image_alternative' => $button('bold'),
|
'image_alternative' => $button('bold'),
|
||||||
'image_alternative_rtl' => $button('bold', 'rtl'),
|
'image_alternative_rtl' => $button('bold', 'rtl'),
|
||||||
),
|
),
|
||||||
'Italic' => array(
|
'Italic' => array(
|
||||||
'label' => t('Italic'),
|
'label' => $this->t('Italic'),
|
||||||
'image_alternative' => $button('italic'),
|
'image_alternative' => $button('italic'),
|
||||||
'image_alternative_rtl' => $button('italic', 'rtl'),
|
'image_alternative_rtl' => $button('italic', 'rtl'),
|
||||||
),
|
),
|
||||||
'Underline' => array(
|
'Underline' => array(
|
||||||
'label' => t('Underline'),
|
'label' => $this->t('Underline'),
|
||||||
'image_alternative' => $button('underline'),
|
'image_alternative' => $button('underline'),
|
||||||
'image_alternative_rtl' => $button('underline', 'rtl'),
|
'image_alternative_rtl' => $button('underline', 'rtl'),
|
||||||
),
|
),
|
||||||
'Strike' => array(
|
'Strike' => array(
|
||||||
'label' => t('Strike-through'),
|
'label' => $this->t('Strike-through'),
|
||||||
'image_alternative' => $button('strike'),
|
'image_alternative' => $button('strike'),
|
||||||
'image_alternative_rtl' => $button('strike', 'rtl'),
|
'image_alternative_rtl' => $button('strike', 'rtl'),
|
||||||
),
|
),
|
||||||
'Superscript' => array(
|
'Superscript' => array(
|
||||||
'label' => t('Superscript'),
|
'label' => $this->t('Superscript'),
|
||||||
'image_alternative' => $button('super script'),
|
'image_alternative' => $button('super script'),
|
||||||
'image_alternative_rtl' => $button('super script', 'rtl'),
|
'image_alternative_rtl' => $button('super script', 'rtl'),
|
||||||
),
|
),
|
||||||
'Subscript' => array(
|
'Subscript' => array(
|
||||||
'label' => t('Subscript'),
|
'label' => $this->t('Subscript'),
|
||||||
'image_alternative' => $button('sub script'),
|
'image_alternative' => $button('sub script'),
|
||||||
'image_alternative_rtl' => $button('sub script', 'rtl'),
|
'image_alternative_rtl' => $button('sub script', 'rtl'),
|
||||||
),
|
),
|
||||||
// "removeformat" plugin.
|
// "removeformat" plugin.
|
||||||
'RemoveFormat' => array(
|
'RemoveFormat' => array(
|
||||||
'label' => t('Remove format'),
|
'label' => $this->t('Remove format'),
|
||||||
'image_alternative' => $button('remove format'),
|
'image_alternative' => $button('remove format'),
|
||||||
'image_alternative_rtl' => $button('remove format', 'rtl'),
|
'image_alternative_rtl' => $button('remove format', 'rtl'),
|
||||||
),
|
),
|
||||||
// "justify" plugin.
|
// "justify" plugin.
|
||||||
'JustifyLeft' => array(
|
'JustifyLeft' => array(
|
||||||
'label' => t('Align left'),
|
'label' => $this->t('Align left'),
|
||||||
'image_alternative' => $button('justify left'),
|
'image_alternative' => $button('justify left'),
|
||||||
'image_alternative_rtl' => $button('justify left', 'rtl'),
|
'image_alternative_rtl' => $button('justify left', 'rtl'),
|
||||||
),
|
),
|
||||||
'JustifyCenter' => array(
|
'JustifyCenter' => array(
|
||||||
'label' => t('Align center'),
|
'label' => $this->t('Align center'),
|
||||||
'image_alternative' => $button('justify center'),
|
'image_alternative' => $button('justify center'),
|
||||||
'image_alternative_rtl' => $button('justify center', 'rtl'),
|
'image_alternative_rtl' => $button('justify center', 'rtl'),
|
||||||
),
|
),
|
||||||
'JustifyRight' => array(
|
'JustifyRight' => array(
|
||||||
'label' => t('Align right'),
|
'label' => $this->t('Align right'),
|
||||||
'image_alternative' => $button('justify right'),
|
'image_alternative' => $button('justify right'),
|
||||||
'image_alternative_rtl' => $button('justify right', 'rtl'),
|
'image_alternative_rtl' => $button('justify right', 'rtl'),
|
||||||
),
|
),
|
||||||
'JustifyBlock' => array(
|
'JustifyBlock' => array(
|
||||||
'label' => t('Justify'),
|
'label' => $this->t('Justify'),
|
||||||
'image_alternative' => $button('justify block'),
|
'image_alternative' => $button('justify block'),
|
||||||
'image_alternative_rtl' => $button('justify block', 'rtl'),
|
'image_alternative_rtl' => $button('justify block', 'rtl'),
|
||||||
),
|
),
|
||||||
// "list" plugin.
|
// "list" plugin.
|
||||||
'BulletedList' => array(
|
'BulletedList' => array(
|
||||||
'label' => t('Bullet list'),
|
'label' => $this->t('Bullet list'),
|
||||||
'image_alternative' => $button('bulleted list'),
|
'image_alternative' => $button('bulleted list'),
|
||||||
'image_alternative_rtl' => $button('bulleted list', 'rtl'),
|
'image_alternative_rtl' => $button('bulleted list', 'rtl'),
|
||||||
),
|
),
|
||||||
'NumberedList' => array(
|
'NumberedList' => array(
|
||||||
'label' => t('Numbered list'),
|
'label' => $this->t('Numbered list'),
|
||||||
'image_alternative' => $button('numbered list'),
|
'image_alternative' => $button('numbered list'),
|
||||||
'image_alternative_rtl' => $button('numbered list', 'rtl'),
|
'image_alternative_rtl' => $button('numbered list', 'rtl'),
|
||||||
),
|
),
|
||||||
// "indent" plugin.
|
// "indent" plugin.
|
||||||
'Outdent' => array(
|
'Outdent' => array(
|
||||||
'label' => t('Outdent'),
|
'label' => $this->t('Outdent'),
|
||||||
'image_alternative' => $button('outdent'),
|
'image_alternative' => $button('outdent'),
|
||||||
'image_alternative_rtl' => $button('outdent', 'rtl'),
|
'image_alternative_rtl' => $button('outdent', 'rtl'),
|
||||||
),
|
),
|
||||||
'Indent' => array(
|
'Indent' => array(
|
||||||
'label' => t('Indent'),
|
'label' => $this->t('Indent'),
|
||||||
'image_alternative' => $button('indent'),
|
'image_alternative' => $button('indent'),
|
||||||
'image_alternative_rtl' => $button('indent', 'rtl'),
|
'image_alternative_rtl' => $button('indent', 'rtl'),
|
||||||
),
|
),
|
||||||
// "undo" plugin.
|
// "undo" plugin.
|
||||||
'Undo' => array(
|
'Undo' => array(
|
||||||
'label' => t('Undo'),
|
'label' => $this->t('Undo'),
|
||||||
'image_alternative' => $button('undo'),
|
'image_alternative' => $button('undo'),
|
||||||
'image_alternative_rtl' => $button('undo', 'rtl'),
|
'image_alternative_rtl' => $button('undo', 'rtl'),
|
||||||
),
|
),
|
||||||
'Redo' => array(
|
'Redo' => array(
|
||||||
'label' => t('Redo'),
|
'label' => $this->t('Redo'),
|
||||||
'image_alternative' => $button('redo'),
|
'image_alternative' => $button('redo'),
|
||||||
'image_alternative_rtl' => $button('redo', 'rtl'),
|
'image_alternative_rtl' => $button('redo', 'rtl'),
|
||||||
),
|
),
|
||||||
// "blockquote" plugin.
|
// "blockquote" plugin.
|
||||||
'Blockquote' => array(
|
'Blockquote' => array(
|
||||||
'label' => t('Blockquote'),
|
'label' => $this->t('Blockquote'),
|
||||||
'image_alternative' => $button('blockquote'),
|
'image_alternative' => $button('blockquote'),
|
||||||
'image_alternative_rtl' => $button('blockquote', 'rtl'),
|
'image_alternative_rtl' => $button('blockquote', 'rtl'),
|
||||||
),
|
),
|
||||||
// "horizontalrule" plugin
|
// "horizontalrule" plugin
|
||||||
'HorizontalRule' => array(
|
'HorizontalRule' => array(
|
||||||
'label' => t('Horizontal rule'),
|
'label' => $this->t('Horizontal rule'),
|
||||||
'image_alternative' => $button('horizontal rule'),
|
'image_alternative' => $button('horizontal rule'),
|
||||||
'image_alternative_rtl' => $button('horizontal rule', 'rtl'),
|
'image_alternative_rtl' => $button('horizontal rule', 'rtl'),
|
||||||
),
|
),
|
||||||
// "clipboard" plugin.
|
// "clipboard" plugin.
|
||||||
'Cut' => array(
|
'Cut' => array(
|
||||||
'label' => t('Cut'),
|
'label' => $this->t('Cut'),
|
||||||
'image_alternative' => $button('cut'),
|
'image_alternative' => $button('cut'),
|
||||||
'image_alternative_rtl' => $button('cut', 'rtl'),
|
'image_alternative_rtl' => $button('cut', 'rtl'),
|
||||||
),
|
),
|
||||||
'Copy' => array(
|
'Copy' => array(
|
||||||
'label' => t('Copy'),
|
'label' => $this->t('Copy'),
|
||||||
'image_alternative' => $button('copy'),
|
'image_alternative' => $button('copy'),
|
||||||
'image_alternative_rtl' => $button('copy', 'rtl'),
|
'image_alternative_rtl' => $button('copy', 'rtl'),
|
||||||
),
|
),
|
||||||
'Paste' => array(
|
'Paste' => array(
|
||||||
'label' => t('Paste'),
|
'label' => $this->t('Paste'),
|
||||||
'image_alternative' => $button('paste'),
|
'image_alternative' => $button('paste'),
|
||||||
'image_alternative_rtl' => $button('paste', 'rtl'),
|
'image_alternative_rtl' => $button('paste', 'rtl'),
|
||||||
),
|
),
|
||||||
// "pastetext" plugin.
|
// "pastetext" plugin.
|
||||||
'PasteText' => array(
|
'PasteText' => array(
|
||||||
'label' => t('Paste Text'),
|
'label' => $this->t('Paste Text'),
|
||||||
'image_alternative' => $button('paste text'),
|
'image_alternative' => $button('paste text'),
|
||||||
'image_alternative_rtl' => $button('paste text', 'rtl'),
|
'image_alternative_rtl' => $button('paste text', 'rtl'),
|
||||||
),
|
),
|
||||||
// "pastefromword" plugin.
|
// "pastefromword" plugin.
|
||||||
'PasteFromWord' => array(
|
'PasteFromWord' => array(
|
||||||
'label' => t('Paste from Word'),
|
'label' => $this->t('Paste from Word'),
|
||||||
'image_alternative' => $button('paste from word'),
|
'image_alternative' => $button('paste from word'),
|
||||||
'image_alternative_rtl' => $button('paste from word', 'rtl'),
|
'image_alternative_rtl' => $button('paste from word', 'rtl'),
|
||||||
),
|
),
|
||||||
// "specialchar" plugin.
|
// "specialchar" plugin.
|
||||||
'SpecialChar' => array(
|
'SpecialChar' => array(
|
||||||
'label' => t('Character map'),
|
'label' => $this->t('Character map'),
|
||||||
'image_alternative' => $button('special char'),
|
'image_alternative' => $button('special char'),
|
||||||
'image_alternative_rtl' => $button('special char', 'rtl'),
|
'image_alternative_rtl' => $button('special char', 'rtl'),
|
||||||
),
|
),
|
||||||
'Format' => array(
|
'Format' => array(
|
||||||
'label' => t('HTML block format'),
|
'label' => $this->t('HTML block format'),
|
||||||
'image_alternative' => [
|
'image_alternative' => [
|
||||||
'#type' => 'inline_template',
|
'#type' => 'inline_template',
|
||||||
'#template' => '<a href="#" role="button" aria-label="{{ format_text }}"><span class="ckeditor-button-dropdown">{{ format_text }}<span class="ckeditor-button-arrow"></span></span></a>',
|
'#template' => '<a href="#" role="button" aria-label="{{ format_text }}"><span class="ckeditor-button-dropdown">{{ format_text }}<span class="ckeditor-button-arrow"></span></span></a>',
|
||||||
'#context' => [
|
'#context' => [
|
||||||
'format_text' => t('Format'),
|
'format_text' => $this->t('Format'),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// "table" plugin.
|
// "table" plugin.
|
||||||
'Table' => array(
|
'Table' => array(
|
||||||
'label' => t('Table'),
|
'label' => $this->t('Table'),
|
||||||
'image_alternative' => $button('table'),
|
'image_alternative' => $button('table'),
|
||||||
'image_alternative_rtl' => $button('table', 'rtl'),
|
'image_alternative_rtl' => $button('table', 'rtl'),
|
||||||
),
|
),
|
||||||
// "showblocks" plugin.
|
// "showblocks" plugin.
|
||||||
'ShowBlocks' => array(
|
'ShowBlocks' => array(
|
||||||
'label' => t('Show blocks'),
|
'label' => $this->t('Show blocks'),
|
||||||
'image_alternative' => $button('show blocks'),
|
'image_alternative' => $button('show blocks'),
|
||||||
'image_alternative_rtl' => $button('show blocks', 'rtl'),
|
'image_alternative_rtl' => $button('show blocks', 'rtl'),
|
||||||
),
|
),
|
||||||
// "sourcearea" plugin.
|
// "sourcearea" plugin.
|
||||||
'Source' => array(
|
'Source' => array(
|
||||||
'label' => t('Source code'),
|
'label' => $this->t('Source code'),
|
||||||
'image_alternative' => $button('source'),
|
'image_alternative' => $button('source'),
|
||||||
'image_alternative_rtl' => $button('source', 'rtl'),
|
'image_alternative_rtl' => $button('source', 'rtl'),
|
||||||
),
|
),
|
||||||
// "maximize" plugin.
|
// "maximize" plugin.
|
||||||
'Maximize' => array(
|
'Maximize' => array(
|
||||||
'label' => t('Maximize'),
|
'label' => $this->t('Maximize'),
|
||||||
'image_alternative' => $button('maximize'),
|
'image_alternative' => $button('maximize'),
|
||||||
'image_alternative_rtl' => $button('maximize', 'rtl'),
|
'image_alternative_rtl' => $button('maximize', 'rtl'),
|
||||||
),
|
),
|
||||||
// No plugin, separator "button" for toolbar builder UI use only.
|
// No plugin, separator "button" for toolbar builder UI use only.
|
||||||
'-' => array(
|
'-' => array(
|
||||||
'label' => t('Separator'),
|
'label' => $this->t('Separator'),
|
||||||
'image_alternative' => [
|
'image_alternative' => [
|
||||||
'#type' => 'inline_template',
|
'#type' => 'inline_template',
|
||||||
'#template' => '<a href="#" role="button" aria-label="{{ button_separator_text }}" class="ckeditor-separator"></a>',
|
'#template' => '<a href="#" role="button" aria-label="{{ button_separator_text }}" class="ckeditor-separator"></a>',
|
||||||
'#context' => [
|
'#context' => [
|
||||||
'button_separator_text' => t('Button separator'),
|
'button_separator_text' => $this->t('Button separator'),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
|
|
|
@ -52,12 +52,12 @@ class StylesCombo extends CKEditorPluginBase implements CKEditorPluginConfigurab
|
||||||
public function getButtons() {
|
public function getButtons() {
|
||||||
return array(
|
return array(
|
||||||
'Styles' => array(
|
'Styles' => array(
|
||||||
'label' => t('Font style'),
|
'label' => $this->t('Font style'),
|
||||||
'image_alternative' => [
|
'image_alternative' => [
|
||||||
'#type' => 'inline_template',
|
'#type' => 'inline_template',
|
||||||
'#template' => '<a href="#" role="button" aria-label="{{ styles_text }}"><span class="ckeditor-button-dropdown">{{ styles_text }}<span class="ckeditor-button-arrow"></span></span></a>',
|
'#template' => '<a href="#" role="button" aria-label="{{ styles_text }}"><span class="ckeditor-button-dropdown">{{ styles_text }}<span class="ckeditor-button-arrow"></span></span></a>',
|
||||||
'#context' => [
|
'#context' => [
|
||||||
'styles_text' => t('Styles'),
|
'styles_text' => $this->t('Styles'),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -76,11 +76,11 @@ class StylesCombo extends CKEditorPluginBase implements CKEditorPluginConfigurab
|
||||||
}
|
}
|
||||||
|
|
||||||
$form['styles'] = array(
|
$form['styles'] = array(
|
||||||
'#title' => t('Styles'),
|
'#title' => $this->t('Styles'),
|
||||||
'#title_display' => 'invisible',
|
'#title_display' => 'invisible',
|
||||||
'#type' => 'textarea',
|
'#type' => 'textarea',
|
||||||
'#default_value' => $config['styles'],
|
'#default_value' => $config['styles'],
|
||||||
'#description' => t('A list of classes that will be provided in the "Styles" dropdown. Enter one or more classes on each line in the format: element.classA.classB|Label. Example: h1.title|Title. Advanced example: h1.fancy.title|Fancy title.<br />These styles should be available in your theme\'s CSS file.'),
|
'#description' => $this->t('A list of classes that will be provided in the "Styles" dropdown. Enter one or more classes on each line in the format: element.classA.classB|Label. Example: h1.title|Title. Advanced example: h1.fancy.title|Fancy title.<br />These styles should be available in your theme\'s CSS file.'),
|
||||||
'#attached' => array(
|
'#attached' => array(
|
||||||
'library' => array('ckeditor/drupal.ckeditor.stylescombo.admin'),
|
'library' => array('ckeditor/drupal.ckeditor.stylescombo.admin'),
|
||||||
),
|
),
|
||||||
|
@ -98,12 +98,12 @@ class StylesCombo extends CKEditorPluginBase implements CKEditorPluginConfigurab
|
||||||
public function validateStylesValue(array $element, FormStateInterface $form_state) {
|
public function validateStylesValue(array $element, FormStateInterface $form_state) {
|
||||||
$styles_setting = $this->generateStylesSetSetting($element['#value']);
|
$styles_setting = $this->generateStylesSetSetting($element['#value']);
|
||||||
if ($styles_setting === FALSE) {
|
if ($styles_setting === FALSE) {
|
||||||
$form_state->setError($element, t('The provided list of styles is syntactically incorrect.'));
|
$form_state->setError($element, $this->t('The provided list of styles is syntactically incorrect.'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$style_names = array_map(function ($style) { return $style['name']; }, $styles_setting);
|
$style_names = array_map(function ($style) { return $style['name']; }, $styles_setting);
|
||||||
if (count($style_names) !== count(array_unique($style_names))) {
|
if (count($style_names) !== count(array_unique($style_names))) {
|
||||||
$form_state->setError($element, t('Each style must have a unique label.'));
|
$form_state->setError($element, $this->t('Each style must have a unique label.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,23 +108,23 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
|
||||||
// Button groups.
|
// Button groups.
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
'name' => t('Formatting'),
|
'name' => $this->t('Formatting'),
|
||||||
'items' => array('Bold', 'Italic',),
|
'items' => array('Bold', 'Italic',),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => t('Links'),
|
'name' => $this->t('Links'),
|
||||||
'items' => array('DrupalLink', 'DrupalUnlink',),
|
'items' => array('DrupalLink', 'DrupalUnlink',),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => t('Lists'),
|
'name' => $this->t('Lists'),
|
||||||
'items' => array('BulletedList', 'NumberedList',),
|
'items' => array('BulletedList', 'NumberedList',),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => t('Media'),
|
'name' => $this->t('Media'),
|
||||||
'items' => array('Blockquote', 'DrupalImage',),
|
'items' => array('Blockquote', 'DrupalImage',),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => t('Tools'),
|
'name' => $this->t('Tools'),
|
||||||
'items' => array('Source',),
|
'items' => array('Source',),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -160,7 +160,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
|
||||||
|
|
||||||
$form['toolbar']['button_groups'] = array(
|
$form['toolbar']['button_groups'] = array(
|
||||||
'#type' => 'textarea',
|
'#type' => 'textarea',
|
||||||
'#title' => t('Toolbar buttons'),
|
'#title' => $this->t('Toolbar buttons'),
|
||||||
'#default_value' => json_encode($settings['toolbar']['rows']),
|
'#default_value' => json_encode($settings['toolbar']['rows']),
|
||||||
'#attributes' => array('class' => array('ckeditor-toolbar-textarea')),
|
'#attributes' => array('class' => array('ckeditor-toolbar-textarea')),
|
||||||
);
|
);
|
||||||
|
@ -168,7 +168,7 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface {
|
||||||
// CKEditor plugin settings, if any.
|
// CKEditor plugin settings, if any.
|
||||||
$form['plugin_settings'] = array(
|
$form['plugin_settings'] = array(
|
||||||
'#type' => 'vertical_tabs',
|
'#type' => 'vertical_tabs',
|
||||||
'#title' => t('CKEditor plugin settings'),
|
'#title' => $this->t('CKEditor plugin settings'),
|
||||||
'#attributes' => array(
|
'#attributes' => array(
|
||||||
'id' => 'ckeditor-plugin-settings',
|
'id' => 'ckeditor-plugin-settings',
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue