Skip to content
PlainTextEditor.php 1.11 KiB
Newer Older
 * Contains \Drupal\edit\Plugin\InPlaceEditor\PlainTextEditor.
namespace Drupal\edit\Plugin\InPlaceEditor;
use Drupal\Core\Field\FieldDefinitionInterface;
 * Defines the plain text in-place editor.
class PlainTextEditor extends EditorBase {
   *
   * @todo The processed text logic is too coupled to text fields. Figure out
   *   how to generalize to other textual field types.
   */
  function isCompatible(FieldDefinitionInterface $field_definition, array $items) {
    // This editor is incompatible with multivalued fields.
    if ($field_definition->getCardinality() != 1) {
      return FALSE;
    }
    // This editor is incompatible with processed ("rich") text fields.
    elseif ($field_definition->getSetting('text_processing')) {
   */
  public function getAttachments() {
    return array(
      'library' => array(
        array('edit', 'edit.inPlaceEditor.plainText'),