You are here

function revisioning_condition_revision_is in Revisioning 6.3

Same name and namespace in other branches
  1. 8 revisioning.rules.inc \revisioning_condition_revision_is()
  2. 6.4 revisioning.rules.inc \revisioning_condition_revision_is()
  3. 7 revisioning.rules.inc \revisioning_condition_revision_is()

File

./revisioning.rules.inc, line 47
Rules integration for Revisioning module.

Code

function revisioning_condition_revision_is($node, $settings) {

  // For some reason, when a node is published, rather than updated, $node will
  // be the nid, without any vid info, so we can't load the revision.
  if (!is_object($node) || empty($node->revision_moderation)) {
    return FALSE;
  }
  $node->is_current = node_tools_revision_is_current($node);
  $node->is_pending = _revisioning_node_is_pending($node);
  $node->num_revisions = node_tools_get_number_of_revisions($node->nid);
  $type = _revisioning_revision_is($node);
  return in_array($type, $settings['revision_type']);
}