You are here

function theme_comment_upload_form_current in Comment Upload 6

Theme the attachments list in the upload form.

Taken from upload.module.

File

./comment_upload.module, line 651
Provides file attachment functionality for comments.

Code

function theme_comment_upload_form_current($form) {
  $header = array(
    '',
    t('Delete'),
    t('List'),
    t('Description'),
    t('Weight'),
    t('Size'),
  );
  drupal_add_tabledrag('comment-upload-attachments', 'order', 'sibling', 'comment-upload-weight');
  foreach (element_children($form) as $key) {

    // Add class to group weight fields for drag and drop.
    $form[$key]['weight']['#attributes']['class'] = 'comment-upload-weight';
    $row = array(
      '',
    );
    $row[] = drupal_render($form[$key]['remove']);
    $row[] = drupal_render($form[$key]['list']);
    $row[] = drupal_render($form[$key]['description']);
    $row[] = drupal_render($form[$key]['weight']);
    $row[] = drupal_render($form[$key]['size']);
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  $output = theme('table', $header, $rows, array(
    'id' => 'comment-upload-attachments',
  ));
  $output .= drupal_render($form);
  return $output;
}