upload_form
- Versions
- 4.6
upload_form($node)
Code
modules/upload.module, line 429
<?php
function upload_form($node) {
$header = array(t('Delete'), t('List'), t('Url'), t('Size'));
$rows = array();
if (is_array($node->files)) {
foreach ($node->files as $key => $file) {
$rows[] = array(
form_checkbox('', "remove][$key", 1, $file->remove),
form_checkbox('', "list][$key", 1, $file->list),
$file->filename ."<br /><small>". file_create_url(($file->fid ? $file->filepath : file_create_filename($file->filename, file_create_path()))) ."</small>",
format_size($file->filesize)
);
}
}
if (count($node->files)) {
$output = theme('table', $header, $rows);
}
if (user_access('upload files')) {
$output .= form_file(t('Attach new file'), "upload", 40);
$output .= form_button(t('Attach'), 'fileop');
}
return '<div class="attachments">'. form_group(t('Attachments'), $output, t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.')) .'</div>';
}
?>Login or register to post comments 