The Populate Row function is used to take a lot of the repetitive code out of our theming function. It's fairly straight forward, you'll see the same sort of setting of data and class in the header on the theming function itself. All we're doing here is setting what the data for each cell of a row is going to be, and then assigning classes to those cells as necessary.
<?php
function populate_row_by_cell($ctype, &$cell, &$row, &$fields, &$field, &$node, &$view, $more_class) {
// Does something fairly simple... just gets done a lot...
// so emulate a subroutine by passing all the fields in by reference
// so that they are changed outside the scope of this function
$cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
$cell['class'] = $ctype;
if ($more_class) {
$cell['class'] .= ' '. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
}
$row[] = $cell;
}
?>