You are here

function filefield_sources_element_info_alter in FileField Sources 8

Implements hook_element_info_alter().

File

./filefield_sources.module, line 36
Extend FileField to allow files from multiple sources.

Code

function filefield_sources_element_info_alter(&$type) {
  if (isset($type['managed_file'])) {
    $type['managed_file']['#process'][] = 'filefield_sources_field_process';
    $type['managed_file']['#pre_render'][] = '\\Drupal\\filefield_sources\\FilefieldSourcesPreRenderCallback::preRender';
    $type['managed_file']['#element_validate'][] = 'filefield_sources_field_validate';
    $type['managed_file']['#file_value_callbacks'][] = 'filefield_sources_field_value';
  }
}