Same name in other branches
- 8.x-1.x src/Plugin/Field/FieldWidget/ExifWidgetBase.php \Drupal\exif\Plugin\Field\FieldWidget\ExifWidgetBase::settingsSummary()
1 method overrides ExifWidgetBase::settingsSummary()
- ExifFieldWidgetBase::settingsSummary dans src/
Plugin/ Field/ FieldWidget/ ExifFieldWidgetBase.php
Fichier
-
src/
Plugin/ Field/ FieldWidget/ ExifWidgetBase.php, line 146
Classe
- ExifWidgetBase
- Base class for 'Exif Field widget' plugin implementations.
Namespace
Drupal\exif\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$image_field = $this->getSetting('image_field');
if (isset($image_field)) {
$bundle_name = $this->fieldDefinition
->getTargetBundle();
$entity_type = $this->fieldDefinition
->getTargetEntityTypeId();
$image_field_config = \Drupal::getContainer()->get('entity_field.manager')
->getFieldDefinitions($entity_type, $bundle_name)[$image_field];
$label = $image_field;
if ($image_field_config instanceof FieldConfig) {
if ($image_field_config->getType() == "image" || $image_field_config->getType() == "media") {
$label = $this->t("'@image_linked_label' (id: @image_linked_id)", [
'@image_linked_label' => $image_field_config->getLabel(),
'@image_linked_id' => $image_field,
]);
}
}
$image_field_msg = $this->t("exif will be extracted from image field @image", [
'@image' => $label,
]);
}
else {
$image_field_msg = $this->t('No image chosen. field will stay empty.');
}
array_unshift($summary, $image_field_msg);
return $summary;
}