You are here

function hook_user_rev_diff in User Revision 7.2

Returns a keyed array. Keys are the machine-readable names of the field, they don't really matter, but it is recommended to use them for code-readability. The values are arrays with the following keys: #name The name to display as the header for this field. #old The old value for this field. #new The new value for this field. #weight The weight of this field (used when displaying the diff, optional)

Parameters

object $old_user The old user object:

object $new_user The new user object:

File

diff/user_rev_diff.api.php, line 29
API functions for the user_rev_diff module. WARNING: Do NOT include this file ANYWHERE. This file is only used to have all API functions in one place for documentation purposed. If this file is included you will get error messages, possibly fatal…

Code

function hook_user_rev_diff($old_user, $new_user) {
  $result = array();
  $result['name'] = array(
    '#name' => t('User Name'),
    '#old' => array(
      $old_user->name,
    ),
    '#new' => array(
      $new_user->name,
    ),
    '#weight' => 4,
  );
  $result['email'] = array(
    '#name' => t('User Email'),
    '#old' => array(
      $old_user->mail,
    ),
    '#new' => array(
      $new_user->mail,
    ),
    '#weight' => 5,
  );
  return $result;
}