You are here

function theme_privatemsg_list_field__subject in Privatemsg 7

Same name and namespace in other branches
  1. 7.2 privatemsg.theme.inc \theme_privatemsg_list_field__subject()

Theme the subject of the thread.

See also

theme_privatemsg_list_field()

Related topics

File

./privatemsg.theme.inc, line 92
Theme functions for privatemsg.

Code

function theme_privatemsg_list_field__subject($variables) {
  $thread = $variables['thread'];
  $field = array();
  $options = array();
  $is_new = '';
  if (!empty($thread['is_new'])) {
    $is_new = theme('mark', array(
      'type' => MARK_NEW,
    ));
    $options['fragment'] = 'new';
  }
  $subject = $thread['subject'];
  if ($thread['has_tokens']) {
    $message = privatemsg_message_load($thread['thread_id']);
    $subject = privatemsg_token_replace($subject, array(
      'privatemsg_message' => $message,
    ), array(
      'sanitize' => TRUE,
      'privatemsg-show-span' => FALSE,
    ));
  }
  $field['data'] = l($subject, 'messages/view/' . $thread['thread_id'], $options) . $is_new;
  $field['class'][] = 'privatemsg-list-subject';
  return $field;
}