You are here

DrupalViews.php in Views entity embed 2.0.x

Same filename and directory in other branches
  1. 8 src/Plugin/CKEditorPlugin/DrupalViews.php

File

src/Plugin/CKEditorPlugin/DrupalViews.php
View source
<?php

namespace Drupal\views_entity_embed\Plugin\CKEditorPlugin;

use Drupal\editor\Entity\Editor;
use Drupal\embed\EmbedCKEditorPluginBase;

/**
 * Defines the "drupalViews" plugin.
 *
 * @CKEditorPlugin(
 *   id = "drupalviews",
 *   label = @Translation("Views"),
 *   embed_type_id = "embed_views"
 * )
 */
class DrupalViews extends EmbedCKEditorPluginBase {

  /**
   * {@inheritdoc}
   */
  public function getFile() {
    return drupal_get_path('module', 'views_entity_embed') . '/js/plugins/drupalviews/plugin.js';
  }

  /**
   * {@inheritdoc}
   */
  public function getConfig(Editor $editor) {
    return [
      'DrupalViews_dialogTitleAdd' => t('Insert views'),
      'DrupalViews_dialogTitleEdit' => t('Edit views'),
      'DrupalViews_buttons' => $this
        ->getButtons(),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getLibraries(Editor $editor) {
    return [
      'core/jquery',
      'core/drupal',
      'core/drupal.ajax',
    ];
  }

}

Classes

Namesort descending Description
DrupalViews Defines the "drupalViews" plugin.