You are here

function theme_filefield_form_current in FileField 5.2

1 theme call to theme_filefield_form_current()
_filefield_widget_form in ./filefield.module

File

./filefield.module, line 751
Defines a file field type.

Code

function theme_filefield_form_current($form) {
  $header = $form['#force_list'] ? array(
    '',
    t('Delete'),
    '',
    t('Description'),
    t('Size'),
  ) : array(
    '',
    t('Delete'),
    t('List'),
    '',
    t('Description'),
    t('Size'),
  );
  foreach (element_children($form) as $key) {

    // Don't display (hidden) replaced items.
    if ($form[$key]['delete']['#type'] == 'hidden') {
      continue;
    }
    $row = array();

    // we just going to lose this for now until we figure out how to handle it...
    $row[] = drupal_render($form[$key]['file_preview']);
    $row[] = drupal_render($form[$key]['delete']);
    if (!$form['#force_list']) {
      $row[] = drupal_render($form[$key]['list']);
    }
    $row[] = drupal_render($form[$key]['icon']);
    $row[] = drupal_render($form[$key]['description']) . drupal_render($form[$key]['url']);
    $row[] = drupal_render($form[$key]['size']);
    $rows[] = $row;
  }
  $output = theme('table', $header, $rows, array(
    'class' => 'filefield-filebrowser',
  ));
  $output .= drupal_render($form);
  return $output;
}