Completed
Push — 8.x-1.x ( 4faedf...626f77 )
by Tadej
7s
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   +13 added lines, -13 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,25 +29,25 @@  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
     // Style the submit button.
34 34
     $form['actions']['submit']['#attributes']['class'][] = 'button--primary';
35 35
     $form['actions']['submit']['#attributes']['class'][] = 'entity-browser-modal-target';
36
-  }
36
+    }
37 37
 }
38 38
 
39 39
 /**
40 40
  * Implements hook_library_info_alter().
41 41
  */
42 42
 function media_library_info_alter(&$libraries, $extension) {
43
-  // Optionally use the Libraries module to determine our library paths.
44
-  if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) {
43
+    // Optionally use the Libraries module to determine our library paths.
44
+    if ($extension == 'media' && \Drupal::moduleHandler()->moduleExists('libraries')) {
45 45
     $imagesloaded_path = libraries_get_path('imagesloaded') . '/imagesloaded.pkgd.min.js';
46 46
     $masonry_path = libraries_get_path('masonry') . '/dist/masonry.pkgd.min.js';
47 47
 
48 48
     $libraries['imagesloaded']['js'] = ['/' . $imagesloaded_path => ['minified' => 'true']];
49 49
     $libraries['masonry']['js'] = ['/' . $masonry_path => ['minified' => 'true']];
50
-  }
50
+    }
51 51
 }
52 52
 
53 53
 /**
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
  * Adds the media.view library to the media views.
57 57
  */
58 58
 function media_views_pre_render(ViewExecutable $view) {
59
-  if (isset($view) && ($view->storage->id() == 'media_library' || $view->storage->id() == 'global_media_library')) {
59
+    if (isset($view) && ($view->storage->id() == 'media_library' || $view->storage->id() == 'global_media_library')) {
60 60
     $view->element['#attached']['library'][] = 'media/view';
61
-  }
61
+    }
62 62
 }
63 63
 
64 64
 /**
@@ -67,6 +67,6 @@  discard block
 block discarded – undo
67 67
  * Adds the add media button from media_entity on library pages.
68 68
  */
69 69
 function media_menu_local_actions_alter(&$local_actions) {
70
-  $local_actions['media.add']['appears_on'][] = 'view.media_library.user_media_library';
71
-  $local_actions['media.add']['appears_on'][] = 'view.media_library.global_media_library_page';
70
+    $local_actions['media.add']['appears_on'][] = 'view.media_library.user_media_library';
71
+    $local_actions['media.add']['appears_on'][] = 'view.media_library.global_media_library_page';
72 72
 }
Please login to merge, or discard this patch.