### Eclipse Workspace Patch 1.0
#P Drupal HEAD (Core)
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.717
diff -u -r1.717 node.module
--- modules/node/node.module	26 Oct 2006 05:31:14 -0000	1.717
+++ modules/node/node.module	30 Oct 2006 20:55:01 -0000
@@ -1469,6 +1469,8 @@
 }
 
 function node_admin_nodes() {
+  drupal_add_js('misc/checkbox.js');
+
   global $form_values;
   $filter = node_build_filter_query();
 
@@ -1505,7 +1507,7 @@
  */
 function theme_node_admin_nodes($form) {
   // Overview table:
-  $header = array(NULL, t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
+  $header = array(array('class' => 'checkall'), t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
 
   $output .= drupal_render($form['options']);
   if (isset($form['title']) && is_array($form['title'])) {
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.703
diff -u -r1.703 user.module
--- modules/user/user.module	28 Oct 2006 15:13:41 -0000	1.703
+++ modules/user/user.module	30 Oct 2006 20:55:04 -0000
@@ -1955,6 +1955,8 @@
 }
 
 function user_admin_account() {
+  drupal_add_js('misc/checkbox.js');
+
   $filter = user_build_filter_query();
 
   $header = array(
@@ -2026,7 +2028,7 @@
 function theme_user_admin_account($form) {
   // Overview table:
   $header = array(
-    array(),
+    array('class' => 'checkall'),
     array('data' => t('Username'), 'field' => 'u.name'),
     array('data' => t('Status'), 'field' => 'u.status'),
     t('Roles'),
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.494
diff -u -r1.494 comment.module
--- modules/comment/comment.module	24 Oct 2006 20:31:25 -0000	1.494
+++ modules/comment/comment.module	30 Oct 2006 20:54:58 -0000
@@ -1028,6 +1028,8 @@
 }
 
 function comment_admin_overview($type = 'new', $arg) {
+  drupal_add_js('misc/checkbox.js');
+
   // build an 'Update options' form
   $form['options'] = array(
     '#type' => 'fieldset', '#title' => t('Update options'),
@@ -1043,7 +1045,7 @@
   // load the comments that we want to display
   $status = ($type == 'approval') ? COMMENT_NOT_PUBLISHED : COMMENT_PUBLISHED;
   $form['header'] = array('#type' => 'value', '#value' => array(
-    NULL,
+    array('class' => 'checkall'),
     array('data' => t('Subject'), 'field' => 'subject'),
     array('data' => t('Author'), 'field' => 'name'),
     array('data' => t('Time'), 'field' => 'timestamp', 'sort' => 'desc'),
Index: misc/checkbox.js
===================================================================
RCS file: misc/checkbox.js
diff -N misc/checkbox.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ misc/checkbox.js	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,19 @@
+// $Id: $
+
+Drupal.checkAllAttach = function() {
+  // Look for an element with class="checkall" and insert a check box into it
+  // that will check/uncheck all check boxes within the enclosing form.
+  $(".checkall").each(function() {
+    $('<input type="checkbox" class="form-checkbox" />').click(function() {
+      var state = this.checked;
+      $(this.form).find("input[@type='checkbox']").each(function() {
+        this.checked = state;
+      });
+    }).appendTo(this);
+  });
+}
+
+// Global Killswitch
+if (Drupal.jsEnabled) {
+  $(document).ready(Drupal.checkAllAttach);
+}
