You are here

function theme_filefield_widget_file in FileField 6.3

Custom theme function for FileField upload elements.

This function allows us to put the "Upload" button immediately after the file upload field by respecting the #field_suffix property.

File

./filefield_widget.inc, line 532
This file contains CCK widget related functionality.

Code

function theme_filefield_widget_file($element) {
  $output = '';
  $output .= '<div class="filefield-upload clear-block">';
  if (isset($element['#field_prefix'])) {
    $output .= $element['#field_prefix'];
  }
  _form_set_class($element, array(
    'form-file',
  ));
  $output .= '<input type="file" name="' . $element['#name'] . '"' . ($element['#attributes'] ? ' ' . drupal_attributes($element['#attributes']) : '') . ' id="' . $element['#id'] . '" size="' . $element['#size'] . "\" />\n";
  if (isset($element['#field_suffix'])) {
    $output .= $element['#field_suffix'];
  }
  $output .= '</div>';
  return theme('form_element', $element, $output);
}