summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-02 13:42:33 -0700
committerBrion Vibber <brion@pobox.com>2010-11-02 13:42:44 -0700
commit426cda5e1ffd365b6b8915e8d504c0a6672339d3 (patch)
tree7b58cc726663364e9cabc1286acb708568c541f6 /classes/Profile.php
parentc6d4612f4985326445a8401697f6277d04e5dde9 (diff)
Alternate pretty-title tweaks for #2668
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index 37d2c571f..064ba551c 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