function privatemsg_user_view

7-1 privatemsg.module privatemsg_user_view($account)
7-2 privatemsg.module privatemsg_user_view($account)

Implements hook_user_view().

File

./privatemsg.module, line 1252
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'),
      ),
    );
  }
}