]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add getFancyName() to User_group to match the one on Profile: encapsulates the "fulln...
authorBrion Vibber <brion@pobox.com>
Wed, 3 Nov 2010 19:53:51 +0000 (12:53 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 3 Nov 2010 19:53:51 +0000 (12:53 -0700)
classes/User_group.php

index 7d6e219148374f49545d1937ba469b961c7ce97b..60217e960ed7460f7545a8075edca48a7f2c4403 100644 (file)
@@ -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();