You are here

function messaging_simple_user_overview in Messaging 7

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

Display message overview list

1 call to messaging_simple_user_overview()
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_overview($account) {
  $output = '';
  foreach (messaging_simple_get_messages(array(
    'uid' => $account->uid,
  )) as $message) {
    $message->sender_account = $message->sender ? user_load($message->sender) : NULL;
    $rows[] = array(
      l($message->subject, 'user/' . $account->uid . '/messages/' . $message->mgid),
      !empty($message->sender_account) ? theme('username', $message->sender_account) : t('System'),
      format_date($message->sent),
    );
  }
  if (!empty($rows)) {
    $header = array(
      t('Subject'),
      t('From'),
      t('Date'),
    );
    $output .= theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
    $output .= theme('pager', array(), MESSAGING_SIMPLE_PAGER);
  }
  else {
    $output .= '<p class="message-queue-empty">' . t('No pending messages') . '</p>';
  }
  return $output;
}