You are here

function pm_block_user_menu in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 pm_block_user/pm_block_user.module \pm_block_user_menu()
  2. 6 pm_block_user/pm_block_user.module \pm_block_user_menu()
  3. 7.2 pm_block_user/pm_block_user.module \pm_block_user_menu()

Implements hook_menu().

File

pm_block_user/pm_block_user.module, line 31
Allows users to block other users from sending them any messages

Code

function pm_block_user_menu() {
  $items['messages/block/%user'] = array(
    'title' => 'Block user messages',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_block_user_form',
      2,
    ),
    'file' => 'pm_block_user.pages.inc',
    'access callback' => '_pm_block_user_access',
    'access arguments' => array(
      2,
    ),
    'type' => MENU_CALLBACK,
    'weight' => -10,
  );
  $items['messages/blocked'] = array(
    'title' => 'Blocked users',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_block_user_list',
    ),
    'file' => 'pm_block_user.pages.inc',
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'read privatemsg',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
  );
  $items['admin/config/messaging/privatemsg/block'] = array(
    'title' => 'User blocking rules',
    'description' => 'Configure rules for which users may block each other.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_block_user_settings',
    ),
    'file' => 'pm_block_user.admin.inc',
    'access arguments' => array(
      'administer privatemsg settings',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['messages/block/js'] = array(
    'title' => 'Javascript block actions form',
    'page callback' => 'pm_block_user_js',
    'file' => 'pm_block_user.admin.inc',
    'access arguments' => array(
      'administer privatemsg settings',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['messages/user/autocomplete'] = array(
    'page callback' => 'privatemsg_autocomplete',
    'file' => 'privatemsg.pages.inc',
    'file path' => drupal_get_path('module', 'privatemsg'),
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'write privatemsg',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}