You are here

function node_tools_form_alter in Module Grants 6.4

Same name and namespace in other branches
  1. 6.3 node_tools/node_tools.module \node_tools_form_alter()

Implementation of hook_form_alter().

File

node_tools/node_tools.module, line 84
Generic reusable functions involving node objects.

Code

function node_tools_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['#id']) && $form['#id'] == 'node-form') {
    $nid = $form['#node']->nid;
    if (isset($form['buttons']['delete']) && node_tools_get_number_of_revisions($nid) > 1) {

      // Special treatment for Delete button when there's multiple revisions.
      // Make it obvious to the user that a 'Delete' is in fact 'Delete all'.
      $form['buttons']['delete']['#value'] = t('Delete all revisions');
    }
  }
}