function _privatemsg_block_new

1 privatemsg.module _privatemsg_block_new()
7-1 privatemsg.module _privatemsg_block_new()
7-2 privatemsg.module _privatemsg_block_new()
6-2 privatemsg.module _privatemsg_block_new()
1 call to _privatemsg_block_new()
privatemsg_block_view in ./privatemsg.module
Implements hook_block_view().

File

./privatemsg.module, line 1544
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, 'Unread message', 'Unread messages') : t('No unread messages'),
      'content' => theme('privatemsg_new_block', array('count' => $count)),
    );
    return $block;
  }
  return array();
}