You are here

function theme_privatemsg_realname_username in Privatemsg 7

Same name and namespace in other branches
  1. 6.2 privatemsg_realname/privatemsg_realname.module \theme_privatemsg_realname_username()
  2. 7.2 privatemsg_realname/privatemsg_realname.module \theme_privatemsg_realname_username()

Used to theme and display user recipients.

Wrapper for theme_username() with a few additional options.

File

privatemsg_realname/privatemsg_realname.module, line 99

Code

function theme_privatemsg_realname_username($variables) {
  $recipient = $variables['recipient'];
  $options = $variables['options'];
  if (!isset($recipient->uid)) {
    $recipient->uid = $recipient->recipient;
  }
  if (!empty($options['plain'])) {
    $name = strip_tags(format_username($recipient));
    if (!empty($options['unique'])) {
      $identifier = variable_get('privatemsg_realname_unique_identifier', 'name');
      $name .= ' [user: ' . $recipient->{$identifier} . ']';
    }
    return $name;
  }
  else {
    return theme('username', array(
      'account' => $recipient,
    ));
  }
}