Image.php
Same filename in this branch
Same filename in other branches
- 8.9.x core/modules/media/src/Plugin/media/Source/Image.php
- 8.9.x core/modules/image/src/Plugin/InPlaceEditor/Image.php
- 8.9.x core/lib/Drupal/Core/Image/Image.php
- 8.9.x core/lib/Drupal/Component/Utility/Image.php
- 10 core/modules/media/src/Plugin/media/Source/Image.php
- 10 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php
- 10 core/lib/Drupal/Core/Image/Image.php
- 10 core/lib/Drupal/Component/Utility/Image.php
- 11.x core/modules/media/src/Plugin/media/Source/Image.php
- 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php
- 11.x core/lib/Drupal/Core/Image/Image.php
- 11.x core/lib/Drupal/Component/Utility/Image.php
Namespace
Drupal\quickedit\Plugin\InPlaceEditorFile
-
core/
modules/ quickedit/ src/ Plugin/ InPlaceEditor/ Image.php
View source
<?php
namespace Drupal\quickedit\Plugin\InPlaceEditor;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\quickedit\Plugin\InPlaceEditorBase;
/**
* Defines the image text in-place editor.
*
* @InPlaceEditor(
* id = "image"
* )
*/
class Image extends InPlaceEditorBase {
/**
* {@inheritdoc}
*/
public function isCompatible(FieldItemListInterface $items) {
$field_definition = $items->getFieldDefinition();
// This editor is only compatible with single-value image fields.
return $field_definition->getFieldStorageDefinition()
->getCardinality() === 1 && $field_definition->getType() === 'image';
}
/**
* {@inheritdoc}
*/
public function getAttachments() {
return [
'library' => [
'quickedit/quickedit.inPlaceEditor.image',
],
];
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
Image | Defines the image text in-place editor. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.