You are here

function redhen_contact_user_view in RedHen CRM 7

Implements hook_user_view().

File

modules/redhen_contact/redhen_contact.module, line 1398
Module file for RedHen contacts.

Code

function redhen_contact_user_view($account, $view_mode, $langcode) {

  // Include contact view if access allowed.
  if ($contact = redhen_contact_load_by_user($account)) {

    // A Contact exists for this account. Does the current user have access?
    if (redhen_contact_access('view', $contact)) {
      $view_mode = variable_get('redhen_contact_view_mode', $view_mode);
      $account->content['redhen_contact'] = redhen_contact_view($contact, $view_mode);
    }
  }
}