theme_file

Versions
4.7 – 6
theme_file($element)
7
theme_file($variables)

Format a file upload field.

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

Parameters

$title The label for the file upload field.

$name The internal name used to refer to the field.

$size A measure of the visible size of the field (passed directly to HTML).

$description Explanatory text to display after the form item.

$required Whether the user must upload a file to the field.

Return value

A themed HTML string representing the field.

Related topics

Code

includes/form.inc, line 1154

<?php
function theme_file($element) {
  _form_set_class($element, array('form-file'));
  return theme('form_element', $element['#title'], '<input type="file" name="'. $element['#name'] .'"'. ($element['#attributes'] ? ' '. drupal_attributes($element['#attributes']) : '') .' id="'. form_clean_id($element['#id']) .'" size="'. $element['#size'] ."\" />\n", $element['#description'], $element['#id'], $element['#required'], form_get_error($element));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.