General cleanup & part of ticket #2864: use User_group->getFancyName() instead of replicating the logic in various places. Encapsulates and allows for localization of parens.

This commit is contained in:
Brion Vibber 2010-11-03 12:59:19 -07:00
parent b0d7900530
commit dc4fafbbd1
3 changed files with 3 additions and 13 deletions

View File

@ -68,12 +68,7 @@ class ShowgroupAction extends GroupDesignAction
*/ */
function title() function title()
{ {
if (!empty($this->group->fullname)) { $base = $this->group->getFancyName();
// @todo FIXME: Needs proper i18n. Maybe use a generic method for this?
$base = $this->group->fullname . ' (' . $this->group->nickname . ')';
} else {
$base = $this->group->nickname;
}
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: Page title for first group page. %s is a group name. // TRANS: Page title for first group page. %s is a group name.

View File

@ -1010,7 +1010,7 @@ function common_group_link($sender_id, $nickname)
$attrs = array('href' => $group->permalink(), $attrs = array('href' => $group->permalink(),
'class' => 'url'); 'class' => 'url');
if (!empty($group->fullname)) { if (!empty($group->fullname)) {
$attrs['title'] = $group->fullname . ' (' . $group->nickname . ')'; $attrs['title'] = $group->getFancyName();
} }
$xs = new XMLStringer(); $xs = new XMLStringer();
$xs->elementStart('span', 'vcard'); $xs->elementStart('span', 'vcard');

View File

@ -41,12 +41,7 @@ class GroupFavoritedAction extends ShowgroupAction
*/ */
function title() function title()
{ {
if (!empty($this->group->fullname)) { $base = $this->group->getFancyName();
// @todo Create a core method to create this properly. i18n issue.
$base = $this->group->fullname . ' (' . $this->group->nickname . ')';
} else {
$base = $this->group->nickname;
}
if ($this->page == 1) { if ($this->page == 1) {
// TRANS: %s is a group name. // TRANS: %s is a group name.