You are here

function hook_privatemsg_message_view_alter in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg.api.php \hook_privatemsg_message_view_alter()
  2. 6 privatemsg.api.php \hook_privatemsg_message_view_alter()
  3. 7.2 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 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

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'],
  );
}