You are here

function node_revision_delete_confirm_submit in Drupal 4

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

File

modules/node.module, line 1402
The core that allows content to be submitted to the site.

Code

function node_revision_delete_confirm_submit($form_id, $form_values) {
  $node = node_load($form_values['nid'], $form_values['vid']);
  db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $node->nid, $node->vid);
  node_invoke_nodeapi($node, 'delete revision');
  drupal_set_message(t('Deleted %title revision %revision.', array(
    '%title' => theme('placeholder', $node->title),
    '%revision' => theme('placeholder', $node->vid),
  )));
  watchdog('content', t('%type: deleted %title revision %revision.', array(
    '%type' => theme('placeholder', t($node->type)),
    '%title' => theme('placeholder', $node->title),
    '%revision' => theme('placeholder', $node->revision),
  )));
  if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node->nid)) > 1) {
    return "node/{$node->nid}/revisions";
  }
  return "node/{$node->nid}";
}