function privatemsg_message_uri_callback

7-1 privatemsg.module privatemsg_message_uri_callback($message)
7-2 privatemsg.module privatemsg_message_uri_callback($message)

Returns the URI for a private message.

Parameters

$message: Private message object.

Return value

URI array as defined by hook_entity_info().

1 string reference to 'privatemsg_message_uri_callback'
privatemsg_entity_info in ./privatemsg.module
Implements hook_entity_info().

File

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

Code

function privatemsg_message_uri_callback($message) {
  $uri = array();
  if (isset($message->mid) && isset($message->thread_id)) {
    $uri = array(
      'path' => 'messages/view/' . $message->thread_id,
      'options' => array(),
    );
    // Add message fragment, if necessary.
    if ($message->mid != $message->thread_id) {
      $uri['options']['fragment'] = 'privatemsg-mid-' . $message->mid;
    }
  }
  return $uri;
}