You are here

function _privatemsg_block_menu in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg.module \_privatemsg_block_menu()
  2. 6 privatemsg.module \_privatemsg_block_menu()
  3. 7.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 1539
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;
}