function node_revision_delete_confirm_submit in Drupal 6
Same name and namespace in other branches
- 4 modules/node.module \node_revision_delete_confirm_submit()
- 5 modules/node/node.module \node_revision_delete_confirm_submit()
- 7 modules/node/node.pages.inc \node_revision_delete_confirm_submit()
File
- modules/
node/ node.pages.inc, line 599 - Page callbacks for adding, editing, deleting, and revisions management for content.
Code
function node_revision_delete_confirm_submit($form, &$form_state) {
$node_revision = $form['#node_revision'];
db_query("DELETE FROM {node_revisions} WHERE nid = %d AND vid = %d", $node_revision->nid, $node_revision->vid);
node_invoke_nodeapi($node_revision, 'delete revision');
watchdog('content', '@type: deleted %title revision %revision.', array(
'@type' => $node_revision->type,
'%title' => $node_revision->title,
'%revision' => $node_revision->vid,
));
drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array(
'%revision-date' => format_date($node_revision->revision_timestamp),
'@type' => node_get_types('name', $node_revision),
'%title' => $node_revision->title,
)));
$form_state['redirect'] = 'node/' . $node_revision->nid;
if (db_result(db_query('SELECT COUNT(vid) FROM {node_revisions} WHERE nid = %d', $node_revision->nid)) > 1) {
$form_state['redirect'] .= '/revisions';
}
}