You are here

function theme_privatemsg_username in Privatemsg 7

Same name and namespace in other branches
  1. 5.3 privatemsg.module \theme_privatemsg_username()
  2. 5 privatemsg.module \theme_privatemsg_username()
  3. 6.2 privatemsg.theme.inc \theme_privatemsg_username()
  4. 7.2 privatemsg.theme.inc \theme_privatemsg_username()

Used to theme and display user recipients.

Wrapper for theme_username() with a few additional options.

Related topics

File

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

Code

function theme_privatemsg_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'])) {
      $name .= ' [user]';
    }
    return $name;
  }
  else {
    return theme('username', array(
      'account' => $recipient,
    ));
  }
}