- _webform_submission_display_file in contributions/webform/components/file.inc
- Display the result of a file submission. The output of this function will be displayed under the "results" tab then "submissions".
_webform_render_file($component)_webform_render_file($component, $value = NULL)Build a form item array containing all the properties of this component.
$component An array of information describing the component, directly correlating to the webform_component database schema.
An array of a form item to be displayed on the client-side webform.
contributions/webform/components/file.inc, line 180
<?php
function _webform_render_file($component) {
$form_item = array(
'#type' => $component['type'],
'#title' => $component['name'],
//'#required' => $component['mandatory'], // Drupal core bug with required file uploads
'#weight' => $component['weight'],
'#description' => _webform_filtervalues($component['extra']['description']),
'#attributes' => $component['extra']['attributes'],
'#tree' => false, // file_check_upload assumes a flat $_FILES structure.
'#validate' => array(
'_webform_validate_file' => array($component['form_key'], $component['name'], $component['extra']['filtering']),
'_webform_required_file' => array($component['form_key'], $component['name'], $component['mandatory']), // Custom required routine.
),
'#prefix' => '<div class="webform-component-'. $component['type'] .'" id="webform-component-'. $component['form_key'] .'">',
'#suffix' => '</div>',
);
return $form_item;
}
?>