You are here

function _webform_csv_data_grid in Webform 6.3

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.2 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()

Implements _webform_csv_data_component().

File

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

Code

function _webform_csv_data_grid($component, $export_options, $value) {
  $questions = _webform_select_options_from_text($component['extra']['questions'], TRUE);
  $options = _webform_select_options_from_text($component['extra']['options'], TRUE);
  $return = array();
  foreach ($questions as $key => $question) {
    if (isset($value[$key]) && isset($options[$value[$key]])) {
      $return[] = $export_options['select_keys'] ? $value[$key] : $options[$value[$key]];
    }
    else {
      $return[] = '';
    }
  }
  return $return;
}