#156144 by lyricnz: do not show 'select all' checbox when there are no rows in the node admin table

6.x
Gábor Hojtsy 2007-10-24 09:15:04 +00:00
parent bb9bae4d97
commit c5fb69fb08
1 changed files with 6 additions and 3 deletions

View File

@ -406,8 +406,11 @@ function node_admin_nodes() {
* Theme node administration overview. * Theme node administration overview.
*/ */
function theme_node_admin_nodes($form) { function theme_node_admin_nodes($form) {
// Overview table: // If there are rows in this form, then $form['title'] contains a list of
$header = array(theme('table_select_header_cell'), t('Title'), t('Type'), t('Author'), t('Status')); // the title form elements.
$has_posts = isset($form['title']) && is_array($form['title']);
$select_header = $has_posts ? theme('table_select_header_cell') : '';
$header = array($select_header, t('Title'), t('Type'), t('Author'), t('Status'));
if (isset($form['language'])) { if (isset($form['language'])) {
$header[] = t('Language'); $header[] = t('Language');
} }
@ -415,7 +418,7 @@ function theme_node_admin_nodes($form) {
$output = ''; $output = '';
$output .= drupal_render($form['options']); $output .= drupal_render($form['options']);
if (isset($form['title']) && is_array($form['title'])) { if ($has_posts) {
foreach (element_children($form['title']) as $key) { foreach (element_children($form['title']) as $key) {
$row = array(); $row = array();
$row[] = drupal_render($form['nodes'][$key]); $row[] = drupal_render($form['nodes'][$key]);