function diff_latest in Diff 7.3
Same name and namespace in other branches
- 5.2 diff.module \diff_latest()
- 6.2 diff.pages.inc \diff_latest()
- 7.2 diff.pages.inc \diff_latest()
Menu callback - show latest diff for a given node.
1 string reference to 'diff_latest'
- diff_menu in ./
diff.module - Implements hook_menu().
File
- ./
diff.pages.inc, line 11 - Menu callbacks for hook_menu().
Code
function diff_latest($node) {
$revisions = node_revision_list($node);
if (count($revisions) < 2 || !diff_node_revision_access($node, 'view')) {
drupal_goto('node/' . $node->nid);
}
$new = array_shift($revisions);
$old = array_shift($revisions);
drupal_goto("node/{$node->nid}/revisions/view/{$old->vid}/{$new->vid}");
}