Skip to content
UnicornEditor.php 1.33 KiB
Newer Older
 * Contains \Drupal\editor_test\Plugin\Editor\UnicornEditor.
namespace Drupal\editor_test\Plugin\Editor;
use Drupal\editor\Entity\Editor as EditorEntity;
 * Defines a Unicorn-powered text editor for Drupal (for testing purposes).
 *   id = "unicorn",
 *   label = @Translation("Unicorn Editor"),
 *   supports_content_filtering = TRUE,
 *   supports_inline_editing = TRUE,
 *   is_xss_safe = FALSE
   */
  function getDefaultSettings() {
    return array('ponies too' => TRUE);
  }

  /**
  function settingsForm(array $form, FormStateInterface $form_state, EditorEntity $editor) {
    $form['foo'] = array(
      '#title' => t('Foo'),
      '#type' => 'textfield',
      '#default_value' => 'bar',
    );
  function getJSSettings(EditorEntity $editor) {
    $js_settings = array();
    $settings = $editor->getSettings();
    if ($settings['ponies too']) {
      $js_settings['ponyModeEnabled'] = TRUE;
  public function getLibraries(EditorEntity $editor) {