function user_revision_list in User Revision 7.2
Same name and namespace in other branches
- 7 user_revision.module \user_revision_list()
Return a list of all the existing revision numbers.
5 calls to user_revision_list()
- user_revision_list_build in ./
user_revision.module - Build the table of older revisions of a user.
- user_rev_diff_block_view in diff/
user_rev_diff.module - Implements hook_block_view().
- user_rev_diff_diffs_show in diff/
user_rev_diff.pages.inc - Create output string for a comparison of 'user' between versions 'old_vid' and 'new_vid'.
- user_rev_diff_latest in diff/
user_rev_diff.pages.inc - Menu callback - show latest diff for a given node.
- user_rev_diff_tokens in diff/
user_rev_diff.tokens.inc - Implements hook_tokens().
File
- ./
user_revision.module, line 574 - Enables user revision.
Code
function user_revision_list($user) {
$revisions = array();
$result = db_select('user_revision', 'ur')
->fields('ur', array(
'vid',
'log',
'authorid',
'ip',
'timestamp',
));
$user_alias = $result
->leftJoin('users', 'u', "%alias.vid = ur.vid");
$user_alias2 = $result
->leftJoin('users', 'u2', "%alias.uid = ur.authorid");
$result
->addField($user_alias, 'vid', 'current_vid');
$result
->addField($user_alias2, 'name', 'current_name');
$result
->fields($user_alias2, array(
'uid',
'name',
));
$result = $result
->condition('ur.uid', $user->uid)
->orderBy('ur.vid', 'DESC')
->execute()
->fetchAll();
foreach ($result as $revision) {
$revisions[$revision->vid] = $revision;
}
return $revisions;
}