function privatemsg_recipient_format in Privatemsg 6.2
Same name and namespace in other branches
- 7.2 privatemsg.module \privatemsg_recipient_format()
- 7 privatemsg.module \privatemsg_recipient_format()
Format a single participant.
Parameters
$participant: The participant object to format.
18 calls to privatemsg_recipient_format()
- hook_privatemsg_message_validate in ./
privatemsg.api.php - Validate a message before it is sent/saved in the database.
- pm_block_user_form in pm_block_user/
pm_block_user.pages.inc - @file User menu callbacks for pm_block_user.module.
- pm_block_user_form_submit in pm_block_user/
pm_block_user.pages.inc - Submit callback for block user confirmation form.
- pm_block_user_privatemsg_block_message in pm_block_user/
pm_block_user.module - Implements hook_privatemsg_block_message().
- PrivatemsgEMailNotifyTestCase::verifyMail in pm_email_notify/
pm_email_notify.test - Verify a notification mail.
File
- ./
privatemsg.module, line 2790 - Allows users to send private messages to other users.
Code
function privatemsg_recipient_format($recipient, $options = array()) {
if (!isset($recipient->type)) {
$recipient->type = 'user';
$recipient->recipient = $recipient->uid;
}
$type = privatemsg_recipient_get_type($recipient->type);
if (isset($type['format'])) {
$result = theme($type['format'], $recipient, $options);
// Fallback when theme function did not return anything.
// Currently necessary for the API tests.
if (empty($result) && isset($recipient->name)) {
$result = $recipient->name;
}
return $result;
}
return NULL;
}