You are here

function block_upload_remove_form in Block Upload 7

Builds form for removing the files with block.

2 calls to block_upload_remove_form()
block_upload_form in ./block_upload.module
Block upload form.
block_upload_plupload_form in ./block_upload.module
Returns plupload form for the form builder.

File

./block_upload.module, line 152
Block Upload module.

Code

function block_upload_remove_form($field_limit, $node, $field) {
  foreach ($node->{$field}[LANGUAGE_NONE] as $key => $val) {
    $uploader = user_load($val['uid']);
    $uploader = l($uploader->name, 'user/' . $uploader->uid);
    $options[$val['fid']] = array(
      array(
        'data' => array(
          '#type' => 'item',
          '#title' => filter_xss($uploader),
          '#description' => check_plain(format_date($val['timestamp'])),
        ),
      ),
      array(
        'data' => array(
          '#theme' => 'file_link',
          '#file' => (object) $val,
        ),
        'field_type' => $field_limit['type'],
      ),
    );
  }
  $header = array(
    t('Uploader'),
    t('File'),
  );
  $form = array(
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $options,
    '#empty' => t('No content available.'),
    '#attributes' => array(
      'class' => array(
        'delete-files',
      ),
    ),
  );
  return $form;
}