Index: diff.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.module,v
retrieving revision 1.8.2.8
diff -U3 -r1.8.2.8 diff.module
--- diff.module	6 Jun 2007 18:14:25 -0000	1.8.2.8
+++ diff.module	7 Dec 2007 21:14:35 -0000
@@ -416,14 +416,25 @@
  */
 function diff_form_alter($form_id, &$form) {
   if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
-    if (user_access('view revisions') && $form['nid']['#value'] > 0) {
+    // Node editing form: Add a 'Preview changes' button on the node edit form.
+    if (variable_get('show_preview_changes_'. $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) {
       $form['preview_changes'] = array('#type' => 'button', '#value' => t('Preview changes'), '#weight' => 41);
       // Change the form render callback to display the new button
       $form['#theme'] = 'diff_node_form';
       // Hijack the callback to handle showing of the diff if requested.
       $form['#after_build'] = array('diff_node_form_add_changes');
     }
-  }  
+  }
+  elseif ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
+    // Node type edit form: Add checkbox to activate 'preview changes' button per node type.
+    $form['workflow']['show_preview_changes'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Show %preview_changes button on node edit form', array('%preview_changes' => t('Preview changes'))),
+      '#prefix' => '<strong>' . t('Preview changes') . '</strong>',
+      '#weight' => 10,
+      '#default_value' => variable_get('show_preview_changes_'. $form['#node_type']->type, TRUE),
+    );
+  }
 }
 
 /**
