You are here

function _privatemsg_block_new in Privatemsg 6

Same name and namespace in other branches
  1. 6.2 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 1489
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) {
    $block = array(
      'subject' => format_plural($count, 'New message', 'New messages'),
      'content' => theme('privatemsg_new_block', $count),
    );
    return $block;
  }
  return array();
}