You are here

function _privatemsg_block_menu in Privatemsg 6

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

File

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

Code

function _privatemsg_block_menu() {
  $block = array();
  $links = array();
  if (privatemsg_user_access('write privatemsg')) {
    $links[] = l(t('Write new message'), 'messages/new');
  }
  if (privatemsg_user_access('read privatemsg') || privatemsg_user_access('read all private messages')) {
    $links[] = l(privatemsg_title_callback(), 'messages');
  }
  if (count($links)) {
    $block = array(
      'subject' => t('Private messages'),
      'content' => theme('item_list', $links),
    );
  }
  return $block;
}