diff options
-rw-r--r-- | classes/User_group.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php index 7d6e21914..60217e960 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -234,6 +234,22 @@ class User_group extends Memcached_DataObject return ($this->fullname) ? $this->fullname : $this->nickname; } + /** + * Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone + * if no fullname is provided. + * + * @return string + */ + function getFancyName() + { + if ($this->fullname) { + // TRANS: Full name of a profile or group followed by nickname in parens + return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->fullname, $this->nickname); + } else { + return $this->nickname; + } + } + function getAliases() { $aliases = array(); |