You are here

function _privatemsg_block_new in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 privatemsg.module \_privatemsg_block_new()
  2. 7.2 privatemsg.module \_privatemsg_block_new()
  3. 7 privatemsg.module \_privatemsg_block_new()
1 call to _privatemsg_block_new()
privatemsg_block in ./privatemsg.module

File

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

Code

function _privatemsg_block_new() {
  $block = array();
  if (!privatemsg_user_access()) {
    return $block;
  }
  $count = privatemsg_unread_count();
  if ($count || variable_get('privatemsg_no_messages_notification', 0)) {
    $block = array(
      'subject' => $count ? format_plural($count, 'New message', 'New messages') : t('No new messages'),
      'content' => theme('privatemsg_new_block', $count),
    );
    return $block;
  }
  return array();
}