theme_file
- Versions
- 4.7 – 6
theme_file($element)- 7
theme_file($variables)
Theme 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.
Return value
A themed HTML string representing the field.
Related topics
Code
includes/form.inc, line 2780
<?php
function theme_file($variables) {
$element = $variables['element'];
_form_set_class($element, array('form-file'));
return '<input type="file" name="' . $element['#name'] . '"' . ($element['#attributes'] ? ' ' . drupal_attributes($element['#attributes']) : '') . ' id="' . $element['#id'] . '" size="' . $element['#size'] . "\" />\n";
}
?>Login or register to post comments 