You are here

function _webform_csv_data_grid in Webform 6.2

Same name and namespace in other branches
  1. 5.2 components/grid.inc \_webform_csv_data_grid()
  2. 5 components/grid.inc \_webform_csv_data_grid()
  3. 6.3 components/grid.inc \_webform_csv_data_grid()
  4. 7.4 components/grid.inc \_webform_csv_data_grid()
  5. 7.3 components/grid.inc \_webform_csv_data_grid()

Return 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.

Return value

Textual output formatted for CSV, not including either prefixed or trailing commas.

File

components/grid.inc, line 367
Webform module grid component.

Code

function _webform_csv_data_grid($data, $component) {
  $questions = array_keys(_webform_grid_options($component['extra']['questions']));
  $return = array();
  foreach ($questions as $key => $question) {
    $return[] = isset($data['value'][$key]) ? $data['value'][$key] : '';
  }
  return $return;
}