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