You are here

function _webform_submission_display_date in Webform 5.2

Same name and namespace in other branches
  1. 5 components/date.inc \_webform_submission_display_date()
  2. 6.2 components/date.inc \_webform_submission_display_date()

Display the result of a textfield submission. The output of this function will be displayed under the "results" tab then "submissions".

Parameters

$data: An array of information containing the submission result, directly correlating to the webform_submitted_data database schema.

$component: An array of information describing the component, directly correlating to the webform_component database schema.

$enabled: If enabled, the value may be changed. Otherwise it will set to readonly.

Return value

Textual output formatted for human reading.

File

components/date.inc, line 270
Webform module date component.

Code

function _webform_submission_display_date($data, $component, $enabled = FALSE) {
  $form_item = _webform_render_date($component);
  $form_item['month']['#default_value'] = $data['value']['0'];
  $form_item['day']['#default_value'] = $data['value']['1'];
  $form_item['year']['#default_value'] = $data['value']['2'];
  $form_item['#disabled'] = !$enabled;
  return $form_item;
}