@@ -116,8 +116,7 @@ |
||
116 | 116 | |
117 | 117 | if (!$this->isSelectionCompleted($form_state)) { |
118 | 118 | $form_state->setRebuild(); |
119 | - } |
|
120 | - else { |
|
119 | + } else { |
|
121 | 120 | $entity_browser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state)); |
122 | 121 | } |
123 | 122 | } |
@@ -124,8 +124,7 @@ discard block |
||
124 | 124 | return [ |
125 | 125 | '#markup' => t('Entity browser select form field not found on a view. <a href=":link">Go fix it</a>!', [':link' => $url]), |
126 | 126 | ]; |
127 | - } |
|
128 | - else { |
|
127 | + } else { |
|
129 | 128 | return [ |
130 | 129 | '#markup' => t('Entity browser select form field not found on a view. Go fix it!'), |
131 | 130 | ]; |
@@ -183,8 +182,7 @@ discard block |
||
183 | 182 | ]); |
184 | 183 | $form_state->setError($form['widget']['view']['entity_browser_select'], $message); |
185 | 184 | } |
186 | - } |
|
187 | - catch (PluginNotFoundException $e) { |
|
185 | + } catch (PluginNotFoundException $e) { |
|
188 | 186 | $message = t('The Entity Type @type does not exist.', [ |
189 | 187 | '@type' => $parts[0], |
190 | 188 | ]); |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $form_state->set('entity_form_initialized', TRUE); |
74 | 74 | if ($this->getRequest()->query->has('uuid')) { |
75 | 75 | $form_state->set(['entity_browser', 'instance_uuid'], $this->getRequest()->query->get('uuid')); |
76 | - } |
|
77 | - else { |
|
76 | + } else { |
|
78 | 77 | $form_state->set(['entity_browser', 'instance_uuid'], $this->uuidGenerator->generate()); |
79 | 78 | } |
80 | 79 | $form_state->set(['entity_browser', 'selected_entities'], []); |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | |
162 | 161 | if (!$this->isSelectionCompleted($form_state)) { |
163 | 162 | $form_state->setRebuild(); |
164 | - } |
|
165 | - else { |
|
163 | + } else { |
|
166 | 164 | $this->entity_browser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state)); |
167 | 165 | } |
168 | 166 | } |
@@ -116,8 +116,7 @@ |
||
116 | 116 | |
117 | 117 | if (!$this->isSelectionCompleted($form_state)) { |
118 | 118 | $form_state->setRebuild(); |
119 | - } |
|
120 | - else { |
|
119 | + } else { |
|
121 | 120 | $entity_browser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state)); |
122 | 121 | } |
123 | 122 | } |
@@ -122,8 +122,7 @@ |
||
122 | 122 | $image->save(); |
123 | 123 | $file->filesize = $image->getFileSize(); |
124 | 124 | drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', array('%dimensions' => $maximum_dimensions))); |
125 | - } |
|
126 | - else { |
|
125 | + } else { |
|
127 | 126 | $errors[] = t('The image exceeds the maximum allowed dimensions.'); |
128 | 127 | } |
129 | 128 | } |
@@ -116,8 +116,7 @@ |
||
116 | 116 | |
117 | 117 | if (!$this->isSelectionCompleted($form_state)) { |
118 | 118 | $form_state->setRebuild(); |
119 | - } |
|
120 | - else { |
|
119 | + } else { |
|
121 | 120 | $entity_browser->getDisplay()->selectionCompleted($this->getSelectedEntities($form_state)); |
122 | 121 | } |
123 | 122 | } |
@@ -453,8 +453,7 @@ discard block |
||
453 | 453 | // and use this information to return correct part of the form. |
454 | 454 | if (!empty($trigger['#ajax']['event']) && $trigger['#ajax']['event'] == 'entity_browser_value_updated') { |
455 | 455 | $parents = array_slice($trigger['#array_parents'], 0, -1); |
456 | - } |
|
457 | - elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
456 | + } elseif ($trigger['#type'] == 'submit' && strpos($trigger['#name'], '_remove_')) { |
|
458 | 457 | $parents = array_slice($trigger['#array_parents'], 0, -static::$deleteDepth); |
459 | 458 | } |
460 | 459 | |
@@ -621,12 +620,10 @@ discard block |
||
621 | 620 | $entity_browser_id = $this->getSetting('entity_browser'); |
622 | 621 | if (empty($entity_browser_id)) { |
623 | 622 | return [$this->t('No entity browser selected.')]; |
624 | - } |
|
625 | - else { |
|
623 | + } else { |
|
626 | 624 | if ($browser = $this->entityTypeManager->getStorage('entity_browser')->load($entity_browser_id)) { |
627 | 625 | $summary[] = $this->t('Entity browser: @browser', ['@browser' => $browser->label()]); |
628 | - } |
|
629 | - else { |
|
626 | + } else { |
|
630 | 627 | drupal_set_message($this->t('Missing entity browser!'), 'error'); |
631 | 628 | return [$this->t('Missing entity browser!')]; |
632 | 629 | } |
@@ -636,8 +633,7 @@ discard block |
||
636 | 633 | $selection_mode_options = EntityBrowserElement::getSelectionModeOptions(); |
637 | 634 | if (isset($selection_mode_options[$selection_mode])) { |
638 | 635 | $summary[] = $this->t('Selection mode: @selection_mode', ['@selection_mode' => $selection_mode_options[$selection_mode]]); |
639 | - } |
|
640 | - else { |
|
636 | + } else { |
|
641 | 637 | $summary[] = $this->t('Undefined selection mode.'); |
642 | 638 | } |
643 | 639 |
@@ -175,8 +175,7 @@ discard block |
||
175 | 175 | // their styles in code. |
176 | 176 | elseif ($this->fieldDefinition->getType() == 'image' && $image_style = ImageStyle::load($image_style_setting)) { |
177 | 177 | $preview_image_style = $this->t('Preview image style: @style', ['@style' => $image_style->label()]); |
178 | - } |
|
179 | - else { |
|
178 | + } else { |
|
180 | 179 | $preview_image_style = $this->t('No preview image'); |
181 | 180 | } |
182 | 181 | array_unshift($summary, $preview_image_style); |
@@ -260,8 +259,7 @@ discard block |
||
260 | 259 | if ($field_type == 'file') { |
261 | 260 | $description = $item->description; |
262 | 261 | $display_field = $item->display; |
263 | - } |
|
264 | - elseif ($field_type == 'image') { |
|
262 | + } elseif ($field_type == 'image') { |
|
265 | 263 | $alt = $item->alt; |
266 | 264 | $title = $item->title; |
267 | 265 | $width = $item->width; |
@@ -455,8 +453,7 @@ discard block |
||
455 | 453 | $extensions = isset($settings['file_extensions']) ? $settings['file_extensions'] : implode(' ', $supported_extensions); |
456 | 454 | $extensions = array_intersect(explode(' ', $extensions), $supported_extensions); |
457 | 455 | $validators['file_validate_extensions'] = [implode(' ', $extensions)]; |
458 | - } |
|
459 | - elseif (!empty($settings['file_extensions'])) { |
|
456 | + } elseif (!empty($settings['file_extensions'])) { |
|
460 | 457 | $validators['file_validate_extensions'] = [$settings['file_extensions']]; |
461 | 458 | } |
462 | 459 |
@@ -131,8 +131,7 @@ |
||
131 | 131 | return [ |
132 | 132 | '#markup' => t('Entity browser select form field not found on a view. <a href=":link">Go fix it</a>!', [':link' => $url]), |
133 | 133 | ]; |
134 | - } |
|
135 | - else { |
|
134 | + } else { |
|
136 | 135 | return [ |
137 | 136 | '#markup' => t('Entity browser select form field not found on a view. Go fix it!'), |
138 | 137 | ]; |