@@ -18,15 +18,15 @@ discard block |
||
18 | 18 | switch ($route_name) { |
19 | 19 | case 'help.page.entity_browser': |
20 | 20 | $output = ''; |
21 | - $output .= '<h3>' . t('About') . '</h3>'; |
|
22 | - $output .= '<p>' . t('The Entity Browser module provides a generic entity browser/picker/selector. It can be used in any context where one needs to select a few entities and do something with them. For more information, see the online documentation for <a href=":entity_browser-documentation">Entity Browser</a>.', [':entity_browser-documentation' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']) . '</p>'; |
|
23 | - $output .= '<h3>' . t('Uses') . '</h3>'; |
|
21 | + $output .= '<h3>'.t('About').'</h3>'; |
|
22 | + $output .= '<p>'.t('The Entity Browser module provides a generic entity browser/picker/selector. It can be used in any context where one needs to select a few entities and do something with them. For more information, see the online documentation for <a href=":entity_browser-documentation">Entity Browser</a>.', [':entity_browser-documentation' => 'https://drupal-media.gitbooks.io/drupal8-guide/content/modules/entity_browser/intro.html']).'</p>'; |
|
23 | + $output .= '<h3>'.t('Uses').'</h3>'; |
|
24 | 24 | $output .= '<dl>'; |
25 | - $output .= '<dt>' . t('General') . '</dt>'; |
|
26 | - $output .= '<dd>' . t('Entity browser comes with an example module that can be used as a starting point.') . '</dd>'; |
|
27 | - $output .= '<dt>' . t('Example use cases') . '</dt>'; |
|
28 | - $output .= '<dd>' . t('Powerfull entity reference widget') . '</dd>'; |
|
29 | - $output .= '<dd>' . t('Embedding entities into wysiwyg') . '</dd>'; |
|
25 | + $output .= '<dt>'.t('General').'</dt>'; |
|
26 | + $output .= '<dd>'.t('Entity browser comes with an example module that can be used as a starting point.').'</dd>'; |
|
27 | + $output .= '<dt>'.t('Example use cases').'</dt>'; |
|
28 | + $output .= '<dd>'.t('Powerfull entity reference widget').'</dd>'; |
|
29 | + $output .= '<dd>'.t('Embedding entities into wysiwyg').'</dd>'; |
|
30 | 30 | $output .= '</dl>'; |
31 | 31 | |
32 | 32 | return $output; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * Implements hook_form_alter(). |
68 | 68 | */ |
69 | -function entity_browser_form_alter(&$form, FormStateInterface &$form_state) { |
|
69 | +function entity_browser_form_alter(&$form, FormStateInterface&$form_state) { |
|
70 | 70 | $entity_browser_dialog_edit = \Drupal::service('request_stack')->getCurrentRequest()->get('_route'); |
71 | 71 | if ($entity_browser_dialog_edit == 'entity_browser.edit_form') { |
72 | 72 | // Let's allow the save button only. |
@@ -150,8 +150,7 @@ |
||
150 | 150 | $image->save(); |
151 | 151 | $file->filesize = $image->getFileSize(); |
152 | 152 | drupal_set_message(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $maximum_dimensions])); |
153 | - } |
|
154 | - else { |
|
153 | + } else { |
|
155 | 154 | $errors[] = t('The image exceeds the maximum allowed dimensions.'); |
156 | 155 | } |
157 | 156 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | foreach ($browsers as $browser) { |
60 | 60 | if ($browser->route()) { |
61 | - $permissions['access ' . $browser->id() . ' entity browser pages'] = [ |
|
61 | + $permissions['access '.$browser->id().' entity browser pages'] = [ |
|
62 | 62 | 'title' => $this->translationManager->translate('Access @name pages', ['@name' => $browser->label()]), |
63 | 63 | 'description' => $this->translationManager->translate('Access pages that %browser uses to operate.', ['%browser' => $browser->label()]), |
64 | 64 | ]; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // can't do much about it. |
54 | 54 | $selected_entities = $form_state->get(['entity_browser', 'selected_entities']); |
55 | 55 | if (!empty($selected_entities)) { |
56 | - $ids = array_map(function (EntityInterface $item) { |
|
56 | + $ids = array_map(function(EntityInterface $item) { |
|
57 | 57 | return $item->id(); |
58 | 58 | }, $selected_entities); |
59 | 59 | $storage['selection_display_view']->setArguments([implode(',', $ids)]); |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | $views = Views::getAllViews(); |
90 | 90 | foreach ($views as $view_id => $view) { |
91 | 91 | foreach ($view->get('display') as $display_id => $display) { |
92 | - $options[$view_id . '.' . $display_id] = $this->t('@view : @display', ['@view' => $view->label(), '@display' => $display['display_title']]); |
|
92 | + $options[$view_id.'.'.$display_id] = $this->t('@view : @display', ['@view' => $view->label(), '@display' => $display['display_title']]); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | 96 | $form['view'] = [ |
97 | 97 | '#type' => 'select', |
98 | 98 | '#title' => $this->t('View : View display'), |
99 | - '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'], |
|
99 | + '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'], |
|
100 | 100 | '#options' => $options, |
101 | 101 | '#required' => TRUE, |
102 | 102 | '#description' => $this->t('View display to use for displaying currently selected items. Do note that to get something usefull out of this display, its first contextual filter should be a filter on the primary identifier field of your entity type (e.g., Node ID, Media ID).'), |
@@ -19,7 +19,7 @@ |
||
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 | // Set a wrapper container for us to replace the form on ajax call. |
24 | 24 | $form['#prefix'] = '<div id="entity-browser-form">'; |
25 | 25 | $form['#suffix'] = '</div>'; |
@@ -19,10 +19,10 @@ |
||
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 | foreach ($this->widget_ids as $id => $label) { |
25 | - $name = 'tab_selector_' . $id; |
|
25 | + $name = 'tab_selector_'.$id; |
|
26 | 26 | $element[$name] = [ |
27 | 27 | '#type' => 'button', |
28 | 28 | '#attributes' => ['class' => ['tab']], |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * {@inheritdoc} |
21 | 21 | */ |
22 | - public function getForm(array &$form, FormStateInterface &$form_state) { |
|
22 | + public function getForm(array &$form, FormStateInterface&$form_state) { |
|
23 | 23 | return []; |
24 | 24 | } |
25 | 25 |
@@ -238,13 +238,13 @@ |
||
238 | 238 | foreach ($displays as $display) { |
239 | 239 | list($view_id, $display_id) = $display; |
240 | 240 | $view = $this->entityTypeManager->getStorage('view')->load($view_id); |
241 | - $options[$view_id . '.' . $display_id] = $this->t('@view : @display', ['@view' => $view->label(), '@display' => $view->get('display')[$display_id]['display_title']]); |
|
241 | + $options[$view_id.'.'.$display_id] = $this->t('@view : @display', ['@view' => $view->label(), '@display' => $view->get('display')[$display_id]['display_title']]); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $form['view'] = [ |
245 | 245 | '#type' => 'select', |
246 | 246 | '#title' => $this->t('View : View display'), |
247 | - '#default_value' => $this->configuration['view'] . '.' . $this->configuration['view_display'], |
|
247 | + '#default_value' => $this->configuration['view'].'.'.$this->configuration['view_display'], |
|
248 | 248 | '#options' => $options, |
249 | 249 | '#empty_option' => $this->t('- Select a view -'), |
250 | 250 | '#required' => TRUE, |