diff options
author | Brion Vibber <brion@pobox.com> | 2010-11-02 15:02:55 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-11-02 15:02:55 -0700 |
commit | 0229c22d2358933758fea98284349a871106b3bd (patch) | |
tree | c62b1919f0a38e82a748162563c956d885137db1 /classes/Profile.php | |
parent | 62d47011482373b77ac6715d507ab8913b9280fc (diff) | |
parent | 04ca706601a2a3b556cc52fa21b61fcd842c4e87 (diff) |
Merge branch '1.0.x' into schema-x
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 23042fa43..545950a9e 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -141,12 +141,33 @@ class Profile extends Memcached_DataObject return true; } + /** + * Gets either the full name (if filled) or the nickname. + * + * @return string + */ function getBestName() { 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(_('%1$s (%2$s)'), $this->fullname, $this->nickname); + } else { + return $this->nickname; + } + } + + /** * Get the most recent notice posted by this user, if any. * * @return mixed Notice or null |