From f746ed8ecc97a45db007002cd2d977cac3aad1cc Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Sun, 4 Aug 2013 23:57:00 -0400 Subject: Issue #1959110 by a.ross, fietserwin, markabur: Fixed theme_table() outputs the 'no_striping' option as an HTML attribute. --- includes/theme.inc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'includes/theme.inc') 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; } -- cgit v1.2.3