@@ -279,7 +279,7 @@ |
||
279 | 279 | /** |
280 | 280 | * Helper function to return commands to return in AjaxResponse. |
281 | 281 | * |
282 | - * @return array |
|
282 | + * @return SelectEntitiesCommand[] |
|
283 | 283 | * An array of ajax commands. |
284 | 284 | */ |
285 | 285 | public function getAjaxCommands(FormStateInterface $form_state) { |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | '#theme_wrappers' => ['container'], |
140 | 140 | 'path' => [ |
141 | 141 | '#type' => 'hidden', |
142 | - '#value' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
142 | + '#value' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
143 | 143 | ], |
144 | 144 | 'open_modal' => [ |
145 | 145 | '#type' => 'submit', |
146 | 146 | '#value' => $this->configuration['link_text'], |
147 | 147 | '#limit_validation_errors' => [], |
148 | 148 | '#submit' => [], |
149 | - '#name' => Html::getId('op_' . $this->configuration['entity_browser_id'] . '_' . $uuid), |
|
149 | + '#name' => Html::getId('op_'.$this->configuration['entity_browser_id'].'_'.$uuid), |
|
150 | 150 | '#ajax' => [ |
151 | 151 | 'callback' => [$this, 'openModal'], |
152 | 152 | 'event' => 'click', |
@@ -201,13 +201,13 @@ discard block |
||
201 | 201 | 'height' => $this->configuration['height'] - 90, |
202 | 202 | 'frameborder' => 0, |
203 | 203 | 'style' => 'padding:0', |
204 | - 'name' => 'entity_browser_iframe_' . Html::cleanCssIdentifier($element_name), |
|
204 | + 'name' => 'entity_browser_iframe_'.Html::cleanCssIdentifier($element_name), |
|
205 | 205 | ], |
206 | 206 | ]; |
207 | 207 | $html = drupal_render($content); |
208 | 208 | |
209 | 209 | $response = new AjaxResponse(); |
210 | - $response->addCommand(new OpenDialogCommand('#' . Html::getUniqueId($field_name . '-' . $element_name . '-dialog'), $this->configuration['link_text'], $html, [ |
|
210 | + $response->addCommand(new OpenDialogCommand('#'.Html::getUniqueId($field_name.'-'.$element_name.'-dialog'), $this->configuration['link_text'], $html, [ |
|
211 | 211 | 'width' => 'auto', |
212 | 212 | 'height' => 'auto', |
213 | 213 | 'modal' => TRUE, |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | public function propagateSelection(FilterResponseEvent $event) { |
306 | 306 | $render = [ |
307 | 307 | 'labels' => [ |
308 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) { |
|
308 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) { |
|
309 | 309 | return $item->label(); |
310 | 310 | }, $this->entities)), |
311 | 311 | '#attached' => [ |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | 'drupalSettings' => [ |
314 | 314 | 'entity_browser' => [ |
315 | 315 | 'modal' => [ |
316 | - 'entities' => array_map(function (EntityInterface $item) { |
|
316 | + 'entities' => array_map(function(EntityInterface $item) { |
|
317 | 317 | return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; |
318 | 318 | }, $this->entities), |
319 | 319 | 'uuid' => $this->request->query->get('uuid'), |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * {@inheritdoc} |
332 | 332 | */ |
333 | 333 | public function path() { |
334 | - return '/entity-browser/modal/' . $this->configuration['entity_browser_id']; |
|
334 | + return '/entity-browser/modal/'.$this->configuration['entity_browser_id']; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -336,7 +336,7 @@ |
||
336 | 336 | '_title_callback' => 'Drupal\entity_browser\Controllers\StandalonePage::title', |
337 | 337 | 'entity_browser_id' => $this->id(), |
338 | 338 | ], |
339 | - ['_permission' => 'access ' . $this->id() . ' entity browser pages'], |
|
339 | + ['_permission' => 'access '.$this->id().' entity browser pages'], |
|
340 | 340 | ['_admin_route' => \Drupal::config('node.settings')->get('use_admin_theme')] |
341 | 341 | ); |
342 | 342 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | foreach ($browsers as $browser) { |
65 | 65 | if ($browser->route()) { |
66 | - $permissions['access ' . $browser->id() . ' entity browser pages'] = array( |
|
66 | + $permissions['access '.$browser->id().' entity browser pages'] = array( |
|
67 | 67 | 'title' => $this->translationManager->translate('Access @name pages', array('@name' => $browser->label())), |
68 | 68 | 'description' => $this->translationManager->translate('Access pages that %browser uses to operate.', array('%browser' => $browser->label())), |
69 | 69 | ); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $uploaded_files = $form_state->getValue(['upload'], []); |
54 | 54 | $trigger = $form_state->getTriggeringElement(); |
55 | 55 | // Only validate if we are uploading a file. |
56 | - if (empty($uploaded_files) && $trigger['#value'] == 'Upload') { |
|
56 | + if (empty($uploaded_files) && $trigger['#value'] == 'Upload') { |
|
57 | 57 | $form_state->setError($form['widget']['upload'], t('At least one file should be uploaded.')); |
58 | 58 | } |
59 | 59 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * {@inheritdoc} |
26 | 26 | */ |
27 | - public function getForm(array &$form = array(), FormStateInterface &$form_state = NULL) { |
|
27 | + public function getForm(array &$form = array(), FormStateInterface&$form_state = NULL) { |
|
28 | 28 | // Set a wrapper container for us to replace the form on ajax call. |
29 | 29 | $form['#prefix'] = '<div id="entity-browser-form">'; |
30 | 30 | $form['#suffix'] = '</div>'; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * {@inheritdoc} |
26 | 26 | */ |
27 | - public function getForm(array &$form, FormStateInterface &$form_state) { |
|
27 | + public function getForm(array &$form, FormStateInterface&$form_state) { |
|
28 | 28 | return array(); |
29 | 29 | } |
30 | 30 |
@@ -24,10 +24,10 @@ |
||
24 | 24 | /** |
25 | 25 | * {@inheritdoc} |
26 | 26 | */ |
27 | - public function getForm(array &$form = array(), FormStateInterface &$form_state = NULL) { |
|
27 | + public function getForm(array &$form = array(), FormStateInterface&$form_state = NULL) { |
|
28 | 28 | $element = []; |
29 | 29 | foreach ($this->widget_ids as $id => $label) { |
30 | - $name = 'tab_selector_' . $id; |
|
30 | + $name = 'tab_selector_'.$id; |
|
31 | 31 | $element[$name] = array( |
32 | 32 | '#type' => 'button', |
33 | 33 | '#attributes' => ['class' => ['tab']], |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $form_element_row_id = $row_id; |
91 | 91 | |
92 | 92 | $substitutions[] = [ |
93 | - 'placeholder' => '<!--form-item-entity_browser_select--' . $form_element_row_id . '-->', |
|
93 | + 'placeholder' => '<!--form-item-entity_browser_select--'.$form_element_row_id.'-->', |
|
94 | 94 | 'field_name' => 'entity_browser_select', |
95 | 95 | 'row_id' => $form_element_row_id, |
96 | 96 | ]; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | /** @var $browser \Drupal\entity_browser\EntityBrowserInterface */ |
63 | 63 | $browser = $this->browserStorage->load($id); |
64 | 64 | if ($route = $browser->route()) { |
65 | - $collection->add('entity_browser.' . $browser->id(), $route); |
|
65 | + $collection->add('entity_browser.'.$browser->id(), $route); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |