theme_file_formatter_table
function theme_file_formatter_table
theme_file_formatter_table($variables)
Returns HTML for a file attachments table.
Parameters
$variables: An associative array containing:
- items: An array of file attachments.
Related topics
File
- modules/file/file.field.inc, line 1020
- Field module functionality for the File module.
Code
function theme_file_formatter_table($variables) { $header = array(t('Attachment'), t('Size')); $rows = array(); foreach ($variables['items'] as $delta => $item) { $rows[] = array( theme('file_link', array('file' => (object) $item)), format_size($item['filesize']), ); } return empty($rows) ? '' : theme('table', array('header' => $header, 'rows' => $rows)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!file!file.field.inc/function/theme_file_formatter_table/7.x