@@ -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']], |
@@ -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. |
@@ -34,9 +34,7 @@ |
||
34 | 34 | * The entity manager. |
35 | 35 | * @param $tempstore_id |
36 | 36 | * The shared temp store factory collection name. |
37 | - * @param null $machine_name |
|
38 | - * The SharedTempStore key for our current wizard values. |
|
39 | - * @param null $step |
|
37 | + * @param string|null $step |
|
40 | 38 | * The current active step of the wizard. |
41 | 39 | */ |
42 | 40 | public function __construct(SharedTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, EntityManagerInterface $entity_manager, RouteMatchInterface $route_match, $tempstore_id, $entity_browser = NULL, $step = 'general') { |
@@ -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 | } |
@@ -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>.', array(':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>.', array(':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. |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $files = $this->prepareEntities($form, $form_state); |
126 | 126 | array_walk( |
127 | 127 | $files, |
128 | - function (FileInterface $file) { |
|
128 | + function(FileInterface $file) { |
|
129 | 129 | $file->setPermanent(); |
130 | 130 | $file->save(); |
131 | 131 | } |
@@ -208,8 +208,7 @@ |
||
208 | 208 | $extensions = implode(' ', array_unique($extensions)); |
209 | 209 | if (!preg_match('/^([a-z0-9]+([.][a-z0-9])* ?)+$/', $extensions)) { |
210 | 210 | $form_state->setError($element, t('The list of allowed extensions is not valid, be sure to exclude leading dots and to separate extensions with a comma or space.')); |
211 | - } |
|
212 | - else { |
|
211 | + } else { |
|
213 | 212 | $form_state->setValueForElement($element, $extensions); |
214 | 213 | } |
215 | 214 | } |