function _webform_csv_data_grid in Webform 7.4
Same name and namespace in other branches
- 5.2 components/grid.inc \_webform_csv_data_grid()
- 5 components/grid.inc \_webform_csv_data_grid()
- 6.3 components/grid.inc \_webform_csv_data_grid()
- 6.2 components/grid.inc \_webform_csv_data_grid()
- 7.3 components/grid.inc \_webform_csv_data_grid()
Implements _webform_csv_data_component().
File
- components/
grid.inc, line 623 - Webform module grid component.
Code
function _webform_csv_data_grid($component, $export_options, $value) {
$node = node_load($component['nid']);
$questions = _webform_select_options_from_text($component['extra']['questions'], TRUE);
$questions = _webform_select_replace_tokens($questions, $node);
$options = _webform_select_options_from_text($component['extra']['options'], TRUE);
$options = _webform_select_replace_tokens($options, $node);
$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;
}