/ Published in: PHP
Create theme override file: `upload_attachments.tpl.php` in your theme directory.
[CSS styles](http://snipplr.com/view/11848)
[CSS styles](http://snipplr.com/view/11848)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php /** * Themed attachments table */ foreach ($files as $file) { // Quick fix. Should use some kind of make_safe_for_css() function. $href = check_url(($file->fid ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path())))); /* To do: if (!empty($file->description)) { $text = check_plain($file->description) . '<br /><span class="filename">'.$file->filename.'</span>'; } else { $text = check_plain($file->filename); } */ $text = check_plain($file->description ? $file->description : $file->filename); // Because the drupal format_size function doesn't round far enough to be smooth. $suffix = t('bytes'); if ($size >= 1024) { $suffix = t('KB'); } if ($size >= 1024) { $suffix = t('MB'); } if ($type == 'jpeg' ) { } else { } } } print '<div class="attachments">'. theme('table', $header, $rows, array('class' => 'attachments'), 'Downloadable files') .'</div>'; }