You are here

function _webform_submission_display_grid in Webform 6.2

Same name and namespace in other branches
  1. 5.2 components/grid.inc \_webform_submission_display_grid()
  2. 5 components/grid.inc \_webform_submission_display_grid()

Display the result of a grid 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/grid.inc, line 144
Webform module grid component.

Code

function _webform_submission_display_grid($data, $component, $enabled = FALSE) {
  $form_item = _webform_render_grid($component, FALSE);
  $cid = 0;
  foreach (element_children($form_item) as $key) {
    $form_item[$key]['#default_value'] = $data['value'][$cid++];
    $form_item[$key]['#disabled'] = !$enabled;
  }
  return $form_item;
}