@@ -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) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | '#theme_wrappers' => ['container'], |
| 144 | 144 | 'path' => [ |
| 145 | 145 | '#type' => 'hidden', |
| 146 | - '#value' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
| 146 | + '#value' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
| 147 | 147 | ], |
| 148 | 148 | 'open_modal' => [ |
| 149 | 149 | '#type' => 'submit', |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $field_name = $triggering_element['#parents'][0]; |
| 198 | 198 | $element_name = $this->configuration['entity_browser_id']; |
| 199 | - $name = 'entity_browser_iframe_' . $element_name; |
|
| 199 | + $name = 'entity_browser_iframe_'.$element_name; |
|
| 200 | 200 | $content = [ |
| 201 | 201 | '#type' => 'html_tag', |
| 202 | 202 | '#tag' => 'iframe', |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $html = drupal_render($content); |
| 215 | 215 | |
| 216 | 216 | $response = new AjaxResponse(); |
| 217 | - $response->addCommand(new OpenDialogCommand('#' . Html::getUniqueId($field_name . '-' . $element_name . '-dialog'), $this->configuration['link_text'], $html, [ |
|
| 217 | + $response->addCommand(new OpenDialogCommand('#'.Html::getUniqueId($field_name.'-'.$element_name.'-dialog'), $this->configuration['link_text'], $html, [ |
|
| 218 | 218 | 'width' => 'auto', |
| 219 | 219 | 'height' => 'auto', |
| 220 | 220 | 'modal' => TRUE, |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | public function propagateSelection(FilterResponseEvent $event) { |
| 305 | 305 | $render = [ |
| 306 | 306 | 'labels' => [ |
| 307 | - '#markup' => 'Labels: ' . implode(', ', array_map(function (EntityInterface $item) { |
|
| 307 | + '#markup' => 'Labels: '.implode(', ', array_map(function(EntityInterface $item) { |
|
| 308 | 308 | return $item->label(); |
| 309 | 309 | }, $this->entities)), |
| 310 | 310 | '#attached' => [ |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | 'drupalSettings' => [ |
| 313 | 313 | 'entity_browser' => [ |
| 314 | 314 | 'modal' => [ |
| 315 | - 'entities' => array_map(function (EntityInterface $item) { |
|
| 315 | + 'entities' => array_map(function(EntityInterface $item) { |
|
| 316 | 316 | return [$item->id(), $item->uuid(), $item->getEntityTypeId()]; |
| 317 | 317 | }, $this->entities), |
| 318 | 318 | 'uuid' => $this->request->query->get('uuid'), |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * {@inheritdoc} |
| 331 | 331 | */ |
| 332 | 332 | public function path() { |
| 333 | - return '/entity-browser/modal/' . $this->configuration['entity_browser_id']; |
|
| 333 | + return '/entity-browser/modal/'.$this->configuration['entity_browser_id']; |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | /** |
@@ -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 | ); |
@@ -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 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * @return array |
| 31 | 31 | * Form structure. |
| 32 | 32 | */ |
| 33 | - public function getForm(array &$form, FormStateInterface &$form_state); |
|
| 33 | + public function getForm(array &$form, FormStateInterface&$form_state); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Sets the default widget. |