Commit 725481d7 authored by Dries's avatar Dries
Browse files

- Patch #768490 by JohnAlbin, sign: theme_table_select_header_cell() is not...

- Patch #768490 by JohnAlbin, sign: theme_table_select_header_cell() is not really a theme function.
parent 63dba2a0
...@@ -5537,9 +5537,6 @@ function drupal_common_theme() { ...@@ -5537,9 +5537,6 @@ function drupal_common_theme() {
'table' => array( 'table' => array(
'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''), '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( 'tablesort_indicator' => array(
'variables' => array('style' => NULL), 'variables' => array('style' => NULL),
), ),
......
...@@ -2542,8 +2542,10 @@ function theme_tableselect($variables) { ...@@ -2542,8 +2542,10 @@ function theme_tableselect($variables) {
} }
// Add an empty header or a "Select all" checkbox to provide room for the // Add an empty header or a "Select all" checkbox to provide room for the
// checkboxes/radios in the first table column. // checkboxes/radios in the first table column.
$first_col = $element['#js_select'] ? array(theme('table_select_header_cell')) : array(''); if ($element['#js_select']) {
$header = array_merge($first_col, $header); 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'])); return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes']));
} }
......
...@@ -1743,18 +1743,6 @@ function theme_table($variables) { ...@@ -1743,18 +1743,6 @@ function theme_table($variables) {
return $output; return $output;
} }
/**
* 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. * Returns HTML for a sort icon.
* *
......
...@@ -71,10 +71,11 @@ function theme_simpletest_test_table($variables) { ...@@ -71,10 +71,11 @@ function theme_simpletest_test_table($variables) {
drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css');
drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js');
drupal_add_js('misc/tableselect.js');
// Create header for test selection table. // Create header for test selection table.
$header = array( $header = array(
theme('table_select_header_cell'), array('class' => array('select-all')),
array('data' => t('Test'), 'class' => array('simpletest_test')), array('data' => t('Test'), 'class' => array('simpletest_test')),
array('data' => t('Description'), 'class' => array('simpletest_description')), array('data' => t('Description'), 'class' => array('simpletest_description')),
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment