You are here

function revisioning_publish_latest_revision_action in Revisioning 6.3

Same name and namespace in other branches
  1. 8 revisioning_triggers_actions.inc \revisioning_publish_latest_revision_action()
  2. 6.4 revisioning_triggers_actions.inc \revisioning_publish_latest_revision_action()
  3. 6 revisioning_triggers_actions.inc \revisioning_publish_latest_revision_action()
  4. 7 revisioning_triggers_actions.inc \revisioning_publish_latest_revision_action()

Implementation of publish_latest_revision action

File

./revisioning_triggers_actions.inc, line 155
Triggers and actions supported by the revisioning module.

Code

function revisioning_publish_latest_revision_action(&$node, $context = array()) {
  $type = node_get_types('name', $node->type);
  watchdog('revisioning', 'Executing publish_latest_revision action for @type %title', array(
    '@type' => $type,
    '%title' => $node->title,
  ), WATCHDOG_NOTICE, l(t('view'), "node/{$node->nid}"));
  if (_revisioning_publish_latest_revision($node)) {
    drupal_set_message(t('Revision has been published.'));
  }
  else {
    drupal_set_message(t('"!title" has no pending revision to be published.', array(
      '!title' => check_plain($node->title),
    )), 'warning');
  }
}