@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // can't do much about it. |
51 | 51 | $selected_entities = $form_state->get(['entity_browser', 'selected_entities']); |
52 | 52 | if (!empty($selected_entities)) { |
53 | - $ids = array_map(function (EntityInterface $item) { |
|
53 | + $ids = array_map(function(EntityInterface $item) { |
|
54 | 54 | return $item->id(); |
55 | 55 | }, $selected_entities); |
56 | 56 | $storage['selection_display_view']->setArguments([implode(',', $ids)]); |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | $views = Views::getAllViews(); |
87 | 87 | foreach ($views as $view_id => $view) { |
88 | 88 | foreach ($view->get('display') as $display_id => $display) { |
89 | - $options[$view_id . '.' . $display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title'])); |
|
89 | + $options[$view_id.'.'.$display_id] = $this->t('@view : @display', array('@view' => $view->label(), '@display' => $display['display_title'])); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
93 | 93 | $form['view'] = [ |
94 | 94 | '#type' => 'select', |
95 | 95 | '#title' => $this->t('View : View display'), |
96 | - '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'], |
|
96 | + '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'], |
|
97 | 97 | '#options' => $options, |
98 | 98 | '#required' => TRUE, |
99 | 99 | '#description' => $this->t('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).'), |
@@ -453,8 +453,7 @@ discard block |
||
453 | 453 | // and use this information to return correct part of the form. |
454 | 454 | if (!empty($trigger['#ajax']['event']) && $trigger['#ajax']['event'] == 'entity_browser_value_updated') { |
455 | 455 | $parents = array_slice($trigger['#array_parents'], 0, -1); |
456 | - } |
|
457 | - elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
456 | + } elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
458 | 457 | $parents = array_slice($trigger['#array_parents'], 0, -static::$deleteDepth); |
459 | 458 | } |
460 | 459 | |
@@ -621,12 +620,10 @@ discard block |
||
621 | 620 | $entity_browser_id = $this->getSetting('entity_browser'); |
622 | 621 | if (empty($entity_browser_id)) { |
623 | 622 | return [$this->t('No entity browser selected.')]; |
624 | - } |
|
625 | - else { |
|
623 | + } else { |
|
626 | 624 | if ($browser = $this->entityTypeManager->getStorage('entity_browser')->load($entity_browser_id)) { |
627 | 625 | $summary[] = $this->t('Entity browser: @browser', ['@browser' => $browser->label()]); |
628 | - } |
|
629 | - else { |
|
626 | + } else { |
|
630 | 627 | drupal_set_message($this->t('Missing entity browser!'), 'error'); |
631 | 628 | return [$this->t('Missing entity browser!')]; |
632 | 629 | } |
@@ -636,8 +633,7 @@ discard block |
||
636 | 633 | $selection_mode_options = EntityBrowserElement::getSelectionModeOptions(); |
637 | 634 | if (isset($selection_mode_options[$selection_mode])) { |
638 | 635 | $summary[] = $this->t('Selection mode: @selection_mode', ['@selection_mode' => $selection_mode_options[$selection_mode]]); |
639 | - } |
|
640 | - else { |
|
636 | + } else { |
|
641 | 637 | $summary[] = $this->t('Undefined selection mode.'); |
642 | 638 | } |
643 | 639 |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | - $id = Html::getUniqueId('field-' . $this->fieldDefinition->getName() . '-display-settings-wrapper'); |
|
161 | + $id = Html::getUniqueId('field-'.$this->fieldDefinition->getName().'-display-settings-wrapper'); |
|
162 | 162 | $element['field_widget_display'] = [ |
163 | 163 | '#title' => $this->t('Entity display plugin'), |
164 | 164 | '#type' => 'select', |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | '#type' => 'fieldset', |
209 | 209 | '#title' => $this->t('Entity display plugin configuration'), |
210 | 210 | '#tree' => TRUE, |
211 | - '#prefix' => '<div id="' . $id . '">', |
|
211 | + '#prefix' => '<div id="'.$id.'">', |
|
212 | 212 | '#suffix' => '</div>', |
213 | 213 | ]; |
214 | 214 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * A key for form state storage. |
292 | 292 | */ |
293 | 293 | protected function getFormStateKey(FieldItemListInterface $items) { |
294 | - return $items->getEntity()->uuid() . ':' . $items->getFieldDefinition()->getName(); |
|
294 | + return $items->getEntity()->uuid().':'.$items->getFieldDefinition()->getName(); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | // Get correct ordered list of entity IDs. |
305 | 305 | $ids = array_map( |
306 | - function (EntityInterface $entity) { |
|
306 | + function(EntityInterface $entity) { |
|
307 | 307 | return $entity->id(); |
308 | 308 | }, |
309 | 309 | $entities |
@@ -317,8 +317,8 @@ discard block |
||
317 | 317 | // might result in unpredictable results. |
318 | 318 | $form_state->set(['entity_browser_widget', $this->getFormStateKey($items)], $ids); |
319 | 319 | |
320 | - $hidden_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName() . '-target-id'); |
|
321 | - $details_id = Html::getUniqueId('edit-' . $this->fieldDefinition->getName()); |
|
320 | + $hidden_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName().'-target-id'); |
|
321 | + $details_id = Html::getUniqueId('edit-'.$this->fieldDefinition->getName()); |
|
322 | 322 | |
323 | 323 | $element += [ |
324 | 324 | '#id' => $details_id, |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | // We need to repeat ID here as it is otherwise skipped when rendering. |
334 | 334 | '#attributes' => ['id' => $hidden_id], |
335 | 335 | '#default_value' => implode(' ', array_map( |
336 | - function (EntityInterface $item) { |
|
337 | - return $item->getEntityTypeId() . ':' . $item->id(); |
|
336 | + function(EntityInterface $item) { |
|
337 | + return $item->getEntityTypeId().':'.$item->id(); |
|
338 | 338 | }, |
339 | 339 | $entities |
340 | 340 | )), |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public static function processEntityBrowser(&$element, FormStateInterface $form_state, &$complete_form) { |
385 | 385 | $uuid = key($element['#attached']['drupalSettings']['entity_browser']); |
386 | - $element['#attached']['drupalSettings']['entity_browser'][$uuid]['selector'] = '#' . $element['#custom_hidden_id']; |
|
386 | + $element['#attached']['drupalSettings']['entity_browser'][$uuid]['selector'] = '#'.$element['#custom_hidden_id']; |
|
387 | 387 | return $element; |
388 | 388 | } |
389 | 389 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | '#theme_wrappers' => ['container'], |
489 | 489 | '#attributes' => ['class' => ['entities-list']], |
490 | 490 | 'items' => array_map( |
491 | - function (ContentEntityInterface $entity, $row_id) use ($field_widget_display, $details_id, $field_parents) { |
|
491 | + function(ContentEntityInterface $entity, $row_id) use ($field_widget_display, $details_id, $field_parents) { |
|
492 | 492 | $display = $field_widget_display->view($entity); |
493 | 493 | $edit_button_access = $this->getSetting('field_widget_edit'); |
494 | 494 | if ($entity->getEntityTypeId() == 'file') { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | '#theme_wrappers' => ['container'], |
505 | 505 | '#attributes' => [ |
506 | 506 | 'class' => ['item-container', Html::getClass($field_widget_display->getPluginId())], |
507 | - 'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(), |
|
507 | + 'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(), |
|
508 | 508 | 'data-row-id' => $row_id, |
509 | 509 | ], |
510 | 510 | 'display' => $display, |
@@ -516,10 +516,10 @@ discard block |
||
516 | 516 | 'wrapper' => $details_id, |
517 | 517 | ], |
518 | 518 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
519 | - '#name' => $this->fieldDefinition->getName() . '_remove_' . $entity->id() . '_' . $row_id . '_' . md5(json_encode($field_parents)), |
|
519 | + '#name' => $this->fieldDefinition->getName().'_remove_'.$entity->id().'_'.$row_id.'_'.md5(json_encode($field_parents)), |
|
520 | 520 | '#limit_validation_errors' => [array_merge($field_parents, [$this->fieldDefinition->getName()])], |
521 | 521 | '#attributes' => [ |
522 | - 'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(), |
|
522 | + 'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(), |
|
523 | 523 | 'data-row-id' => $row_id, |
524 | 524 | ], |
525 | 525 | '#access' => (bool) $this->getSetting('field_widget_remove'), |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | } |
658 | 658 | // Submit was triggered by one of the "Remove" buttons. We need to walk |
659 | 659 | // few levels up to read value of "target_id" element. |
660 | - elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName() . '_remove_') === 0) { |
|
660 | + elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], $this->fieldDefinition->getName().'_remove_') === 0) { |
|
661 | 661 | $parents = array_merge(array_slice($trigger['#parents'], 0, -static::$deleteDepth), ['target_id']); |
662 | 662 | } |
663 | 663 | |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | // If an entity browser is being used in this widget, add it as a config |
715 | 715 | // dependency. |
716 | 716 | if ($browser_name = $this->getSetting('entity_browser')) { |
717 | - $dependencies['config'][] = 'entity_browser.browser.' . $browser_name; |
|
717 | + $dependencies['config'][] = 'entity_browser.browser.'.$browser_name; |
|
718 | 718 | } |
719 | 719 | |
720 | 720 | return $dependencies; |
@@ -175,8 +175,7 @@ discard block |
||
175 | 175 | // their styles in code. |
176 | 176 | elseif ($this->fieldDefinition->getType() == 'image' && $image_style = ImageStyle::load($image_style_setting)) { |
177 | 177 | $preview_image_style = $this->t('Preview image style: @style', ['@style' => $image_style->label()]); |
178 | - } |
|
179 | - else { |
|
178 | + } else { |
|
180 | 179 | $preview_image_style = $this->t('No preview image'); |
181 | 180 | } |
182 | 181 | array_unshift($summary, $preview_image_style); |
@@ -260,8 +259,7 @@ discard block |
||
260 | 259 | if ($field_type == 'file') { |
261 | 260 | $description = $item->description; |
262 | 261 | $display_field = $item->display; |
263 | - } |
|
264 | - elseif ($field_type == 'image') { |
|
262 | + } elseif ($field_type == 'image') { |
|
265 | 263 | $alt = $item->alt; |
266 | 264 | $title = $item->title; |
267 | 265 | $width = $item->width; |
@@ -455,8 +453,7 @@ discard block |
||
455 | 453 | $extensions = isset($settings['file_extensions']) ? $settings['file_extensions'] : implode(' ', $supported_extensions); |
456 | 454 | $extensions = array_intersect(explode(' ', $extensions), $supported_extensions); |
457 | 455 | $validators['file_validate_extensions'] = [implode(' ', $extensions)]; |
458 | - } |
|
459 | - elseif (!empty($settings['file_extensions'])) { |
|
456 | + } elseif (!empty($settings['file_extensions'])) { |
|
460 | 457 | $validators['file_validate_extensions'] = [$settings['file_extensions']]; |
461 | 458 | } |
462 | 459 |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | $delta = 0; |
218 | 218 | |
219 | - $order_class = $field_machine_name . '-delta-order'; |
|
219 | + $order_class = $field_machine_name.'-delta-order'; |
|
220 | 220 | |
221 | 221 | $current = [ |
222 | 222 | '#type' => 'table', |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $current[$entity_id] = [ |
284 | 284 | '#attributes' => [ |
285 | 285 | 'class' => ['draggable'], |
286 | - 'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity_id, |
|
286 | + 'data-entity-id' => $entity->getEntityTypeId().':'.$entity_id, |
|
287 | 287 | 'data-row-id' => $delta, |
288 | 288 | ], |
289 | 289 | ]; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | 'options' => ['query' => ['details_id' => $details_id]], |
356 | 356 | ], |
357 | 357 | '#attributes' => [ |
358 | - 'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(), |
|
358 | + 'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(), |
|
359 | 359 | 'data-row-id' => $delta, |
360 | 360 | ], |
361 | 361 | '#access' => $can_edit, |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | 'wrapper' => $details_id, |
369 | 369 | ], |
370 | 370 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
371 | - '#name' => $field_machine_name . '_remove_' . $entity_id . '_' . md5(json_encode($field_parents)), |
|
371 | + '#name' => $field_machine_name.'_remove_'.$entity_id.'_'.md5(json_encode($field_parents)), |
|
372 | 372 | '#limit_validation_errors' => [array_merge($field_parents, [$field_machine_name, 'target_id'])], |
373 | 373 | '#attributes' => [ |
374 | - 'data-entity-id' => $entity->getEntityTypeId() . ':' . $entity->id(), |
|
374 | + 'data-entity-id' => $entity->getEntityTypeId().':'.$entity->id(), |
|
375 | 375 | 'data-row-id' => $delta, |
376 | 376 | ], |
377 | 377 | '#access' => (bool) $widget_settings['field_widget_remove'], |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | } |
430 | 430 | |
431 | 431 | // Return ourself as the structure doesn't match the default. |
432 | - usort($return, function ($a, $b) { |
|
432 | + usort($return, function($a, $b) { |
|
433 | 433 | return SortArray::sortByKeyInt($a, $b, '_weight'); |
434 | 434 | }); |
435 | 435 | |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $data['validators']['file'] = ['validators' => $this->getFileValidators()]; |
490 | 490 | // Provide context for widgets to enhance their configuration. Currently |
491 | 491 | // we only know that "upload_location" is used. |
492 | - $data['widget_context']['upload_location'] = $settings['uri_scheme'] . '://' . $settings['file_directory']; |
|
492 | + $data['widget_context']['upload_location'] = $settings['uri_scheme'].'://'.$settings['file_directory']; |
|
493 | 493 | return $data; |
494 | 494 | } |
495 | 495 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Implements hook_inline_entity_form_reference_form_alter(). |
20 | 20 | */ |
21 | -function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, FormStateInterface &$form_state) { |
|
21 | +function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, FormStateInterface&$form_state) { |
|
22 | 22 | /** @var \Drupal\field\FieldConfigInterface $instance */ |
23 | 23 | $instance = $form_state->get([ |
24 | 24 | 'inline_entity_form', |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | ]); |
28 | 28 | |
29 | 29 | /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ |
30 | - $entity_form_id = $instance->getTargetEntityTypeId() . '.' . $instance->getTargetBundle() . '.default'; |
|
30 | + $entity_form_id = $instance->getTargetEntityTypeId().'.'.$instance->getTargetBundle().'.default'; |
|
31 | 31 | // TODO - 'default' might become configurable or something else in the future. |
32 | 32 | // See https://www.drupal.org/node/2510274 |
33 | 33 | $form_display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load($entity_form_id); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | ])); |
48 | 48 | |
49 | 49 | $cardinality = FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED; |
50 | - if($instance->getFieldStorageDefinition()->get('cardinality') !== $cardinality) { |
|
50 | + if ($instance->getFieldStorageDefinition()->get('cardinality') !== $cardinality) { |
|
51 | 51 | $cardinality = $instance->getFieldStorageDefinition()->get('cardinality') - $count_existing_selection; |
52 | 52 | } |
53 | 53 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $ief_id = $reference_form['#ief_id']; |
120 | 120 | $form_values = NestedArray::getValue($form_state->getValues(), $reference_form['#parents']); |
121 | 121 | $attach_entities = EntityBrowserElement::processEntityIds($form_values['entity_browser']['entity_ids']); |
122 | - $entities =& $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
122 | + $entities = & $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
123 | 123 | |
124 | 124 | // Determine the correct weight of the new element. |
125 | 125 | $weight = 0; |
@@ -165,8 +165,7 @@ |
||
165 | 165 | '#empty_value' => '_none', |
166 | 166 | '#default_value' => $plugin->getThirdPartySetting('entity_browser_entity_form', 'entity_browser_id'), |
167 | 167 | ]; |
168 | - } |
|
169 | - else { |
|
168 | + } else { |
|
170 | 169 | $element['message'] = [ |
171 | 170 | '#markup' => t('There are no entity browsers available. You can create one <a href="@url">here</a>.', ['@url' => Url::fromRoute('entity.entity_browser.collection')->toString()]), |
172 | 171 | ]; |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | $entity_browser = $cached_values['entity_browser']; |
91 | 91 | |
92 | 92 | if (empty($entity_browser->id())) { |
93 | - $help_text = '<div class="clearfix eb-help-text"><h2>' . $this->t('Entity Browser creation instructions') . '</h2>'; |
|
94 | - $help_text .= '<p>' . $this->t('This is a multi-step form. In this first step you need to define the main characteristics of the Entity Browser (in other words, which plugins will be used for each functionality). In the following steps of this wizard, each individual plugin can be configured, when necessary.') . '</p>'; |
|
95 | - $help_text .= '<p>' . $this->t('You can find more detailed information about creating and configuring Entity Browsers at the <a href="@guide_href" target="_blank">official documentation</a>.', ['@guide_href' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']) . '</p>'; |
|
93 | + $help_text = '<div class="clearfix eb-help-text"><h2>'.$this->t('Entity Browser creation instructions').'</h2>'; |
|
94 | + $help_text .= '<p>'.$this->t('This is a multi-step form. In this first step you need to define the main characteristics of the Entity Browser (in other words, which plugins will be used for each functionality). In the following steps of this wizard, each individual plugin can be configured, when necessary.').'</p>'; |
|
95 | + $help_text .= '<p>'.$this->t('You can find more detailed information about creating and configuring Entity Browsers at the <a href="@guide_href" target="_blank">official documentation</a>.', ['@guide_href' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']).'</p>'; |
|
96 | 96 | $help_text .= '</div>'; |
97 | 97 | $form['help_text'] = [ |
98 | 98 | '#markup' => $help_text, |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | $displays = []; |
103 | - $display_description = $this->t('Choose here how the browser(s) should be presented to the end user. The available plugins are:') . '<ul>'; |
|
103 | + $display_description = $this->t('Choose here how the browser(s) should be presented to the end user. The available plugins are:').'<ul>'; |
|
104 | 104 | foreach ($this->displayManager->getDefinitions() as $plugin_id => $plugin_definition) { |
105 | 105 | $displays[$plugin_id] = $plugin_definition['label']; |
106 | - $display_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>'; |
|
106 | + $display_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>'; |
|
107 | 107 | } |
108 | 108 | $display_description .= '</ul>'; |
109 | 109 | $form['display'] = [ |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | ]; |
117 | 117 | |
118 | 118 | $widget_selectors = []; |
119 | - $widget_description = $this->t('In the last step of the entity browser configuration you can decide how the widgets will be available to the editor. The available plugins are:') . '<ul>'; |
|
119 | + $widget_description = $this->t('In the last step of the entity browser configuration you can decide how the widgets will be available to the editor. The available plugins are:').'<ul>'; |
|
120 | 120 | foreach ($this->widgetSelectorManager->getDefinitions() as $plugin_id => $plugin_definition) { |
121 | 121 | $widget_selectors[$plugin_id] = $plugin_definition['label']; |
122 | - $widget_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>'; |
|
122 | + $widget_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>'; |
|
123 | 123 | } |
124 | 124 | $widget_description .= '</ul>'; |
125 | 125 | $form['widget_selector'] = [ |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | ]; |
133 | 133 | |
134 | 134 | $selection_display = []; |
135 | - $selection_description = $this->t('You can optionally allow a "work-in-progress selection zone" to be available to the editor, while still navigating, browsing and selecting the entities. The available plugins are:') . '<ul>'; |
|
135 | + $selection_description = $this->t('You can optionally allow a "work-in-progress selection zone" to be available to the editor, while still navigating, browsing and selecting the entities. The available plugins are:').'<ul>'; |
|
136 | 136 | foreach ($this->selectionDisplayManager->getDefinitions() as $plugin_id => $plugin_definition) { |
137 | 137 | $selection_display[$plugin_id] = $plugin_definition['label']; |
138 | - $selection_description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>'; |
|
138 | + $selection_description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>'; |
|
139 | 139 | } |
140 | 140 | $selection_description .= '</ul>'; |
141 | 141 | $form['selection_display'] = [ |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | $entity_browser = $form_state->getTemporaryValue('wizard')['entity_browser']; |
54 | 54 | |
55 | 55 | $widgets = []; |
56 | - $description = $this->t('The available plugins are:') . '<ul>'; |
|
56 | + $description = $this->t('The available plugins are:').'<ul>'; |
|
57 | 57 | foreach ($this->widgetManager->getDefinitions() as $plugin_id => $plugin_definition) { |
58 | 58 | $widgets[$plugin_id] = $plugin_definition['label']; |
59 | - $description .= '<li><b>' . $plugin_definition['label'] . ':</b> ' . $plugin_definition['description'] . '</li>'; |
|
59 | + $description .= '<li><b>'.$plugin_definition['label'].':</b> '.$plugin_definition['description'].'</li>'; |
|
60 | 60 | } |
61 | 61 | $description .= '</ul>'; |
62 | 62 | $default_widgets = []; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $form['widget'] = [ |
68 | 68 | '#type' => 'select', |
69 | 69 | '#title' => $this->t('Add widget plugin'), |
70 | - '#options' => ['_none_' => '- ' . $this->t('Select a widget to add it') . ' -'] + $widgets, |
|
70 | + '#options' => ['_none_' => '- '.$this->t('Select a widget to add it').' -'] + $widgets, |
|
71 | 71 | '#description' => $description, |
72 | 72 | '#ajax' => [ |
73 | 73 | 'callback' => [get_class($this), 'tableUpdatedAjaxCallback'], |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $row['remove'] = [ |
122 | 122 | '#type' => 'submit', |
123 | 123 | '#value' => $this->t('Delete'), |
124 | - '#name' => 'remove' . $uuid, |
|
124 | + '#name' => 'remove'.$uuid, |
|
125 | 125 | '#ajax' => [ |
126 | 126 | 'callback' => [get_class($this), 'tableUpdatedAjaxCallback'], |
127 | 127 | 'wrapper' => 'widgets', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'entity_browser' => [ |
158 | 158 | 'iframe' => [ |
159 | 159 | $this->getUuid() => [ |
160 | - 'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
160 | + 'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
161 | 161 | ->toString(), |
162 | 162 | 'width' => $this->configuration['width'], |
163 | 163 | 'height' => $this->configuration['height'], |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | public function propagateSelection(FilterResponseEvent $event) { |
186 | 186 | $render = [ |
187 | 187 | 'labels' => [ |
188 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) { |
|
188 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) { |
|
189 | 189 | return $item->label(); |
190 | 190 | }, $this->entities)), |
191 | 191 | '#attached' => [ |
192 | - 'library' => ['entity_browser/'. $this->pluginDefinition['id'] . '_selection'], |
|
192 | + 'library' => ['entity_browser/'.$this->pluginDefinition['id'].'_selection'], |
|
193 | 193 | 'drupalSettings' => [ |
194 | 194 | 'entity_browser' => [ |
195 | 195 | $this->pluginDefinition['id'] => [ |
196 | - 'entities' => array_map(function (EntityInterface $item) { |
|
196 | + 'entities' => array_map(function(EntityInterface $item) { |
|
197 | 197 | return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; |
198 | 198 | }, $this->entities), |
199 | 199 | 'uuid' => $this->request->query->get('uuid'), |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * {@inheritdoc} |
212 | 212 | */ |
213 | 213 | public function path() { |
214 | - return '/entity-browser/' . $this->pluginDefinition['id'] . '/' . $this->configuration['entity_browser_id']; |
|
214 | + return '/entity-browser/'.$this->pluginDefinition['id'].'/'.$this->configuration['entity_browser_id']; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -109,7 +109,7 @@ |
||
109 | 109 | */ |
110 | 110 | public function calculateDependencies() { |
111 | 111 | $dependencies = parent::calculateDependencies(); |
112 | - if ($view_mode = $this->entityTypeManager->getStorage('entity_view_mode')->load($this->configuration['entity_type'] . '.' . $this->configuration['view_mode'])) { |
|
112 | + if ($view_mode = $this->entityTypeManager->getStorage('entity_view_mode')->load($this->configuration['entity_type'].'.'.$this->configuration['view_mode'])) { |
|
113 | 113 | $dependencies[$view_mode->getConfigDependencyKey()][] = $view_mode->getConfigDependencyName(); |
114 | 114 | } |
115 | 115 | return $dependencies; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $display = ['#markup' => $display]; |
114 | 114 | } |
115 | 115 | |
116 | - $form['selected']['items_' . $entity->id() . '_' . $id] = [ |
|
116 | + $form['selected']['items_'.$entity->id().'_'.$id] = [ |
|
117 | 117 | '#theme_wrappers' => ['container'], |
118 | 118 | '#attributes' => [ |
119 | 119 | 'class' => ['item-container'], |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | '#type' => 'submit', |
125 | 125 | '#value' => $this->t('Remove'), |
126 | 126 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
127 | - '#name' => 'remove_' . $entity->id() . '_' . $id, |
|
127 | + '#name' => 'remove_'.$entity->id().'_'.$id, |
|
128 | 128 | '#attributes' => [ |
129 | 129 | 'class' => ['entity-browser-remove-selected-entity'], |
130 | 130 | 'data-row-id' => $id, |
131 | - 'data-remove-entity' => 'items_' . $entity->id(), |
|
131 | + 'data-remove-entity' => 'items_'.$entity->id(), |
|
132 | 132 | ], |
133 | 133 | ], |
134 | 134 | 'weight' => [ |
@@ -290,10 +290,10 @@ discard block |
||
290 | 290 | foreach ($entity_ids as $entity_pair_info) { |
291 | 291 | $last_entity_id = $selected_entities[$selected_entity_keys[$key_index]]->id(); |
292 | 292 | |
293 | - $html = $renderer->render($form['selection_display']['selected']['items_' . $last_entity_id . '_' . $selected_entity_keys[$key_index]]); |
|
293 | + $html = $renderer->render($form['selection_display']['selected']['items_'.$last_entity_id.'_'.$selected_entity_keys[$key_index]]); |
|
294 | 294 | |
295 | 295 | $ajax->addCommand( |
296 | - new ReplaceCommand('div[id="' . $entity_pair_info['proxy_id'] . '"]', static::trimSingleHtmlTag($html)) |
|
296 | + new ReplaceCommand('div[id="'.$entity_pair_info['proxy_id'].'"]', static::trimSingleHtmlTag($html)) |
|
297 | 297 | ); |
298 | 298 | |
299 | 299 | $key_index++; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | // Remove weight of entity being removed. |
368 | 368 | $form_state->unsetValue([ |
369 | 369 | 'selected', |
370 | - $triggering_element['#attributes']['data-remove-entity'] . '_' . $triggering_element['#attributes']['data-row-id'], |
|
370 | + $triggering_element['#attributes']['data-remove-entity'].'_'.$triggering_element['#attributes']['data-row-id'], |
|
371 | 371 | ]); |
372 | 372 | |
373 | 373 | // Remove entity itself. |