Skip to content
UnicornEditor.php 1.16 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.
 *
 *   id = "unicorn",
 *   label = @Translation("Unicorn Editor"),
   */
  function getDefaultSettings() {
    return array('ponies too' => TRUE);
  }

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

  /**
  public function getLibraries(EditorEntity $editor) {