You are here

function _revisioning_publish_revision in Revisioning 6

Same name and namespace in other branches
  1. 8 revisioning_api.inc \_revisioning_publish_revision()
  2. 6.4 revisioning_api.inc \_revisioning_publish_revision()
  3. 6.3 revisioning_api.inc \_revisioning_publish_revision()
  4. 7 revisioning_api.inc \_revisioning_publish_revision()

Make the supplied revision of the node current and publish it.

Parameters

$nid: The id of the node

$vid: The id of the revision that is to be made current

$title: The title of the revision that is to be made current

$type: The node's content type (eg "story"), supplied only to make watchdog msg consistent with the node.module watchdog msgs.

2 calls to _revisioning_publish_revision()
revisioning_publish_confirm_submit in ./revisioning.module
Submission handler for the publish_confirm form.
revisioning_publish_latest_revision in ./revisioning.module
Find the most recent pending revision and make it current, unless it already is.

File

./revisioning.module, line 303

Code

function _revisioning_publish_revision($nid, $vid, $title, $type) {

  // Update node table, making sure the "published" (ie. status) flag is set
  db_query("UPDATE {node} SET vid=%d, title='%s', status=1 WHERE nid=%d", $vid, $title, $nid);
  cache_clear_all();
  drupal_set_message(t('Revision has been published.'));
  watchdog('content', 'Published rev #%revision of @type %title', array(
    '@type' => check_plain($type),
    '%title' => check_plain($title),
    '%revision' => $vid,
  ), WATCHDOG_NOTICE, l(t('view'), "node/{$nid}/revisions/{$vid}/view"));

  // Invoke the revisioning trigger passing 'publish' as the operation
  module_invoke_all('revisioning', 'publish');
}