3 namespace Drupal\entity_embed\Plugin\CKEditorPlugin;
5 use Drupal\editor\Entity\Editor;
6 use Drupal\embed\EmbedButtonInterface;
7 use Drupal\embed\EmbedCKEditorPluginBase;
10 * Defines the "drupalentity" plugin.
13 * id = "drupalentity",
14 * label = @Translation("Entity"),
15 * embed_type_id = "entity"
18 class DrupalEntity extends EmbedCKEditorPluginBase {
23 protected function getButton(EmbedButtonInterface $embed_button) {
24 $button = parent::getButton($embed_button);
25 $button['entity_type'] = $embed_button->getTypeSetting('entity_type');
32 public function getFile() {
33 return drupal_get_path('module', 'entity_embed') . '/js/plugins/drupalentity/plugin.js';
39 public function getConfig(Editor $editor) {
41 'DrupalEntity_dialogTitleAdd' => t('Insert entity'),
42 'DrupalEntity_dialogTitleEdit' => t('Edit entity'),
43 'DrupalEntity_buttons' => $this->getButtons(),