@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function getFirstWidget() { |
| 305 | 305 | $instance_ids = $this->getWidgets()->getInstanceIds(); |
| 306 | - $instance_ids = array_filter($instance_ids, function ($id) { |
|
| 306 | + $instance_ids = array_filter($instance_ids, function($id) { |
|
| 307 | 307 | return $this->getWidget($id)->access()->isAllowed(); |
| 308 | 308 | }); |
| 309 | 309 | |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | '_title_callback' => 'Drupal\entity_browser\Controllers\EntityBrowserFormController::title', |
| 394 | 394 | 'entity_browser_id' => $this->id(), |
| 395 | 395 | ], |
| 396 | - ['_permission' => 'access ' . $this->id() . ' entity browser pages'], |
|
| 396 | + ['_permission' => 'access '.$this->id().' entity browser pages'], |
|
| 397 | 397 | ['_admin_route' => \Drupal::config('node.settings')->get('use_admin_theme')] |
| 398 | 398 | ); |
| 399 | 399 | } |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * {@inheritdoc} |
| 21 | 21 | */ |
| 22 | - public function getForm(array &$form = [], FormStateInterface &$form_state = NULL) { |
|
| 22 | + public function getForm(array &$form = [], FormStateInterface&$form_state = NULL) { |
|
| 23 | 23 | $element = []; |
| 24 | 24 | /** @var \Drupal\entity_browser\EntityBrowserInterface $browser */ |
| 25 | 25 | $browser = $form_state->getFormObject()->getEntityBrowser(); |
| 26 | 26 | foreach ($this->widget_ids as $id => $label) { |
| 27 | - $name = 'tab_selector_' . $id; |
|
| 27 | + $name = 'tab_selector_'.$id; |
|
| 28 | 28 | $element[$name] = [ |
| 29 | 29 | '#type' => 'button', |
| 30 | 30 | '#attributes' => ['class' => ['tab']], |
@@ -105,8 +105,7 @@ discard block |
||
| 105 | 105 | $form_state->set('entity_form_initialized', TRUE); |
| 106 | 106 | if ($this->getRequest()->query->has('uuid')) { |
| 107 | 107 | $form_state->set(['entity_browser', 'instance_uuid'], $this->getRequest()->query->get('uuid')); |
| 108 | - } |
|
| 109 | - else { |
|
| 108 | + } else { |
|
| 110 | 109 | $form_state->set(['entity_browser', 'instance_uuid'], $this->uuidGenerator->generate()); |
| 111 | 110 | } |
| 112 | 111 | $form_state->set(['entity_browser', 'selected_entities'], []); |
@@ -159,8 +158,7 @@ discard block |
||
| 159 | 158 | $widget = $this->entityBrowser->getWidget($current_widget_id); |
| 160 | 159 | if ($widget->access()->isAllowed()) { |
| 161 | 160 | $form[$form['#browser_parts']['widget']] = $widget->getForm($form, $form_state, $this->entityBrowser->getAdditionalWidgetParameters()); |
| 162 | - } |
|
| 163 | - else { |
|
| 161 | + } else { |
|
| 164 | 162 | drupal_set_message($this->t('Access to the widget forbidden.'), 'warning'); |
| 165 | 163 | } |
| 166 | 164 | |
@@ -231,8 +229,7 @@ discard block |
||
| 231 | 229 | |
| 232 | 230 | if (!$this->isSelectionCompleted($form_state)) { |
| 233 | 231 | $form_state->setRebuild(); |
| 234 | - } |
|
| 235 | - else { |
|
| 232 | + } else { |
|
| 236 | 233 | $this->entityBrowser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state)); |
| 237 | 234 | } |
| 238 | 235 | } |