diff options
author | David Rothstein <drothstein@gmail.com> | 2013-08-04 23:57:00 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2013-08-04 23:57:00 -0400 |
commit | f746ed8ecc97a45db007002cd2d977cac3aad1cc (patch) | |
tree | 663d83f16a93c13e3164832e0000754b56ea6d26 /includes/theme.inc | |
parent | d6f960c6d04f2a2a8c43a39e5aa76673d89fac9d (diff) | |
download | brdo-f746ed8ecc97a45db007002cd2d977cac3aad1cc.tar.gz brdo-f746ed8ecc97a45db007002cd2d977cac3aad1cc.tar.bz2 |
Issue #1959110 by a.ross, fietserwin, markabur: Fixed theme_table() outputs the 'no_striping' option as an HTML attribute.
Diffstat (limited to 'includes/theme.inc')
-rw-r--r-- | includes/theme.inc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 5ae0fea20..ee73965d9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1987,25 +1987,24 @@ function theme_table($variables) { $flip = array('even' => 'odd', 'odd' => 'even'); $class = 'even'; foreach ($rows as $number => $row) { - $attributes = array(); - // Check if we're dealing with a simple or complex row if (isset($row['data'])) { - foreach ($row as $key => $value) { - if ($key == 'data') { - $cells = $value; - } - else { - $attributes[$key] = $value; - } - } + $cells = $row['data']; + $no_striping = isset($row['no_striping']) ? $row['no_striping'] : FALSE; + + // Set the attributes array and exclude 'data' and 'no_striping'. + $attributes = $row; + unset($attributes['data']); + unset($attributes['no_striping']); } else { $cells = $row; + $attributes = array(); + $no_striping = FALSE; } if (count($cells)) { // Add odd/even class - if (empty($row['no_striping'])) { + if (!$no_striping) { $class = $flip[$class]; $attributes['class'][] = $class; } |