You are here

function node_revision_revert_confirm in Drupal 7

Same name and namespace in other branches
  1. 5 modules/node/node.module \node_revision_revert_confirm()
  2. 6 modules/node/node.pages.inc \node_revision_revert_confirm()

Asks for confirmation of the reversion to prevent against CSRF attacks.

Parameters

int $node_revision: The node revision ID.

Return value

array An array as expected by drupal_render().

See also

node_menu()

node_revision_revert_confirm_submit()

Related topics

1 string reference to 'node_revision_revert_confirm'
node_menu in modules/node/node.module
Implements hook_menu().

File

modules/node/node.pages.inc, line 627
Page callbacks for adding, editing, deleting, and revisions management for content.

Code

function node_revision_revert_confirm($form, $form_state, $node_revision) {
  $form['#node_revision'] = $node_revision;
  return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array(
    '%revision-date' => format_date($node_revision->revision_timestamp),
  )), 'node/' . $node_revision->nid . '/revisions', '', t('Revert'), t('Cancel'));
}