You are here

function _webform_table_multifile in Webform Multiple File Upload 6

Same name and namespace in other branches
  1. 7 multifile.inc \_webform_table_multifile()

Implementation of _webform_table_component().

File

./multifile.inc, line 664
Webform module file component.

Code

function _webform_table_multifile($component, $value) {
  module_load_include('inc', 'webform_multifile', 'safe_unserialize');
  $links = array();
  if ($fids = isset($value[0]) ? safe_unserialize($value[0]) : FALSE) {
    foreach (webform_get_multifile($fids) as $file) {
      if (!empty($file->fid)) {
        $link = l(webform_multifile_name($file->filename), webform_multifile_url($file->filepath));
        $link .= ' (' . (int) ($file->filesize / 1024) . ' KB)';
        $links[] = $link;
      }
    }
  }
  return implode("<br />\n", $links);
}