You are here

function filefield_sources_element_validation_help in FileField Sources 8

Same name and namespace in other branches
  1. 6 filefield_sources.module \filefield_sources_element_validation_help()
  2. 7 filefield_sources.module \filefield_sources_element_validation_help()

Generate help text based on the $element['#upload_validators'] property.

5 calls to filefield_sources_element_validation_help()
Attach::process in src/Plugin/FilefieldSource/Attach.php
Process callback for file field source plugin.
Clipboard::process in src/Plugin/FilefieldSource/Clipboard.php
Process callback for file field source plugin.
Imce::process in src/Plugin/FilefieldSource/Imce.php
Process callback for file field source plugin.
Reference::process in src/Plugin/FilefieldSource/Reference.php
Process callback for file field source plugin.
Remote::process in src/Plugin/FilefieldSource/Remote.php
Process callback for file field source plugin.

File

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

Code

function filefield_sources_element_validation_help($validators) {
  $desc = [];
  foreach ($validators as $callback => $arguments) {
    $help_func = $callback . '_help';
    if (function_exists($help_func)) {
      $desc[] = call_user_func_array($help_func, $arguments);
    }
  }
  return empty($desc) ? '' : implode('<br />', $desc);
}