You are here

function privatemsg_privatemsg_thread_operations in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 privatemsg.module \privatemsg_privatemsg_thread_operations()
  2. 7.2 privatemsg.module \privatemsg_privatemsg_thread_operations()
  3. 7 privatemsg.module \privatemsg_privatemsg_thread_operations()

Implements hook_privatemsg_thread_operations().

File

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

Code

function privatemsg_privatemsg_thread_operations() {
  $operations = array(
    'mark as read' => array(
      'label' => t('Mark as read'),
      'callback' => 'privatemsg_thread_change_status',
      'callback arguments' => array(
        'status' => PRIVATEMSG_READ,
      ),
      'undo callback' => 'privatemsg_thread_change_status',
      'undo callback arguments' => array(
        'status' => PRIVATEMSG_UNREAD,
      ),
    ),
    'mark as unread' => array(
      'label' => t('Mark as unread'),
      'callback' => 'privatemsg_thread_change_status',
      'callback arguments' => array(
        'status' => PRIVATEMSG_UNREAD,
      ),
      'undo callback' => 'privatemsg_thread_change_status',
      'undo callback arguments' => array(
        'status' => PRIVATEMSG_READ,
      ),
    ),
  );
  if (privatemsg_user_access('delete privatemsg')) {
    $operations['delete'] = array(
      'label' => t('Delete'),
      'callback' => 'privatemsg_thread_change_delete',
      'callback arguments' => array(
        'delete' => 1,
      ),
      'undo callback' => 'privatemsg_thread_change_delete',
      'undo callback arguments' => array(
        'delete' => 0,
      ),
      'button' => TRUE,
    );
  }
  return $operations;
}