function file_entity_upload_validators_pre_render in File Entity (fieldable files) 7.2
Same name and namespace in other branches
- 7.3 file_entity.module \file_entity_upload_validators_pre_render()
Pre-render callback for adding validation descriptions to file upload fields.
4 string references to 'file_entity_upload_validators_pre_render'
- file_entity_add_upload_multiple in ./
file_entity.pages.inc - Form for uploading multiple files.
- file_entity_add_upload_step_upload in ./
file_entity.pages.inc - Generate form fields for the first step in the add file wizard.
- file_entity_edit in ./
file_entity.pages.inc - Page callback: Form constructor for the file edit form.
- file_entity_upload_archive_form in ./
file_entity.pages.inc
File
- ./
file_entity.module, line 2334 - Extends Drupal file entities to be fieldable and viewable.
Code
function file_entity_upload_validators_pre_render($element) {
if (!empty($element['#upload_validators'])) {
if (!isset($element['#description'])) {
$element['#description'] = '';
}
if ($element['#description'] !== FALSE) {
$element['#description'] = theme('file_upload_help', array(
'description' => $element['#description'],
'upload_validators' => $element['#upload_validators'],
));
}
}
return $element;
}