Drupal 5: Adding a node preview to the node delete confirmation page

This code snippet will add a collapsible fieldset containing a preview of the node you are attempting to delete.

<?php
function MYMODULE_form_alter($form_id, &$form) {
  if ($form_id == 'node_delete_confirm') {
    $form['nodePreviewFieldset'] = array(
      '#type' => 'fieldset',
      '#title' => 'Preview',
      '#weight' => 10,
      '#collapsed' => TRUE,
      '#collapsible' => TRUE,
    );

    $form['nodePreviewFieldset']['nodePreview'] = array(
      '#value' => node_view(node_load(arg(1)), TRUE, FALSE, FALSE)
    );
  }
}
?>

Here’s a screenshot:

node delete preview

Updated: