You are here

function _diff_get_previous_vid in Diff 5

Same name and namespace in other branches
  1. 5.2 diff.module \_diff_get_previous_vid()
  2. 6.2 diff.pages.inc \_diff_get_previous_vid()
  3. 6 diff.module \_diff_get_previous_vid()
  4. 7.3 diff.pages.inc \_diff_get_previous_vid()
  5. 7.2 diff.pages.inc \_diff_get_previous_vid()

Get the entry in the revision list before $vid. Returns false if $vid is the first entry.

Parameters

$node_revisions: Array of node revision IDs in descending order.

$vid: Version ID to look for.

1 call to _diff_get_previous_vid()
diff_diffs_show in ./diff.module
Create output string for a comparison of 'node' between versions 'old_vid' and 'new_vid'.

File

./diff.module, line 427

Code

function _diff_get_previous_vid(&$node_revisions, $vid) {
  $previous = NULL;
  foreach ($node_revisions as $revision) {
    if ($previous && $previous->vid == $vid) {
      return $revision->vid;
    }
    $previous = $revision;
  }
  return false;
}