Completed
Push — 8.x-1.x ( 620b4e...a65196 )
by Janez
02:43
created
src/Plugin/EntityBrowser/Display/Modal.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     // info.
141 141
     $js_event_object = new RegisterJSCallbacks($this->configuration['entity_browser_id'], $uuid);
142 142
     $js_event_object->registerCallback('Drupal.entityBrowser.selectionCompleted');
143
-    $js_event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $js_event_object );
143
+    $js_event = $this->eventDispatcher->dispatch(Events::REGISTER_JS_CALLBACKS, $js_event_object);
144 144
     $original_path = $this->currentPath->getPath();
145 145
     $data = [
146 146
       'query_parameters' => [
@@ -160,21 +160,21 @@  discard block
 block discarded – undo
160 160
       '#theme_wrappers' => ['container'],
161 161
       'path' => [
162 162
         '#type' => 'hidden',
163
-        '#value' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(),
163
+        '#value' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(),
164 164
       ],
165 165
       'open_modal' => [
166 166
         '#type' => 'submit',
167 167
         '#value' => $this->configuration['link_text'],
168 168
         '#limit_validation_errors' => [],
169 169
         '#submit' => [],
170
-        '#name' => Html::getId('op_' . $this->configuration['entity_browser_id'] . '_' . $uuid),
170
+        '#name' => Html::getId('op_'.$this->configuration['entity_browser_id'].'_'.$uuid),
171 171
         '#ajax' => [
172 172
           'callback' => [$this, 'openModal'],
173 173
           'event' => 'click',
174 174
         ],
175 175
         '#attributes' => $data['attributes'],
176 176
         '#attached' => [
177
-          'library' => ['core/drupal.dialog.ajax',  'entity_browser/modal'],
177
+          'library' => ['core/drupal.dialog.ajax', 'entity_browser/modal'],
178 178
           'drupalSettings' => [
179 179
             'entity_browser' => [
180 180
               'modal' => [
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         'height' => $this->configuration['height'] - 90,
220 220
         'frameborder' => 0,
221 221
         'style' => 'padding:',
222
-        'name' => Html::cleanCssIdentifier('entity-browser-iframe-' . $this->configuration['entity_browser_id'])
222
+        'name' => Html::cleanCssIdentifier('entity-browser-iframe-'.$this->configuration['entity_browser_id'])
223 223
       ],
224 224
     ];
225 225
     $html = drupal_render($content);
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
    *   An array of ajax commands.
296 296
    */
297 297
   public function getAjaxCommands(FormStateInterface $form_state) {
298
-    $entities = array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $form_state->get(['entity_browser', 'selected_entities']));
298
+    $entities = array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $form_state->get(['entity_browser', 'selected_entities']));
299 299
 
300 300
     $commands = array();
301 301
     $commands[] = new SelectEntitiesCommand($this->uuid, $entities);
@@ -315,13 +315,13 @@  discard block
 block discarded – undo
315 315
   public function propagateSelection(FilterResponseEvent $event) {
316 316
     $render = [
317 317
       'labels' => [
318
-        '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) {return $item->label();}, $this->entities)),
318
+        '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) {return $item->label(); }, $this->entities)),
319 319
         '#attached' => [
320 320
           'library' => ['entity_browser/modal_selection'],
321 321
           'drupalSettings' => [
322 322
             'entity_browser' => [
323 323
               'modal' => [
324
-                'entities' => array_map(function (EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()];}, $this->entities),
324
+                'entities' => array_map(function(EntityInterface $item) {return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; }, $this->entities),
325 325
                 'uuid' => $this->request->query->get('uuid'),
326 326
               ],
327 327
             ],
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
    * {@inheritdoc}
338 338
    */
339 339
   public function path() {
340
-    return '/entity-browser/modal/' . $this->configuration['entity_browser_id'];
340
+    return '/entity-browser/modal/'.$this->configuration['entity_browser_id'];
341 341
   }
342 342
 
343 343
   /**
Please login to merge, or discard this patch.
src/Plugin/EntityBrowser/Display/IFrame.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   /**
Please login to merge, or discard this patch.