function user_rev_diff_user_view_alter in User Revision 7.2
Implementation of hook_user_view_alter().
File
- diff/
user_rev_diff.module, line 138 - Provides functionality to show a diff between two user revisions.
Code
function user_rev_diff_user_view_alter(&$build) {
$account = $build['#account'];
if (variable_get('show_user_rev_diff_inline', FALSE) && ($vid_arg = user_revision_vid_arg()) && _user_revision_access($account, array(
'view user revisions',
'view own user revisions',
))) {
module_load_include('inc', 'user_rev_diff', 'user_rev_diff.pages');
module_load_include('inc', 'diff', 'diff.pages');
$old_vid = arg(++$vid_arg);
$build = array(
'#markup' => user_rev_diff_inline_show($account, $old_vid),
);
$build['#prefix'] = isset($build['#prefix']) ? "<div id='diff-inline-{$account->uid}'>" . $build['#prefix'] : "<div id='diff-inline-{$account->uid}'>";
$build['#suffix'] = isset($build['#suffix']) ? $build['#suffix'] . "</div>" : "</div>";
}
}