]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Migrate some more code from manually constructing "fullname (nickname)" to using...
authorBrion Vibber <brion@pobox.com>
Wed, 3 Nov 2010 20:10:42 +0000 (13:10 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 3 Nov 2010 20:10:42 +0000 (13:10 -0700)
actions/oembed.php
actions/shownotice.php
lib/noticelist.php
plugins/Mapstraction/allmap.php
plugins/Mapstraction/usermap.php

index e25e4cb2592407857d8b1bf69318f64eb161b189..da3aa0c716c8d313881cc5bc1ec8c1e22a6b1c8a 100644 (file)
@@ -79,11 +79,7 @@ class OembedAction extends Action
                     if (empty($profile)) {
                         $this->serverError(_('Notice has no profile.'), 500);
                     }
-                    if (!empty($profile->fullname)) {
-                        $authorname = $profile->fullname . ' (' . $profile->nickname . ')';
-                    } else {
-                        $authorname = $profile->nickname;
-                    }
+                    $authorname = $profile->getFancyName();
                     $oembed['title'] = sprintf(_('%1$s\'s status on %2$s'),
                         $authorname,
                         common_exact_date($notice->created));
index 5fc863486c13620fec91072fa1f7f9e3b9bd662b..7cc6c54243ac2e1e80493e210c173d2fb140e0c0 100644 (file)
@@ -167,11 +167,7 @@ class ShownoticeAction extends OwnerDesignAction
 
     function title()
     {
-        if (!empty($this->profile->fullname)) {
-            $base = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
-        } else {
-            $base = $this->profile->nickname;
-        }
+        $base = $this->profile->getFancyName();
 
         return sprintf(_('%1$s\'s status on %2$s'),
                        $base,
index df1533980a6ea32194bade727dc69fe74210c156..bdf2530b34dc3b40366f50d9adfcaf81da4d8df7 100644 (file)
@@ -306,7 +306,7 @@ class NoticeListItem extends Widget
         $attrs = array('href' => $this->profile->profileurl,
                        'class' => 'url');
         if (!empty($this->profile->fullname)) {
-            $attrs['title'] = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
+            $attrs['title'] = $this->profile->getFancyName();
         }
         $this->out->elementStart('a', $attrs);
         $this->showAvatar();
index 6e2e1d122840d99d58bec97d26055ed197987777..62d8d044582b627ce3b7c0f0c5b80a8c215da1c7 100644 (file)
@@ -61,12 +61,7 @@ class AllmapAction extends MapAction
 
     function title()
     {
-        if (!empty($this->profile->fullname)) {
-            // @todo FIXME: Bad i18n. Should be "%1$s (%2$s)".
-            $base = $this->profile->fullname . ' (' . $this->user->nickname . ') ';
-        } else {
-            $base = $this->user->nickname;
-        }
+        $base = $this->profile->getFancyName();
 
         if ($this->page == 1) {
             // TRANS: Page title.
index 0ee956159c92f8fa95de398ac7d826547e9a773b..54412146ee49cb001e14a4c8695c5835e640fc27 100644 (file)
@@ -58,12 +58,7 @@ class UsermapAction extends MapAction
 
     function title()
     {
-        if (!empty($this->profile->fullname)) {
-            // @todo FIXME: Bad i18n. Should be '%1$s (%2$s)'
-            $base = $this->profile->fullname . ' (' . $this->user->nickname . ')';
-        } else {
-            $base = $this->user->nickname;
-        }
+        $base = $this->profile->getFancyName();
 
         if ($this->page == 1) {
             // @todo CHECKME: inconsisten with paged variant below. " map" missing.