You are here

function privatemsg_menu in Privatemsg 6

Same name and namespace in other branches
  1. 5.3 privatemsg.module \privatemsg_menu()
  2. 5 privatemsg.module \privatemsg_menu()
  3. 6.2 privatemsg.module \privatemsg_menu()
  4. 7.2 privatemsg.module \privatemsg_menu()
  5. 7 privatemsg.module \privatemsg_menu()

Implements hook_menu().

File

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

Code

function privatemsg_menu() {
  $items['messages'] = array(
    'title' => 'Messages',
    'title callback' => 'privatemsg_title_callback',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'privatemsg_list',
      'list',
    ),
    'access callback' => 'privatemsg_user_access',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['messages/list'] = array(
    'title' => 'Messages',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'privatemsg_list',
      'list',
    ),
    'access callback' => 'privatemsg_user_access',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['messages/view/%privatemsg_thread'] = array(
    'title' => 'Read message',
    'page callback' => 'privatemsg_view',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'privatemsg_view_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
  );
  $items['messages/delete/%privatemsg_thread/%privatemsg_message'] = array(
    'title' => 'Delete message',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'privatemsg_delete',
      2,
      3,
    ),
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'delete privatemsg',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['messages/new'] = array(
    'title' => 'Write new message',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'privatemsg_new',
      2,
      3,
      NULL,
    ),
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'write privatemsg',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -3,
  );

  // Auto-completes available user names & removes duplicates.
  $items['messages/user-name-autocomplete'] = array(
    'page callback' => 'privatemsg_user_name_autocomplete',
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'write privatemsg',
    ),
    'type' => MENU_CALLBACK,
    'weight' => -10,
  );
  $items['admin/settings/messages'] = array(
    'title' => 'Private messages',
    'description' => 'Configure private messaging settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'private_message_settings',
    ),
    'access arguments' => array(
      'administer privatemsg settings',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/settings/messages/default'] = array(
    'title' => 'Private messages',
    'description' => 'Configure private messaging settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'private_message_settings',
    ),
    'access arguments' => array(
      'administer privatemsg settings',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['messages/undo/action'] = array(
    'title' => 'Private messages',
    'description' => 'Undo last thread action',
    'page callback' => 'privatemsg_undo_action',
    'access arguments' => array(
      'read privatemsg',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['user/%/messages'] = array(
    'title' => 'Messages',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'privatemsg_list',
      'list',
      1,
    ),
    'access callback' => 'privatemsg_user_access',
    'access arguments' => array(
      'read all private messages',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}