@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | '#tree' => TRUE |
35 | 35 | ]; |
36 | 36 | foreach ($selected_entities as $id => $entity) { |
37 | - $form['selected']['items_'. $entity->id()] = [ |
|
37 | + $form['selected']['items_'.$entity->id()] = [ |
|
38 | 38 | '#theme_wrappers' => ['container'], |
39 | 39 | '#attributes' => [ |
40 | 40 | 'class' => ['selected-item-container'], |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | '#type' => 'submit', |
46 | 46 | '#value' => $this->t('Remove'), |
47 | 47 | '#submit' => [[get_class($this), 'removeItemSubmit']], |
48 | - '#name' => 'remove_' . $entity->id(), |
|
48 | + '#name' => 'remove_'.$entity->id(), |
|
49 | 49 | '#attributes' => [ |
50 | 50 | 'data-row-id' => $id, |
51 | - 'data-remove-entity' => 'items_' . $entity->id(), |
|
51 | + 'data-remove-entity' => 'items_'.$entity->id(), |
|
52 | 52 | ] |
53 | 53 | ], |
54 | 54 | 'weight' => [ |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay; |
4 | 4 | |
5 | -use Drupal\Component\Utility\Html; |
|
6 | 5 | use Drupal\Core\Entity\EntityManagerInterface; |
7 | 6 | use Drupal\Core\Form\FormStateInterface; |
8 | 7 | use Drupal\entity_browser\FieldWidgetDisplayManager; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | /** |
43 | 43 | * Implements hook_form_alter(). |
44 | 44 | */ |
45 | -function entity_browser_form_alter(&$form, FormStateInterface &$form_state) { |
|
45 | +function entity_browser_form_alter(&$form, FormStateInterface&$form_state) { |
|
46 | 46 | $entity_browser_dialog_edit = \Drupal::service('request_stack')->getCurrentRequest()->get('_route'); |
47 | 47 | if ($entity_browser_dialog_edit == 'entity_browser.edit_form') { |
48 | 48 | // Let's allow the save button only. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $definitions = $this->entityManager->getDefinitions(); |
66 | 66 | $entity_types = array_combine( |
67 | 67 | array_keys($definitions), |
68 | - array_map(function (EntityTypeInterface $item) { return $item->getLabel(); }, $definitions) |
|
68 | + array_map(function(EntityTypeInterface $item) { return $item->getLabel(); }, $definitions) |
|
69 | 69 | ); |
70 | 70 | |
71 | 71 | $form['entity_type'] = [ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $bundles = []; |
83 | 83 | if ($entity_type) { |
84 | 84 | $definitions = $this->entityManager->getBundleInfo($entity_type); |
85 | - $bundles = array_map(function ($item) { return $item['label']; }, $definitions); |
|
85 | + $bundles = array_map(function($item) { return $item['label']; }, $definitions); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $form['bundle'] = [ |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'entity_browser' => [ |
170 | 170 | 'iframe' => [ |
171 | 171 | $uuid => [ |
172 | - 'src' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
172 | + 'src' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters']) |
|
173 | 173 | ->toString(), |
174 | 174 | 'width' => $this->configuration['width'], |
175 | 175 | 'height' => $this->configuration['height'], |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | public function propagateSelection(FilterResponseEvent $event) { |
204 | 204 | $render = [ |
205 | 205 | 'labels' => [ |
206 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)), |
|
206 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)), |
|
207 | 207 | '#attached' => [ |
208 | 208 | 'library' => ['entity_browser/iframe_selection'], |
209 | 209 | 'drupalSettings' => [ |
210 | 210 | 'entity_browser' => [ |
211 | 211 | 'iframe' => [ |
212 | - 'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities), |
|
212 | + 'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities), |
|
213 | 213 | 'uuid' => $this->request->query->get('uuid'), |
214 | 214 | ], |
215 | 215 | ], |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * {@inheritdoc} |
243 | 243 | */ |
244 | 244 | public function path() { |
245 | - return '/entity-browser/iframe/' . $this->configuration['entity_browser_id']; |
|
245 | + return '/entity-browser/iframe/'.$this->configuration['entity_browser_id']; |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Implements hook_inline_entity_form_reference_form_alter(). |
9 | 9 | */ |
10 | -function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, \Drupal\Core\Form\FormStateInterface &$form_state) { |
|
10 | +function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, \Drupal\Core\Form\FormStateInterface&$form_state) { |
|
11 | 11 | $entity_manager = \Drupal::entityManager(); |
12 | 12 | \Drupal::service('event_dispatcher') |
13 | 13 | ->addListener( |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $instance = $form_state->get(['inline_entity_form', $reference_form['#ief_id'], 'instance']); |
20 | 20 | |
21 | 21 | /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ |
22 | - $entity_form_id = $instance->getTargetEntityTypeId() . '.' . $instance->getTargetBundle() . '.default'; |
|
22 | + $entity_form_id = $instance->getTargetEntityTypeId().'.'.$instance->getTargetBundle().'.default'; |
|
23 | 23 | // TODO - 'default' might become configurable or something else in the future. |
24 | 24 | // See https://www.drupal.org/node/2510274 |
25 | 25 | $form_display = $entity_manager->getStorage('entity_form_display')->load($entity_form_id); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $form_values = NestedArray::getValue($form_state->getValues(), $reference_form['#parents']); |
117 | 117 | $storage = \Drupal::entityTypeManager()->getStorage($reference_form['#entity_type']); |
118 | 118 | $attach_entities = $storage->loadMultiple(explode(' ', $form_values['entity_id'])); |
119 | - $entities =& $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
119 | + $entities = & $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
120 | 120 | |
121 | 121 | // Determine the correct weight of the new element. |
122 | 122 | $weight = 0; |
@@ -34,9 +34,7 @@ |
||
34 | 34 | * The entity manager. |
35 | 35 | * @param $tempstore_id |
36 | 36 | * The shared temp store factory collection name. |
37 | - * @param null $machine_name |
|
38 | - * The SharedTempStore key for our current wizard values. |
|
39 | - * @param null $step |
|
37 | + * @param string|null $step |
|
40 | 38 | * The current active step of the wizard. |
41 | 39 | */ |
42 | 40 | public function __construct(SharedTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, EntityManagerInterface $entity_manager, RouteMatchInterface $route_match, $tempstore_id, $entity_browser = NULL, $step = 'general') { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $file = File::load(1); |
68 | 68 | // Test entity browser token that has upload location configured to |
69 | 69 | // public://[current-user:account-name]/ |
70 | - $this->assertEqual($file->getFileUri(), 'public://' . $account->getUsername() . '/' . $file->getFilename(), 'Image has the correct uri.'); |
|
70 | + $this->assertEqual($file->getFileUri(), 'public://'.$account->getUsername().'/'.$file->getFilename(), 'Image has the correct uri.'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | } |