function ViewsDataExportExporterDOC::add_row in Views data export 7.4
Add a row to our (HTML table) word document.
Parameters
$file_handle:
array $data:
int $row_count:
$field_titles:
Overrides ViewsDataExportExporter::add_row
File
- exporters/
views_data_export_exporter_doc.inc, line 31
Class
- ViewsDataExportExporterDOC
- This exporter creates a DOC file readable by Microsoft Word. The content is an HTML table, as used by the old XLS export mechanism.
Code
function add_row(&$file_handle, $data, $row_count, $field_titles) {
$stripes = array(
"odd",
"even",
);
$row = $row_count + 1;
$output = ' <tr class="' . $stripes[$row_count % 2] . '">';
foreach ($data as $key => $value) {
$output .= '<td>' . $value . '</td>';
}
$output .= '</tr>';
$output .= PHP_EOL;
$row++;
fwrite($file_handle, $output);
}