You are here

function node_revision_revert_confirm in Drupal 5

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

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

1 string reference to 'node_revision_revert_confirm'
node_revision_revert in modules/node/node.module
Revert to the revision with the specified revision number. A node and nodeapi "update" event is triggered (via the node_save() call) when a revision is reverted.

File

modules/node/node.module, line 1782
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_revision_revert_confirm($node) {
  $form['node'] = array(
    '#type' => 'value',
    '#value' => $node,
  );
  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_timestamp),
  )), 'node/' . $node->nid . '/revisions', '', t('Revert'), t('Cancel'));
}