@@ -27,7 +27,7 @@ |
||
27 | 27 | /** |
28 | 28 | * Implements hook_form_alter(). |
29 | 29 | */ |
30 | -function media_form_alter(&$form, FormStateInterface &$form_state) { |
|
30 | +function media_form_alter(&$form, FormStateInterface & $form_state) { |
|
31 | 31 | if (isset($form['#form_id'])) { |
32 | 32 | if ($form['#form_id'] == 'entity_browser_media_library_form') { |
33 | 33 | // Attach our library. |
@@ -13,13 +13,13 @@ discard block |
||
13 | 13 | * Implements hook_help(). |
14 | 14 | */ |
15 | 15 | function media_help($route_name, RouteMatchInterface $route_match) { |
16 | - switch ($route_name) { |
|
16 | + switch ($route_name) { |
|
17 | 17 | // Main module help for the media module. |
18 | 18 | case 'help.page.media': |
19 | 19 | $output = ''; |
20 | - $output .= '<h3>' . t('About') . '</h3>'; |
|
21 | - $output .= '<p>' . t('Media module for Drupal 8') . '</p>'; |
|
22 | - return $output; |
|
20 | + $output .= '<h3>' . t('About') . '</h3>'; |
|
21 | + $output .= '<p>' . t('Media module for Drupal 8') . '</p>'; |
|
22 | + return $output; |
|
23 | 23 | |
24 | 24 | default: |
25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * Implements hook_form_alter(). |
30 | 30 | */ |
31 | 31 | function media_form_alter(&$form, FormStateInterface &$form_state) { |
32 | - if ($form['#form_id'] == 'entity_browser_media_library_form') { |
|
32 | + if ($form['#form_id'] == 'entity_browser_media_library_form') { |
|
33 | 33 | // Style the submit button. |
34 | 34 | $form['actions']['submit']['#value'] = t('Select Media Files'); |
35 | 35 | $form['actions']['submit']['#attributes']['class'][] = 'button--primary'; |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | |
38 | 38 | // Add a class for generic styling. |
39 | 39 | $form['#attributes']['class'][] = 'media-library-form'; |
40 | - } |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Implements hook_library_info_alter(). |
45 | 45 | */ |
46 | 46 | function media_library_info_alter(&$libraries, $extension) { |
47 | - // Optionally use the Libraries module to determine our library paths. |
|
48 | - if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) { |
|
47 | + // Optionally use the Libraries module to determine our library paths. |
|
48 | + if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) { |
|
49 | 49 | $imagesloaded_path = libraries_get_path('imagesloaded') . '/imagesloaded.pkgd.min.js'; |
50 | 50 | $masonry_path = libraries_get_path('masonry') . '/dist/masonry.pkgd.min.js'; |
51 | 51 | |
52 | 52 | $libraries['imagesloaded']['js'] = ['/' . $imagesloaded_path => ['minified' => 'true']]; |
53 | 53 | $libraries['masonry']['js'] = ['/' . $masonry_path => ['minified' => 'true']]; |
54 | - } |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * Adds the media.view library to the media views. |
61 | 61 | */ |
62 | 62 | function media_views_pre_render(ViewExecutable $view) { |
63 | - if (isset($view) && ($view->storage->id() == 'media_library' || $view->storage->id() == 'media')) { |
|
63 | + if (isset($view) && ($view->storage->id() == 'media_library' || $view->storage->id() == 'media')) { |
|
64 | 64 | $view->element['#attached']['library'][] = 'media/view'; |
65 | - } |
|
65 | + } |
|
66 | 66 | } |