function claro_form_media_library_add_form_alter
Same name in other branches
- 9 core/themes/claro/claro.theme \claro_form_media_library_add_form_alter()
- 8.9.x core/themes/claro/claro.theme \claro_form_media_library_add_form_alter()
- 10 core/themes/claro/claro.theme \claro_form_media_library_add_form_alter()
Implements hook_form_BASE_FORM_ID_alter().
File
-
core/
themes/ claro/ claro.theme, line 1492
Code
function claro_form_media_library_add_form_alter(array &$form, FormStateInterface $form_state) {
$form['#attributes']['class'][] = 'media-library-add-form';
$form['#attached']['library'][] = 'claro/media_library.theme';
// If there are unsaved media items, apply styling classes to various parts
// of the form.
if (isset($form['media'])) {
$form['#attributes']['class'][] = 'media-library-add-form--with-input';
// Put a wrapper around the informational message above the unsaved media
// items.
$form['description']['#template'] = '<p class="media-library-add-form__description">{{ text }}</p>';
}
else {
$form['#attributes']['class'][] = 'media-library-add-form--without-input';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.