summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-02 14:56:32 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-02 14:56:32 +0000
commit92760988b9decb01831ba89bcc54056a702c3836 (patch)
tree4a27865ed1737d832e82a575521940503147cd43 /includes/form.inc
parente7dedc4330f3d7bbc4fd861a4e5619d780bcca6c (diff)
downloadbrdo-92760988b9decb01831ba89bcc54056a702c3836.tar.gz
brdo-92760988b9decb01831ba89bcc54056a702c3836.tar.bz2
- Patch #648410 by Dave Reid: standardize add 'empty' row functionality to all tables.
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc11
1 files changed, 3 insertions, 8 deletions
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']));
}
/**