@@ -178,8 +178,8 @@ |
||
178 | 178 | $this->assertUrl('/admin/config/content/entity_browser/test_entity_browser/selection_display', ['query' => ['js' => 'nojs']]); |
179 | 179 | |
180 | 180 | $this->drupalPostForm(NULL, [], 'Next'); |
181 | - $this->assertFieldById('edit-table-' . $uuid . '-label', 'upload', 'Correct value for widget label found.'); |
|
182 | - $this->assertFieldById('edit-table-' . $uuid . '-form-upload-location', 'public://', 'Correct value for upload location found.'); |
|
181 | + $this->assertFieldById('edit-table-'.$uuid.'-label', 'upload', 'Correct value for widget label found.'); |
|
182 | + $this->assertFieldById('edit-table-'.$uuid.'-form-upload-location', 'public://', 'Correct value for upload location found.'); |
|
183 | 183 | |
184 | 184 | $this->drupalPostForm(NULL, [], 'Finish'); |
185 | 185 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper'); |
|
146 | + $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper'); |
|
147 | 147 | $element['field_widget_display'] = [ |
148 | 148 | '#title' => t('Entity display plugin'), |
149 | 149 | '#type' => 'select', |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | '#type' => 'fieldset', |
178 | 178 | '#title' => t('Entity display plugin configuration'), |
179 | 179 | '#tree' => TRUE, |
180 | - '#prefix' => '<div id="' . $id . '">', |
|
180 | + '#prefix' => '<div id="'.$id.'">', |
|
181 | 181 | '#suffix' => '</div>', |
182 | 182 | ]; |
183 | 183 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * A key for form state storage. |
276 | 276 | */ |
277 | 277 | protected function getFormStateKey(FieldItemListInterface $items) { |
278 | - return $items->getEntity()->uuid() . ':' . $items->getFieldDefinition()->getName(); |
|
278 | + return $items->getEntity()->uuid().':'.$items->getFieldDefinition()->getName(); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | // Submit was triggered by one of the "Remove" buttons. We need to walk |
314 | 314 | // few levels up to read value of "target_id" element. |
315 | - elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) { |
|
315 | + elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) { |
|
316 | 316 | $parents = array_merge(array_slice($trigger['#parents'], 0, -static::$deleteDepth), ['target_id']); |
317 | 317 | } |
318 | 318 | |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | // results. |
350 | 350 | $form_state->set(['entity_browser_widget', $this->getFormStateKey($items)], $ids); |
351 | 351 | |
352 | - $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id'); |
|
353 | - $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName()); |
|
352 | + $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id'); |
|
353 | + $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName()); |
|
354 | 354 | /** @var \Drupal\entity_browser\EntityBrowserInterface $entity_browser */ |
355 | 355 | $entity_browser = $this->entityManager->getStorage('entity_browser')->load($this->getSetting('entity_browser')); |
356 | 356 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $element['#attached']['drupalSettings']['entity_browser'] = [ |
386 | 386 | $entity_browser->getDisplay()->getUuid() => [ |
387 | 387 | 'cardinality' => $this->fieldDefinition->getFieldStorageDefinition()->getCardinality(), |
388 | - 'selector' => '#' . $element['target_id']['#attributes']['id'], |
|
388 | + 'selector' => '#'.$element['target_id']['#attributes']['id'], |
|
389 | 389 | ], |
390 | 390 | ]; |
391 | 391 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | '#theme_wrappers' => ['container'], |
496 | 496 | '#attributes' => ['class' => ['entities-list']], |
497 | 497 | 'items' => array_map( |
498 | - function (ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) { |
|
498 | + function(ContentEntityInterface $entity) use ($field_widget_display, $details_id, $field_parents) { |
|
499 | 499 | $display = $field_widget_display->view($entity); |
500 | 500 | if (is_string($display)) { |
501 | 501 | $display = ['#markup' => $display]; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | 'wrapper' => $details_id, |
516 | 516 | ], |
517 | 517 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
518 | - '#name' => $this->fieldDefinition->getName() . '_remove_' . $entity->id(), |
|
518 | + '#name' => $this->fieldDefinition->getName().'_remove_'.$entity->id(), |
|
519 | 519 | '#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])], |
520 | 520 | '#attributes' => ['data-entity-id' => $entity->id()], |
521 | 521 | '#access' => (bool) $this->getSetting('field_widget_remove'), |
@@ -216,12 +216,10 @@ discard block |
||
216 | 216 | |
217 | 217 | if (empty($entity_browser_id)) { |
218 | 218 | return [t('No entity browser selected.')]; |
219 | - } |
|
220 | - else { |
|
219 | + } else { |
|
221 | 220 | if ($browser = $this->entityManager->getStorage('entity_browser')->load($entity_browser_id)) { |
222 | 221 | $summary[] = t('Entity browser: @browser', ['@browser' => $browser->label()]); |
223 | - } |
|
224 | - else { |
|
222 | + } else { |
|
225 | 223 | drupal_set_message(t('Missing entity browser!'), 'error'); |
226 | 224 | return [t('Missing entity browser!')]; |
227 | 225 | } |
@@ -421,8 +419,7 @@ discard block |
||
421 | 419 | // information to return correct part of the form. |
422 | 420 | if (!empty($trigger['#ajax']['event']) && $trigger['#ajax']['event'] == 'entity_browser_value_updated') { |
423 | 421 | $parents = array_slice($trigger['#array_parents'], 0, -1); |
424 | - } |
|
425 | - elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
422 | + } elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
426 | 423 | $parents = array_slice($trigger['#array_parents'], 0, -static::$deleteDepth); |
427 | 424 | } |
428 | 425 |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $display = ['#markup' => $display]; |
98 | 98 | } |
99 | 99 | |
100 | - $form['selected']['items_' . $entity->id()] = [ |
|
100 | + $form['selected']['items_'.$entity->id()] = [ |
|
101 | 101 | '#theme_wrappers' => ['container'], |
102 | 102 | '#attributes' => [ |
103 | 103 | 'class' => ['item-container'], |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | '#type' => 'submit', |
109 | 109 | '#value' => $this->t('Remove'), |
110 | 110 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
111 | - '#name' => 'remove_' . $entity->id(), |
|
111 | + '#name' => 'remove_'.$entity->id(), |
|
112 | 112 | '#attributes' => [ |
113 | 113 | 'data-row-id' => $id, |
114 | - 'data-remove-entity' => 'items_' . $entity->id(), |
|
114 | + 'data-remove-entity' => 'items_'.$entity->id(), |
|
115 | 115 | ], |
116 | 116 | ], |
117 | 117 | 'weight' => [ |
@@ -84,14 +84,14 @@ |
||
84 | 84 | $views = Views::getAllViews(); |
85 | 85 | foreach ($views as $view_id => $view) { |
86 | 86 | foreach ($view->get('display') as $display_id => $display) { |
87 | - $options[$view_id . '.' . $display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title'])); |
|
87 | + $options[$view_id.'.'.$display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title'])); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | 91 | $form['view'] = [ |
92 | 92 | '#type' => 'select', |
93 | 93 | '#title' => $this->t('View : View display'), |
94 | - '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'], |
|
94 | + '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'], |
|
95 | 95 | '#options' => $options, |
96 | 96 | '#required' => TRUE, |
97 | 97 | '#description' => 'View display to use for displaying currently selected items. Do note that to get something usefull out of this display, its first contextual filter should be a filter on the primary identifier field of your entity type (e.g., Node ID, Media ID).', |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 'entity_browser' => [ |
149 | 149 | 'iframe' => [ |
150 | 150 | $uuid => [ |
151 | - 'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
151 | + 'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
152 | 152 | ->toString(), |
153 | 153 | 'width' => $this->configuration['width'], |
154 | 154 | 'height' => $this->configuration['height'], |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function propagateSelection(FilterResponseEvent $event) { |
183 | 183 | $render = [ |
184 | 184 | 'labels' => [ |
185 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) { |
|
185 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) { |
|
186 | 186 | return $item->label(); |
187 | 187 | }, $this->entities)), |
188 | 188 | '#attached' => [ |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | 'drupalSettings' => [ |
191 | 191 | 'entity_browser' => [ |
192 | 192 | 'iframe' => [ |
193 | - 'entities' => array_map(function (EntityInterface $item) { |
|
193 | + 'entities' => array_map(function(EntityInterface $item) { |
|
194 | 194 | return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; |
195 | 195 | }, $this->entities), |
196 | 196 | 'uuid' => $this->request->query->get('uuid'), |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * {@inheritdoc} |
209 | 209 | */ |
210 | 210 | public function path() { |
211 | - return '/entity-browser/iframe/' . $this->configuration['entity_browser_id']; |
|
211 | + return '/entity-browser/iframe/'.$this->configuration['entity_browser_id']; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |