function diff_form_node_form_alter in Diff 7.3
Implements hook_form_BASE_FORM_ID_alter().
File
- ./
diff.module, line 366 - Provides functionality to show a diff between two node revisions.
Code
function diff_form_node_form_alter(&$form, $form_state) {
// Add a 'View changes' button on the node edit form.
$node = $form['#node'];
if (variable_get('diff_show_preview_changes_node_' . $node->type, TRUE) && user_access('diff view changes') && !empty($node->nid)) {
$form['actions']['preview_changes'] = array(
'#type' => 'submit',
'#value' => t('View changes'),
'#weight' => 12,
'#submit' => array(
'diff_node_form_build_preview_changes',
),
);
}
}