|
@@ -147,7 +147,7 @@ discard block |
|
|
block discarded – undo |
|
147
|
147
|
} |
|
148
|
148
|
} |
|
149
|
149
|
|
|
150
|
|
- $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper'); |
|
|
150
|
+ $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper'); |
|
151
|
151
|
$element['field_widget_display'] = [ |
|
152
|
152
|
'#title' => t('Entity display plugin'), |
|
153
|
153
|
'#type' => 'select', |
|
@@ -181,7 +181,7 @@ discard block |
|
|
block discarded – undo |
|
181
|
181
|
'#type' => 'fieldset', |
|
182
|
182
|
'#title' => t('Entity display plugin configuration'), |
|
183
|
183
|
'#tree' => TRUE, |
|
184
|
|
- '#prefix' => '<div id="' . $id . '">', |
|
|
184
|
+ '#prefix' => '<div id="'.$id.'">', |
|
185
|
185
|
'#suffix' => '</div>', |
|
186
|
186
|
]; |
|
187
|
187
|
|
|
@@ -268,7 +268,7 @@ discard block |
|
|
block discarded – undo |
|
268
|
268
|
} |
|
269
|
269
|
// Submit was triggered by one of the "Remove" buttons. We need to walk |
|
270
|
270
|
// few levels up to read value of "target_id" element. |
|
271
|
|
- elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) { |
|
|
271
|
+ elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) { |
|
272
|
272
|
$parents = array_merge(array_slice($trigger['#parents'], 0, -static::$deleteDepth), ['target_id']); |
|
273
|
273
|
} |
|
274
|
274
|
|
|
@@ -291,8 +291,8 @@ discard block |
|
|
block discarded – undo |
|
291
|
291
|
} |
|
292
|
292
|
$ids = array_filter($ids); |
|
293
|
293
|
|
|
294
|
|
- $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id'); |
|
295
|
|
- $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName()); |
|
|
294
|
+ $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id'); |
|
|
295
|
+ $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName()); |
|
296
|
296
|
/** @var \Drupal\entity_browser\EntityBrowserInterface $entity_browser */ |
|
297
|
297
|
$entity_browser = $this->entityManager->getStorage('entity_browser')->load($this->getSetting('entity_browser')); |
|
298
|
298
|
|
|
@@ -418,7 +418,7 @@ discard block |
|
|
block discarded – undo |
|
418
|
418
|
'#theme_wrappers' => ['container'], |
|
419
|
419
|
'#attributes' => ['class' => ['entities-list']], |
|
420
|
420
|
'items' => array_map( |
|
421
|
|
- function (ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) { |
|
|
421
|
+ function(ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) { |
|
422
|
422
|
$display = $field_widget_display->view($entity); |
|
423
|
423
|
if (is_string($display)) { |
|
424
|
424
|
$display = ['#markup' => $display]; |
|
@@ -438,7 +438,7 @@ discard block |
|
|
block discarded – undo |
|
438
|
438
|
'wrapper' => $details_id, |
|
439
|
439
|
], |
|
440
|
440
|
'#submit' => [[get_class($this), 'removeItemSubmit']], |
|
441
|
|
- '#name' => $this->fieldDefinition->getName() . '_remove_' . $entity->id(), |
|
|
441
|
+ '#name' => $this->fieldDefinition->getName().'_remove_'.$entity->id(), |
|
442
|
442
|
'#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])], |
|
443
|
443
|
'#attributes' => ['data-entity-id' => $entity->id()], |
|
444
|
444
|
'#access' => (bool) $this->getSetting('field_widget_remove') |