You are here

function _webform_display_file in Webform 6.3

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

Implements _webform_display_component().

File

components/file.inc, line 488
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 == 'html' ? array(
      'webform_element',
      'webform_element_wrapper',
    ) : array(
      'webform_element_text',
    ),
    '#post_render' => array(
      'webform_element_wrapper',
    ),
    '#format' => $format,
    '#translatable' => array(
      'title',
    ),
  );
}