--- views_bonus_export.module.orig 2010-06-14 12:47:18.000000000 -0500 +++ views_bonus_export.module 2010-06-14 12:58:36.000000000 -0500 @@ -76,15 +76,25 @@ function template_preprocess_views_bonus // Format header values. foreach ($vars['header'] as $key => $value) { + if ($vars['options']['trim']) { + $vars['header'][$key] = $wrap . str_replace('"', $replace_value, trim(decode_entities(strip_tags($value)))) . $wrap; + } + else { $vars['header'][$key] = $wrap . str_replace('"', $replace_value, decode_entities(strip_tags($value))) . $wrap; } + } // Format row values. foreach ($vars['themed_rows'] as $i => $values) { foreach ($values as $j => $value) { + if ($vars['options']['trim']) { + $vars['themed_rows'][$i][$j] = $wrap . str_replace('"', $replace_value, trim(decode_entities(strip_tags($value)))) . $wrap; + } + else { $vars['themed_rows'][$i][$j] = $wrap . str_replace('"', $replace_value, decode_entities(strip_tags($value))) . $wrap; } } } +} /** * Preprocess txt output template. --- views_bonus_plugin_style_export_csv.inc.orig 2010-06-14 12:59:11.000000000 -0500 +++ views_bonus_plugin_style_export_csv.inc 2010-06-14 12:59:12.000000000 -0500 @@ -75,6 +75,11 @@ class views_bonus_plugin_style_export_cs '#default_value' => !empty($this->options['quote']), '#title' => t('Quote values. Useful for output that might contain your seperator as part of one of the values.'), ); + $form['trim'] = array( + '#type' => 'checkbox', + '#default_value' => !empty($this->options['trim']), + '#title' => t('Trim whitespace from rendered fields. Might be useful for some themes.'), + ); $form['header'] = array( '#type' => 'checkbox', '#title' => t('Make first row a list of column headers.'),