You are here

public function PlainTextEditor::isCompatible in Quick Edit 7

Implements QuickEditInPlaceEditorInterface::isCompatible().

Overrides QuickEditInPlaceEditorInterface::isCompatible

See also

Drupal 8's \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor::isCompatible().

File

InPlaceEditors/plainTextEditor.php, line 22

Class

PlainTextEditor
Defines the plain text in-place editor.

Code

public function isCompatible(array $instance, array $items) {
  $field = field_info_field($instance['field_name']);

  // This editor is incompatible with multivalued fields.
  $cardinality_allows = $field['cardinality'] == 1;

  // This editor is incompatible with processed ("rich") text fields.
  $no_text_processing = empty($instance['settings']['text_processing']);
  return $cardinality_allows && $no_text_processing;
}