You are here

function privatemsg_user_view in Privatemsg 7

Same name and namespace in other branches
  1. 7.2 privatemsg.module \privatemsg_user_view()

Implements hook_user_view().

File

./privatemsg.module, line 1247
Allows users to send private messages to other users.

Code

function privatemsg_user_view($account) {
  if (($url = privatemsg_get_link(array(
    $account,
  ))) && variable_get('privatemsg_display_profile_links', 1)) {
    $account->content['privatemsg_send_new_message'] = array(
      '#type' => 'link',
      '#title' => t('Send this user a private message'),
      '#href' => $url,
      '#weight' => 10,
      '#options' => array(
        'query' => drupal_get_destination(),
        'title' => t('Send this user a private message'),
        'attributes' => array(
          'class' => 'privatemsg-send-link privatemsg-send-link-profile',
        ),
      ),
    );
  }
}