You are here

ckeditor_uploadimage.module in CKEditor Upload Image 8

Same filename and directory in other branches
  1. 8.2 ckeditor_uploadimage.module

Integrates CKEditor's Upload Image plugin to Drupal.

File

ckeditor_uploadimage.module
View source
<?php

/**
 * @file
 * Integrates CKEditor's Upload Image plugin to Drupal.
 */

/**
 * Implements hook_ckeditor_plugin_info_alter().
 */
function ckeditor_uploadimage_ckeditor_plugin_info_alter(array &$plugins) {
  $moduleHandler = \Drupal::service('module_handler');
  if ($moduleHandler
    ->moduleExists('media')) {
    $mediaImageFields = \Drupal::service('entity_field.manager')
      ->getFieldDefinitions('media', 'image');
    if (isset($mediaImageFields['field_media_image'])) {
      $plugins['drupalimage']['class'] = 'Drupal\\ckeditor_uploadimage\\Form\\CKEditorUploadImageDrupalImage';
    }
  }
}