You are here

function revisioning_node_prepare in Revisioning 7

Same name and namespace in other branches
  1. 8 revisioning.module \revisioning_node_prepare()

Implements hook_node_prepare().

Called when presenting edit form.

File

./revisioning.module, line 507
Allows content to be updated and reviewed before submitting it for publication, while the current live revision remains unchanged and publicly visible until the changes have been reviewed and found fit for publication by a moderator.

Code

function revisioning_node_prepare($node) {
  if (!empty($node->nid)) {
    $count = _revisioning_get_number_of_revisions_newer_than($node->vid, $node->nid);
    if ($count == 1) {
      drupal_set_message(t('Please note there is one revision more recent than the one you are about to edit.'), 'warning');
    }
    elseif ($count > 1) {
      drupal_set_message(t('Please note there are @count revisions more recent than the one you are about to edit.', array(
        '@count' => $count,
      )), 'warning');
    }
  }
}