We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 6e034567 authored by Brion Vibber's avatar Brion Vibber

Migrate some more code from manually constructing "fullname (nickname)" to...

Migrate some more code from manually constructing "fullname (nickname)" to using Profile->getFancyName(). Encapsulates common logic and allows for localization of the parens.
parent dc4fafbb
......@@ -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));
......
......@@ -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,
......
......@@ -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();
......
......@@ -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.
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment