You are here

function theme_filefield_container_item in FileField 6.2

Render either an upload or edit container item so that the children elements always appear inside a nice table, whatever $field['multiple'] might be.

2 theme calls to theme_filefield_container_item()
theme_filefield_file_edit in ./filefield.widget.inc
Theme function for the file edit container element.
theme_filefield_file_upload in ./filefield.widget.inc
Theme function for the file upload container element.

File

./filefield.theme.inc, line 51
FileField: Defines a CCK file field type.

Code

function theme_filefield_container_item($element) {
  $field = $element['#field'];
  $children = !empty($element['#children']) ? $element['#children'] : '';

  // CCK renders a nice table for multiple-value fields, that's just fine as is.
  if ($field['multiple']) {
    return $children;
  }

  // If the field is single-value, we still want to have a table, for the looks.
  $header = array();
  $rows = array(
    array(
      $children,
    ),
  );
  $attributes = array(
    'class' => 'filefield-file-container-table',
  );
  $table = theme('table', $header, $rows, $attributes);
  return theme('form_element', $element, $table);
}