function _privatemsg_block_menu

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

File

./privatemsg.module, line 1562
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', array('items' => $links)),
    );
  }
  return $block;
}