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.
This commit is contained in:
parent
5592333b73
commit
b0d7900530
@ -234,6 +234,22 @@ class User_group extends Memcached_DataObject
|
|||||||
return ($this->fullname) ? $this->fullname : $this->nickname;
|
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()
|
function getAliases()
|
||||||
{
|
{
|
||||||
$aliases = array();
|
$aliases = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user