
| Current Path : /var/www/html/pallets_old/web/core/modules/image/src/Plugin/InPlaceEditor/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/pallets_old/web/core/modules/image/src/Plugin/InPlaceEditor/Image.php |
<?php
namespace Drupal\image\Plugin\InPlaceEditor;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\quickedit\Plugin\InPlaceEditorBase;
/**
* Defines the image text in-place editor.
*
* @InPlaceEditor(
* id = "image"
* )
*
* @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use the
* Drupal\quickedit\Plugin\InPlaceEditor\Image in-place editor instead.
*
* @see https://www.drupal.org/node/3271848
*/
class Image extends InPlaceEditorBase {
/**
* Constructs a Image object.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
@trigger_error('Drupal\image\Plugin\InPlaceEditor\Image is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use Drupal\quickedit\Plugin\InPlaceEditor\Image instead. See https://www.drupal.org/node/3271848', E_USER_DEPRECATED);
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
/**
* {@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' => [
'image/quickedit.inPlaceEditor.image',
],
];
}
}