commit 91f06e657626ceb1a108a37e6ad38edafe15d2a3 Author: gnuget Date: Tue Jun 3 00:58:56 2014 -0500 Adding the suggestions of Mark Carver diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 09fb7bf..72cc0c8 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1423,13 +1423,13 @@ function drupal_pre_render_table(array $element) { * - header: An array containing the table headers. Each element of the array * can be either a localized string or an associative array with the * following keys: - * - "data": The localized title of the table column. - * - "field": The database field represented in the table column (required + * - data: The localized title of the table column. + * - field: The database field represented in the table column (required * if user is to be able to sort on this column). - * - "sort": A default sort order for this column ("asc" or "desc"). Only + * - sort: A default sort order for this column ("asc" or "desc"). Only * one column should be given a default sort order because table sorting * only applies to one column at a time. - * - "class": An array of values for the 'class' attribute. In particular, + * - class: An array of values for the 'class' attribute. In particular, * the least important columns that can be hidden on narrow and medium * width screens should have a 'priority-low' class, referenced with the * RESPONSIVE_PRIORITY_LOW constant. Columns that should be shown on @@ -1441,14 +1441,14 @@ function drupal_pre_render_table(array $element) { * cell. * - rows: An array of table rows. Every row is an array of cells, or an * associative array with the following keys: - * - "data": an array of cells + * - data: an array of cells. * - Any HTML attributes, such as "class", to apply to the table row. - * - "no_striping": a boolean indicating that the row should receive no + * - no_striping: a boolean indicating that the row should receive no * 'even / odd' styling. Defaults to FALSE. * Each cell can be either a string or an associative array with the * following keys: - * - "data": The string to display in the table cell. - * - "header": Indicates this cell is a header. + * - data: The string to display in the table cell. + * - header: Indicates this cell is a header. * - Any HTML attributes, such as "colspan", to apply to the table cell. * Here's an example for $rows: * @code @@ -1459,22 +1459,27 @@ function drupal_pre_render_table(array $element) { * ), * // Row with attributes on the row and some of its cells. * array( - * 'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => array('funky') - * ) + * 'data' => array( + * 'Cell 1', array( + * 'data' => 'Cell 2', 'colspan' => 2 + * ), + * ), + * 'class' => array('funky') + * ), * ); * @endcode * - footer: An array of table rows which will be printed within a * tag. * Every row is an array of cells, or an associative array with the * following keys: - * - "data": an array of cells + * - data: an array of cells. * - Any HTML attributes, such as "class", to apply to the table row. - * - "no_striping": a boolean indicating that the row should receive no + * - no_striping: a boolean indicating that the row should receive no * 'even / odd' styling. Defaults to TRUE. * Each cell can be either a string or an associative array with the * following keys: - * - "data": The string to display in the table cell. - * - "header": Indicates this cell is a header. + * - data: The string to display in the table cell. + * - header: Indicates this cell is a header. * - Any HTML attributes, such as "colspan", to apply to the table cell. * Here's an example for $rows: * @code @@ -1485,8 +1490,14 @@ function drupal_pre_render_table(array $element) { * ), * // Row with attributes on the row and some of its cells. * array( - * 'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => array('funky') - * ) + * 'data' => array( + * 'Cell 1', + * array( + * 'data' => 'Cell 2', 'colspan' => 2 + * ), + * ), + * 'class' => array('funky') + * ), * ); * @endcode * - attributes: An array of HTML attributes to apply to the table tag. @@ -1636,7 +1647,7 @@ function template_preprocess_table(&$variables) { foreach ($variables[$section] as $row_key => $row) { $cells = $row; $row_attributes = array(); - $no_striping = ($section === 'rows') ? FALSE : TRUE; + $no_striping = $section === 'footer'; // Check if we're dealing with a simple or complex row if (isset($row['data'])) {