From 92760988b9decb01831ba89bcc54056a702c3836 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 2 Dec 2009 14:56:32 +0000 Subject: - Patch #648410 by Dave Reid: standardize add 'empty' row functionality to all tables. --- includes/form.inc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'includes/form.inc') diff --git a/includes/form.inc b/includes/form.inc index 39090a349..6e992e5c6 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -2338,6 +2338,7 @@ function theme_container($variables) { function theme_tableselect($variables) { $element = $variables['element']; $rows = array(); + $header = $element['#header']; if (!empty($element['#options'])) { // Generate a table row for each selectable item in #options. foreach ($element['#options'] as $key => $value) { @@ -2360,15 +2361,9 @@ function theme_tableselect($variables) { // Add an empty header or a "Select all" checkbox to provide room for the // checkboxes/radios in the first table column. $first_col = $element['#js_select'] ? array(theme('table_select_header_cell')) : array(''); - $header = array_merge($first_col, $element['#header']); + $header = array_merge($first_col, $header); } - else { - // If there are no selectable options, display the empty text over the - // entire width of the table. - $header = $element['#header']; - $rows[] = array(array('data' => $element['#empty'], 'colspan' => count($header))); - } - return theme('table', array('header' => $header, 'rows' => $rows)); + return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'])); } /** -- cgit v1.2.3