public function Internal::getConfig

Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getConfig().

Overrides CKEditorPluginInterface::getConfig

File

drupal/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/Internal.php, line 44
Contains \Drupal\ckeditor\Plugin\CKEditorPlugin\Internal.

Class

Internal
Defines the "internal" plugin (i.e. core plugins part of our CKEditor build).

Namespace

Drupal\ckeditor\Plugin\CKEditorPlugin

Code

public function getConfig(Editor $editor) {

  // Reasonable defaults that provide expected basic behavior.
  $config = array(
    'customConfig' => '',
    // Don't load CKEditor's config.js file.
    'pasteFromWordPromptCleanup' => TRUE,
    'removeDialogTabs' => 'image:Link;image:advanced;link:advanced',
    'resize_dir' => 'vertical',
    'keystrokes' => array(
      // 0x11000 is CKEDITOR.CTRL, see http://docs.ckeditor.com/#!/api/CKEDITOR-property-CTRL.
      array(
        0x110000 + 75,
        'link',
      ),
      array(
        0x110000 + 76,
        NULL,
      ),
    ),
  );

  // Next, add the format_tags setting, if its button is enabled.
  $toolbar_buttons = array_unique(NestedArray::mergeDeepArray($editor->settings['toolbar']['buttons']));
  if (in_array('Format', $toolbar_buttons)) {
    $config['format_tags'] = $this
      ->generateFormatTagsSetting($editor);
  }
  return $config;
}