You are here

function _views_pivot_add_field_classes in Pivot Tables for Views 7

Helper function to add field classes, called by _views_pivot_add_field_to_row

Parameters

$vars:

$fields:

$num:

$row_key:

$field:

See also

_views_pivot_add_field_to_row

1 call to _views_pivot_add_field_classes()
_views_pivot_add_field_to_row in ./views_pivot.theme.inc
Helper function to add a field to a table row, called by template_preprocess_views_view_pivot_table

File

./views_pivot.theme.inc, line 430

Code

function _views_pivot_add_field_classes(&$vars, $fields, $num, $row_key, $field) {

  /* @var $field_handler views_handler_field_field */
  $field_handler = $fields[$field];

  // Add field classes
  $vars['field_classes'][$field][$row_key] = '';
  if ($field_handler->options['element_default_classes']) {
    $vars['field_classes'][$field][$row_key] = "views-field views-field-" . $field;
  }
  if ($classes = $field_handler
    ->element_classes($num)) {
    if ($vars['field_classes'][$field][$row_key]) {
      $vars['field_classes'][$field][$row_key] .= ' ';
    }
    $vars['field_classes'][$field][$row_key] .= $classes;
  }
  $vars['field_attributes'][$field][$row_key] = array();
}