class Image

Same name in this branch
  1. 9 core/modules/media/src/Plugin/media/Source/Image.php \Drupal\media\Plugin\media\Source\Image
  2. 9 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image
  3. 9 core/modules/quickedit/src/Plugin/InPlaceEditor/Image.php \Drupal\quickedit\Plugin\InPlaceEditor\Image
  4. 9 core/lib/Drupal/Core/Image/Image.php \Drupal\Core\Image\Image
  5. 9 core/lib/Drupal/Component/Utility/Image.php \Drupal\Component\Utility\Image
Same name and namespace in other branches
  1. 8.9.x core/modules/media/src/Plugin/media/Source/Image.php \Drupal\media\Plugin\media\Source\Image
  2. 8.9.x core/modules/image/src/Plugin/InPlaceEditor/Image.php \Drupal\image\Plugin\InPlaceEditor\Image
  3. 8.9.x core/lib/Drupal/Core/Image/Image.php \Drupal\Core\Image\Image
  4. 8.9.x core/lib/Drupal/Component/Utility/Image.php \Drupal\Component\Utility\Image
  5. 10 core/modules/media/src/Plugin/media/Source/Image.php \Drupal\media\Plugin\media\Source\Image
  6. 10 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image
  7. 10 core/lib/Drupal/Core/Image/Image.php \Drupal\Core\Image\Image
  8. 10 core/lib/Drupal/Component/Utility/Image.php \Drupal\Component\Utility\Image
  9. 11.x core/modules/media/src/Plugin/media/Source/Image.php \Drupal\media\Plugin\media\Source\Image
  10. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image
  11. 11.x core/lib/Drupal/Core/Image/Image.php \Drupal\Core\Image\Image
  12. 11.x core/lib/Drupal/Component/Utility/Image.php \Drupal\Component\Utility\Image

Defines the image text in-place editor.

Plugin annotation


@InPlaceEditor(
  id = "image"
)

Hierarchy

Expanded class hierarchy of 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 also

https://www.drupal.org/node/3271848

298 string references to 'Image'
aggregator_entity_extra_field_info in core/modules/aggregator/aggregator.module
Implements hook_entity_extra_field_info().
AjaxFileManagedMultipleTest::testMultipleFilesUpload in core/modules/file/tests/src/FunctionalJavascript/AjaxFileManagedMultipleTest.php
Tests if managed file form element works well with multiple files upload.
ckeditor5.ckeditor5.yml in core/modules/ckeditor5/ckeditor5.ckeditor5.yml
core/modules/ckeditor5/ckeditor5.ckeditor5.yml
CKEditor5AllowedTagsTest::testImgAddedViaUploadPlugin in core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php
Tests that the img tag is added after enabling image uploads.
CKEditor5Test::testActiveTabsMaintained in core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
Confirms active tab status is intact after AJAX refresh.

... See full list

File

core/modules/image/src/Plugin/InPlaceEditor/Image.php, line 20

Namespace

Drupal\image\Plugin\InPlaceEditor
View source
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',
            ],
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Image::getAttachments public function Returns the attachments for this editor. Overrides InPlaceEditorInterface::getAttachments
Image::isCompatible public function Checks whether this in-place editor is compatible with a given field. Overrides InPlaceEditorInterface::isCompatible
Image::__construct public function Constructs a Image object.
InPlaceEditorBase::getMetadata public function Generates metadata that is needed specifically for this editor. Overrides InPlaceEditorInterface::getMetadata 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.