annotate core/modules/quickedit/src/EditorSelectorInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\quickedit;
Chris@0 4
Chris@0 5 use Drupal\Core\Field\FieldItemListInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Interface for selecting an in-place editor (an Editor plugin) for a field.
Chris@0 9 */
Chris@0 10 interface EditorSelectorInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Returns the in-place editor (an InPlaceEditor plugin) to use for a field.
Chris@0 14 *
Chris@0 15 * @param string $formatter_type
Chris@0 16 * The field's formatter type name.
Chris@0 17 * @param \Drupal\Core\Field\FieldItemListInterface $items
Chris@0 18 * The field values to be in-place edited.
Chris@0 19 *
Chris@0 20 * @return string|null
Chris@0 21 * The editor to use, or NULL to not enable in-place editing.
Chris@0 22 */
Chris@0 23 public function getEditor($formatter_type, FieldItemListInterface $items);
Chris@0 24
Chris@0 25 /**
Chris@0 26 * Returns the attachments for all editors.
Chris@0 27 *
Chris@0 28 * @param array $editor_ids
Chris@0 29 * A list of all in-place editor IDs that should be attached.
Chris@0 30 *
Chris@0 31 * @return array
Chris@0 32 * An array of attachments, for use with #attached.
Chris@0 33 *
Chris@0 34 * @see \Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()
Chris@0 35 */
Chris@0 36 public function getEditorAttachments(array $editor_ids);
Chris@0 37
Chris@0 38 }