function theme_file

7.x form.inc theme_file($variables)
5.x form.inc theme_file($element)
6.x form.inc theme_file($element)

Returns HTML for a file upload form element.

For assistance with handling the uploaded file correctly, see the API provided by file.inc.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #name, #size, #description, #required, #attributes.

Related topics

4 theme calls to theme_file()
FileFieldDisplayTestCase::testNodeDisplay in drupal/modules/file/tests/file.test
Tests normal formatter display on node display.
file_managed_file_process in drupal/modules/file/file.module
Process function to expand the managed_file element type.
theme_file_formatter_table in drupal/modules/file/file.field.inc
Returns HTML for a file attachments table.
theme_file_link in drupal/modules/file/file.module
Returns HTML for a link to a file.
182 string references to the theme hook from theme_file()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

aggregator_form_opml in drupal/modules/aggregator/aggregator.admin.inc
Form constructor for importing feeds from OPML.
aggregator_menu in drupal/modules/aggregator/aggregator.module
Implements hook_menu().
aggregator_theme in drupal/modules/aggregator/aggregator.module
Implements hook_theme().
AJAXFrameworkTestCase::testLazyLoad in drupal/modules/simpletest/tests/ajax.test
Test that new JavaScript and CSS files added during an AJAX request are returned.
authorize_get_filetransfer in drupal/includes/authorize.inc
Gets a FileTransfer class for a specific transfer method and settings.

... See full list

File

drupal/includes/form.inc, line 4031
Functions for form and batch generation and processing.

Code

function theme_file($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'file';
  element_set_attributes($element, array('id', 'name', 'size'));
  _form_set_class($element, array('form-file'));

  return '<input' . drupal_attributes($element['#attributes']) . ' />';
}