Completed
Pull Request — 8.x-1.x (#8)
by Vijay
03:26
created
media.module 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     // Attach our library.
34 34
     $form['#attached']['library'][] = 'media/view';
35 35
 
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
 
41 41
     // Add a class for generic styling.
42 42
     $form['#attributes']['class'][] = 'media-library-form';
43
-  }
43
+    }
44 44
 }
45 45
 
46 46
 /**
47 47
  * Implements hook_library_info_alter().
48 48
  */
49 49
 function media_library_info_alter(&$libraries, $extension) {
50
-  // Optionally use the Libraries module to determine our library paths.
51
-  if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) {
50
+    // Optionally use the Libraries module to determine our library paths.
51
+    if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) {
52 52
     $imagesloaded_path = libraries_get_path('imagesloaded') . '/imagesloaded.pkgd.min.js';
53 53
     $masonry_path = libraries_get_path('masonry') . '/dist/masonry.pkgd.min.js';
54 54
 
55 55
     $libraries['imagesloaded']['js'] = ['/' . $imagesloaded_path => ['minified' => 'true']];
56 56
     $libraries['masonry']['js'] = ['/' . $masonry_path => ['minified' => 'true']];
57
-  }
57
+    }
58 58
 }
59 59
 
60 60
 /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * Adds the media.user library to the media_library view.
64 64
  */
65 65
 function media_views_pre_render(ViewExecutable $view) {
66
-  if (isset($view) && ($view->storage->id() == 'media_library')) {
66
+    if (isset($view) && ($view->storage->id() == 'media_library')) {
67 67
     $view->element['#attached']['library'][] = 'media/user';
68
-  }
68
+    }
69 69
 }
Please login to merge, or discard this patch.