class PlainTextEditor in Quick Edit 7
Defines the plain text in-place editor.
Hierarchy
- class \PlainTextEditor implements QuickEditInPlaceEditorInterface
Expanded class hierarchy of PlainTextEditor
2 string references to 'PlainTextEditor'
- hook_quickedit_editor_info in ./
quickedit.api.php - Declares in-place editor plugins provided by a module.
- quickedit_quickedit_editor_info in ./
quickedit.quickedit.inc - Implements hook_quickedit_editor_info().
File
- InPlaceEditors/
plainTextEditor.php, line 15
View source
class PlainTextEditor implements QuickEditInPlaceEditorInterface {
/**
* Implements QuickEditInPlaceEditorInterface::isCompatible().
*
* @see Drupal 8's \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor::isCompatible().
*/
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;
}
/**
* Implements QuickEditInPlaceEditorInterface::getMetadata().
*
* @see Drupal 8's \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor::getMetadata().
*/
public function getMetadata(array $instance, array $items) {
return array();
}
/**
* Implements QuickEditInPlaceEditorInterface::getAttachments().
*
* @see Drupal 8's \Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor::getAttachments().
*/
public function getAttachments() {
return array(
'library' => array(
array(
'quickedit',
'quickedit.inPlaceEditor.plainText',
),
),
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PlainTextEditor:: |
public | function |
Implements QuickEditInPlaceEditorInterface::getAttachments(). Overrides QuickEditInPlaceEditorInterface:: |
|
PlainTextEditor:: |
public | function |
Implements QuickEditInPlaceEditorInterface::getMetadata(). Overrides QuickEditInPlaceEditorInterface:: |
|
PlainTextEditor:: |
public | function |
Implements QuickEditInPlaceEditorInterface::isCompatible(). Overrides QuickEditInPlaceEditorInterface:: |