function diff_form_alter in Diff 7.2
Same name and namespace in other branches
- 5.2 diff.module \diff_form_alter()
- 5 diff.module \diff_form_alter()
- 6.2 diff.module \diff_form_alter()
- 6 diff.module \diff_form_alter()
Implements hook_form_alter().
File
- ./
diff.module, line 157 - Provides functionality to show a diff between two node revisions.
Code
function diff_form_alter(&$form, &$form_state, $form_id) {
if (!empty($form['#node_edit_form'])) {
// Add a 'View changes' button on the node edit form.
if (variable_get('show_preview_changes_' . $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) {
$form['actions']['preview_changes'] = array(
'#type' => 'submit',
'#value' => t('View changes'),
'#weight' => 12,
'#submit' => array(
'diff_node_form_build_preview_changes',
),
);
}
}
}