You are here

function messaging_simple_user_message in Messaging 6.4

Same name and namespace in other branches
  1. 5 messaging_simple/messaging_simple.module \messaging_simple_user_message()
  2. 6 messaging_simple/messaging_simple.module \messaging_simple_user_message()
  3. 6.2 messaging_simple/messaging_simple.module \messaging_simple_user_message()
  4. 6.3 messaging_simple/messaging_simple.module \messaging_simple_user_message()

Display single message

1 string reference to 'messaging_simple_user_message'
messaging_simple_user_page in messaging_simple/messaging_simple.module
Menu callback. Display pending messages to the user

File

messaging_simple/messaging_simple.module, line 106
Simple messaging using html page. Messaging method plug-in

Code

function messaging_simple_user_message($form_state, $account, $msid) {
  $form = array();
  $message = db_fetch_object(db_query("SELECT * FROM {messaging_simple} WHERE msid = %d", $msid));
  if ($message && $message->uid == $account->uid) {
    $form['account'] = array(
      '#type' => 'value',
      '#value' => $account,
    );
    $form['message'] = array(
      '#type' => 'value',
      '#value' => $message,
    );
    $form['subject'] = array(
      '#type' => 'item',
      '#title' => t('Subject'),
      '#value' => check_plain($message->subject),
    );
    $form['body'] = array(
      '#type' => 'item',
      '#title' => t('Content'),
      '#value' => check_markup($message->body),
    );
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
    $form['#redirect'] = 'user/' . $account->uid . '/messages';
  }
  return $form;
}