You are here

function apigee_edge_preprocess_table in Apigee Edge 8

Implements hook_preprocess_table().

File

./apigee_edge.module, line 1587
Copyright 2018 Google Inc.

Code

function apigee_edge_preprocess_table(&$variables) {
  if (isset($variables['attributes']['id']) && $variables['attributes']['id'] === 'app-list') {
    $variables['no_striping'] = TRUE;
    $index = 0;
    foreach ($variables['rows'] as $row) {
      if ($row['attributes']
        ->hasClass('row--info')) {
        if ($index % 2 === 0) {
          $row['attributes']
            ->addClass('odd');
          $index++;
        }
        else {
          $row['attributes']
            ->addClass('even');
          $index++;
        }
      }
    }
  }
}