function _file_field_get_description_from_element

cis7 file.field.inc _file_field_get_description_from_element($element)
cle7 file.field.inc _file_field_get_description_from_element($element)
elmsmedia7 file.field.inc _file_field_get_description_from_element($element)
icor7 file.field.inc _file_field_get_description_from_element($element)
meedjum_blog7 file.field.inc _file_field_get_description_from_element($element)
mooc7 file.field.inc _file_field_get_description_from_element($element)

Retrieves the file description from a field field element.

This helper function is used by file_field_widget_process_multiple().

Parameters

$element: The element being processed.

Return value

A description of the file suitable for use in the administrative interface.

2 calls to _file_field_get_description_from_element()
file_field_widget_process_multiple in modules/file/file.field.inc
An element #process callback for a group of file_generic fields.
mfw_field_widget_process_multiple in sites/all/modules/ulmus/multiupload_filefield_widget/multiupload_filefield_widget.field.inc
An element #process callback for a group of mfw_file fields.

File

modules/file/file.field.inc, line 732
Field module functionality for the File module.

Code

function _file_field_get_description_from_element($element) {
  // Use the actual file description, if it's available.
  if (!empty($element['#default_value']['description'])) {
    return $element['#default_value']['description'];
  }
  // Otherwise, fall back to the filename.
  if (!empty($element['#default_value']['filename'])) {
    return $element['#default_value']['filename'];
  }
  // This is probably a newly uploaded file; no description is available.
  return FALSE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.