You are here

function hook_privatemsg_message_view_alter in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 privatemsg.api.php \hook_privatemsg_message_view_alter()
  2. 7.2 privatemsg.api.php \hook_privatemsg_message_view_alter()
  3. 7 privatemsg.api.php \hook_privatemsg_message_view_alter()

Act on the $vars before a message is displayed.

This is called in the preprocess hook of the privatemsg-view template. The $message data is aviable in $vars['message'].

Parameters

$var: Template variables

Related topics

2 functions implement hook_privatemsg_message_view_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

pm_block_user_privatemsg_message_view_alter in pm_block_user/pm_block_user.module
Implements hook_privatemsg_message_view_alter().
privatemsg_attachments_privatemsg_message_view_alter in privatemsg_attachments/privatemsg_attachments.module
1 invocation of hook_privatemsg_message_view_alter()
template_preprocess_privatemsg_view in ./privatemsg.module

File

./privatemsg.api.php, line 345
Privatemsg API Documentation

Code

function hook_privatemsg_message_view_alter(&$var) {

  // add a link to each message
  $vars['message_links'][] = array(
    'title' => t('My link'),
    'href' => '/path/to/my/action/' . $vars['message']['mid'],
  );
}