| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | function media_form_alter(&$form, FormStateInterface &$form_state) { |
||
| 31 | if (isset($form['#form_id'])) { |
||
| 32 | if ($form['#form_id'] == 'entity_browser_media_library_form') { |
||
| 33 | // Attach our library. |
||
| 34 | $form['#attached']['library'][] = 'media/view'; |
||
| 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'; |
||
| 40 | |||
| 41 | // Wrap actions so we can float them at the bottom of the browser. |
||
| 42 | $form['actions_wrap'] = [ |
||
| 43 | '#type' => 'container', |
||
| 44 | '#attributes' => [ |
||
| 45 | 'class' => 'file-browser-actions', |
||
| 46 | ], |
||
| 47 | 0 => $form['actions'], |
||
| 48 | ]; |
||
| 49 | unset($form['actions']); |
||
| 50 | |||
| 51 | // Add a class for generic styling. |
||
| 52 | $form['#attributes']['class'][] = 'file-browser-form'; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.