diff options
-rw-r--r-- | includes/common.inc | 3 | ||||
-rw-r--r-- | includes/form.inc | 6 | ||||
-rw-r--r-- | includes/theme.inc | 12 | ||||
-rw-r--r-- | modules/simpletest/simpletest.pages.inc | 3 |
4 files changed, 6 insertions, 18 deletions
diff --git a/includes/common.inc b/includes/common.inc index 0190d189a..0f93e34da 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5537,9 +5537,6 @@ function drupal_common_theme() { 'table' => array( 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''), ), - 'table_select_header_cell' => array( - 'variables' => array(), - ), 'tablesort_indicator' => array( 'variables' => array('style' => NULL), ), diff --git a/includes/form.inc b/includes/form.inc index affd82b0e..68f24f65c 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -2542,8 +2542,10 @@ 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, $header); + if ($element['#js_select']) { + drupal_add_js('misc/tableselect.js'); + array_unshift($header, array('class' => array('select-all'))); + } } return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes'])); } diff --git a/includes/theme.inc b/includes/theme.inc index 7ddba732b..705ba1328 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1744,18 +1744,6 @@ function theme_table($variables) { } /** - * Returns attributes for a header cell of tables with select all functionality. - * - * @return - * An array of attributes. - */ -function theme_table_select_header_cell() { - drupal_add_js('misc/tableselect.js'); - - return array('class' => array('select-all')); -} - -/** * Returns HTML for a sort icon. * * @param $variables diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 0fff1889c..49bf3ec57 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -71,10 +71,11 @@ function theme_simpletest_test_table($variables) { drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); + drupal_add_js('misc/tableselect.js'); // Create header for test selection table. $header = array( - theme('table_select_header_cell'), + array('class' => array('select-all')), array('data' => t('Test'), 'class' => array('simpletest_test')), array('data' => t('Description'), 'class' => array('simpletest_description')), ); |