function diff_node_revision_list in Diff 7.3
Returns a list of all the existing revision numbers.
Clone of node_revision_list() with revision status included. This would be an additional join in Drupal 8.x to the {node_field_revision} table.
Parameters
object $node: The node object.
Return value
array An associative array keyed by node revision number.
2 calls to diff_node_revision_list()
- diff_block_view in ./
diff.module - Implements hook_block_view().
- diff_node_revisions in ./
diff.pages.inc - Input form to select two revisions.
File
- ./
diff.module, line 277 - Provides functionality to show a diff between two node revisions.
Code
function diff_node_revision_list($node) {
$revisions = array();
$result = db_query('SELECT r.vid, r.title, r.log, r.uid, n.vid AS current_vid, r.status AS status, r.timestamp, u.name FROM {node_revision} r LEFT JOIN {node} n ON n.vid = r.vid INNER JOIN {users} u ON u.uid = r.uid WHERE r.nid = :nid ORDER BY r.vid DESC', array(
':nid' => $node->nid,
));
foreach ($result as $revision) {
$revisions[$revision->vid] = $revision;
}
return $revisions;
}