We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b0d79005 authored by Brion Vibber's avatar Brion Vibber

Add getFancyName() to User_group to match the one on Profile: encapsulates the...

Add getFancyName() to User_group to match the one on Profile: encapsulates the "fullname (nickname)" vs "nickname" logic and allows for localization of the parentheses in a common place.
parent 5592333b
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment