You are here

function _webform_display_file in Webform 7.3

Same name and namespace in other branches
  1. 6.3 components/file.inc \_webform_display_file()
  2. 7.4 components/file.inc \_webform_display_file()

Implements _webform_display_component().

File

components/file.inc, line 372
Webform module file component.

Code

function _webform_display_file($component, $value, $format = 'html') {
  $fid = isset($value[0]) ? $value[0] : NULL;
  return array(
    '#title' => $component['name'],
    '#value' => $fid ? webform_get_file($fid) : NULL,
    '#weight' => $component['weight'],
    '#theme' => 'webform_display_file',
    '#theme_wrappers' => $format == 'text' ? array(
      'webform_element_text',
    ) : array(
      'webform_element',
    ),
    '#format' => $format,
    '#translatable' => array(
      'title',
    ),
  );
}