function hook_privatemsg_message_view_alter

1 privatemsg.api.php hook_privatemsg_message_view_alter(&$var)
7-1 privatemsg.api.php hook_privatemsg_message_view_alter(&$vars)
7-2 privatemsg.api.php hook_privatemsg_message_view_alter(&$vars)
6-2 privatemsg.api.php hook_privatemsg_message_view_alter(&$var)

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 available in $vars['message'].

Parameters

$var: Template variables

Related topics

1 function implements 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.
1 invocation of hook_privatemsg_message_view_alter()
template_preprocess_privatemsg_view in ./privatemsg.module
Implements hook_preprocess_THEME().

File

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

Code

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