Here's a piece of code for the CVS version to add a 'check / uncheck all' checkbox. In long lists of trackbacks, this enables the selection of all listed trackbacks with one mouse click. Apologies if the code isn't particularly sophisticated - but at least it works.

This builds on my patch for 4.6.0 (see issue http://drupal.org/node/28094), and again uses modified versions of Shawn Olson's original scripts. The patch assumes that you've added patches http://drupal.org/node/54939 and http://drupal.org/files/issues/fix-64979.patch, which only enable the proper display of trackback lists in the first place.

Here's the patch code - insert around line 426 in the CVS version of trackback.module (after the close of the while() clause which populates $form['trackbacks']):

  $form['checkall'] = array(
      '#type' => 'fieldset',
      '#title' => t('Check / uncheck all')
      );
  $form['checkall']['operation'] = array(
      '#prefix' => '<script type="text/javascript">
function checkUncheckAll(theElement) {
	 //documentation for this script at http://www.shawnolson.net/a/693/
     var theForm = document.getElementById(\'trackback_admin_overview\'), z = 0;
     while (theForm[z].name != \'checkall\') {
      if (theForm[z].type == \'checkbox\') {
        theForm[z].checked = theElement.checked;
      }
      z++;
     }
    }
</script>',
      '#type' => 'checkbox',
      '#attributes' => array('onclick' => 'checkUncheckAll(this);'),
      '#default_value' => 0,
      '#title' => t('Check / uncheck all items in the list')
      );

Comments

Anonymous’s picture

Status: Fixed » Closed (fixed)