@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | '#theme_wrappers' => ['container'], |
54 | 54 | 'path' => [ |
55 | 55 | '#type' => 'hidden', |
56 | - '#value' => Url::fromRoute('entity_browser.' . $this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
56 | + '#value' => Url::fromRoute('entity_browser.'.$this->configuration['entity_browser_id'], [], $data['query_parameters'])->toString(), |
|
57 | 57 | ], |
58 | 58 | 'open_modal' => [ |
59 | 59 | '#type' => 'submit', |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $field_name = $triggering_element['#parents'][0]; |
109 | 109 | $element_name = $this->configuration['entity_browser_id']; |
110 | - $name = 'entity_browser_iframe_' . $element_name; |
|
110 | + $name = 'entity_browser_iframe_'.$element_name; |
|
111 | 111 | $content = [ |
112 | 112 | '#prefix' => '<div class="ajax-progress-throbber"></div>', |
113 | 113 | '#type' => 'html_tag', |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $html = drupal_render($content); |
127 | 127 | |
128 | 128 | $response = new AjaxResponse(); |
129 | - $response->addCommand(new OpenDialogCommand('#' . Html::getUniqueId($field_name . '-' . $element_name . '-dialog'), $this->configuration['link_text'], $html, [ |
|
129 | + $response->addCommand(new OpenDialogCommand('#'.Html::getUniqueId($field_name.'-'.$element_name.'-dialog'), $this->configuration['link_text'], $html, [ |
|
130 | 130 | 'width' => 'auto', |
131 | 131 | 'height' => 'auto', |
132 | 132 | 'modal' => TRUE, |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * {@inheritdoc} |
100 | 100 | */ |
101 | 101 | public function getForm(array &$original_form, FormStateInterface $form_state, array $additional_widget_parameters) { |
102 | - if (empty($this->configuration['entity_type']) || empty($this->configuration['bundle']) || empty($this->configuration['form_mode'])) { |
|
102 | + if (empty($this->configuration['entity_type']) || empty($this->configuration['bundle']) || empty($this->configuration['form_mode'])) { |
|
103 | 103 | return ['#markup' => $this->t('The settings for this widget (Entity type, Bundle or Form mode) are not configured correctly.')]; |
104 | 104 | } |
105 | 105 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | // Pretend to be IEFs submit button. |
109 | 109 | $form['#submit'] = [['Drupal\inline_entity_form\ElementSubmit', 'trigger']]; |
110 | - $form['actions']['submit']['#ief_submit_trigger'] = TRUE; |
|
110 | + $form['actions']['submit']['#ief_submit_trigger'] = TRUE; |
|
111 | 111 | $form['actions']['submit']['#ief_submit_trigger_all'] = TRUE; |
112 | 112 | |
113 | 113 | $form['inline_entity_form'] = [ |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $entities = $this->prepareEntities($form, $form_state); |
136 | 136 | array_walk( |
137 | 137 | $entities, |
138 | - function (EntityInterface $entity) { |
|
138 | + function(EntityInterface $entity) { |
|
139 | 139 | $entity->save(); |
140 | 140 | } |
141 | 141 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $definitions = $this->entityTypeManager->getDefinitions(); |
157 | 157 | $entity_types = array_combine( |
158 | 158 | array_keys($definitions), |
159 | - array_map(function (EntityTypeInterface $item) { |
|
159 | + array_map(function(EntityTypeInterface $item) { |
|
160 | 160 | return $item->getLabel(); |
161 | 161 | }, $definitions) |
162 | 162 | ); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $bundles = []; |
175 | 175 | if ($entity_type) { |
176 | 176 | $definitions = $this->entityTypeBundleInfo->getBundleInfo($entity_type); |
177 | - $bundles = array_map(function ($item) { |
|
177 | + $bundles = array_map(function($item) { |
|
178 | 178 | return $item['label']; |
179 | 179 | }, $definitions); |
180 | 180 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | '#options' => $bundles, |
188 | 188 | '#default_value' => $bundle, |
189 | 189 | ], |
190 | - '#attributes' => ['id' => 'bundle-wrapper-' . $this->uuid()], |
|
190 | + '#attributes' => ['id' => 'bundle-wrapper-'.$this->uuid()], |
|
191 | 191 | ]; |
192 | 192 | |
193 | 193 | $form['form_mode'] = [ |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | '#default_value' => $form_mode, |
199 | 199 | '#options' => $this->entityDisplayRepository->getFormModeOptions($entity_type), |
200 | 200 | ], |
201 | - '#attributes' => ['id' => 'form-mode-wrapper-' . $this->uuid()], |
|
201 | + '#attributes' => ['id' => 'form-mode-wrapper-'.$this->uuid()], |
|
202 | 202 | ]; |
203 | 203 | |
204 | 204 | return $form; |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function updateFormElements($form, FormStateInterface $form_state) { |
225 | 225 | $response = new AjaxResponse(); |
226 | - $response->addCommand(new ReplaceCommand('#bundle-wrapper-' . $this->uuid(), $this->updateBundle($form, $form_state))); |
|
227 | - $response->addCommand(new ReplaceCommand('#form-mode-wrapper-' . $this->uuid(), $this->updateFormMode($form, $form_state))); |
|
226 | + $response->addCommand(new ReplaceCommand('#bundle-wrapper-'.$this->uuid(), $this->updateBundle($form, $form_state))); |
|
227 | + $response->addCommand(new ReplaceCommand('#form-mode-wrapper-'.$this->uuid(), $this->updateFormMode($form, $form_state))); |
|
228 | 228 | return $response; |
229 | 229 | } |
230 | 230 |
@@ -96,8 +96,7 @@ |
||
96 | 96 | $triggering_element = $form_state->getTriggeringElement(); |
97 | 97 | if ($triggering_element['#name'] == 'prev_page') { |
98 | 98 | $page--; |
99 | - } |
|
100 | - elseif ($triggering_element['#name'] == 'next_page') { |
|
99 | + } elseif ($triggering_element['#name'] == 'next_page') { |
|
101 | 100 | $page++; |
102 | 101 | } |
103 | 102 |