function _webform_display_file in Webform 6.3
Same name and namespace in other branches
- 7.4 components/file.inc \_webform_display_file()
- 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',
),
);
}