You are here

public function AutoEmbed::getDependencies in CKEditor Media Embed Plugin 8

Returns a list of plugins this plugin requires.

Parameters

\Drupal\editor\Entity\Editor $editor: A configured text editor object.

Return value

array An unindexed array of plugin names this plugin requires. Each plugin is is identified by its annotated ID.

Overrides CKEditorPluginInterface::getDependencies

File

src/Plugin/CKEditorPlugin/AutoEmbed.php, line 27

Class

AutoEmbed
Defines the "Auto Embed" plugin.

Namespace

Drupal\ckeditor_media_embed\Plugin\CKEditorPlugin

Code

public function getDependencies(Editor $editor) {
  $settings = $editor
    ->getSettings();
  $dependencies = [
    'autolink',
    'embedbase',
    'notificationaggregator',
    'notification',
  ];
  if ($this
    ->needsTextMatchDependency()) {
    $dependencies[] = 'textmatch';
  }
  if ($embed_plugin = $settings['plugins']['autoembed']['status']) {
    $dependencies[] = $embed_plugin;
  }
  return $dependencies;
}