function file_browser_attach_file_browser_to_form in File Entity Browser 8
Attach the file_browser functionality into a form.
Parameters
array $form: Nested array of form elements that comprise the form.
1 call to file_browser_attach_file_browser_to_form()
- file_browser_form_alter in ./
file_browser.module - Implements hook_form_alter().
File
- ./
file_browser.module, line 45 - Contains hook implementations for file_browser.
Code
function file_browser_attach_file_browser_to_form(array &$form) {
// Attach our library.
$form['#attached']['library'][] = 'file_browser/view';
$form['#attached']['library'][] = 'file_browser/dropzone_css';
if (isset($form['selection_display'])) {
$form['selection_display']['#type'] = 'container';
$form['selection_display']['#attributes']['class'] = [
'file-browser-actions',
];
}
// Add a class for generic styling.
$form['#attributes']['class'][] = 'file-browser-form';
}