You are here

function profile2_entity_diff in Profile 2 7.2

Implements hook_entity_diff() on behalf of the Profile2 module.

File

contrib/profile2_diff.module, line 117
Provides functionality to show a diff between two profile2 revisions.

Code

function profile2_entity_diff($old_profile, $new_profile, $context) {
  $result = array();
  if ($context['entity_type'] == 'profile2') {
    $options = variable_get('diff_additional_options_profile', array(
      'label' => 'label',
    ));
    foreach (profile2_entity_diff_options('profile2') as $key => $option_label) {
      if (!empty($options[$key])) {
        $func = '_profile2_entity_diff_additional_options_' . $key;
        $result[$key] = $func($old_profile, $new_profile, $context);
      }
    }
  }
  return $result;
}