diff options
author | Brion Vibber <brion@pobox.com> | 2010-11-03 12:59:19 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-11-03 12:59:19 -0700 |
commit | dc4fafbbd16adecc94fb1e3ee889689cfb786c3a (patch) | |
tree | da353aaf51c0ce2a7540da5c08b70ba80b2b589e | |
parent | b0d79005308c30a6db2878377107643e77f0c03f (diff) |
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.
-rw-r--r-- | actions/showgroup.php | 7 | ||||
-rw-r--r-- | lib/util.php | 2 | ||||
-rw-r--r-- | plugins/GroupFavorited/groupfavoritedaction.php | 7 |
3 files changed, 3 insertions, 13 deletions
diff --git a/actions/showgroup.php b/actions/showgroup.php index c87282844..f38cd420a 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -68,12 +68,7 @@ class ShowgroupAction extends GroupDesignAction */ function title() { - if (!empty($this->group->fullname)) { - // @todo FIXME: Needs proper i18n. Maybe use a generic method for this? - $base = $this->group->fullname . ' (' . $this->group->nickname . ')'; - } else { - $base = $this->group->nickname; - } + $base = $this->group->getFancyName(); if ($this->page == 1) { // TRANS: Page title for first group page. %s is a group name. diff --git a/lib/util.php b/lib/util.php index d50fa2081..8f2a9f173 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1010,7 +1010,7 @@ function common_group_link($sender_id, $nickname) $attrs = array('href' => $group->permalink(), 'class' => 'url'); if (!empty($group->fullname)) { - $attrs['title'] = $group->fullname . ' (' . $group->nickname . ')'; + $attrs['title'] = $group->getFancyName(); } $xs = new XMLStringer(); $xs->elementStart('span', 'vcard'); diff --git a/plugins/GroupFavorited/groupfavoritedaction.php b/plugins/GroupFavorited/groupfavoritedaction.php index dbd37abbc..dcbf7d0bc 100644 --- a/plugins/GroupFavorited/groupfavoritedaction.php +++ b/plugins/GroupFavorited/groupfavoritedaction.php @@ -41,12 +41,7 @@ class GroupFavoritedAction extends ShowgroupAction */ function title() { - if (!empty($this->group->fullname)) { - // @todo Create a core method to create this properly. i18n issue. - $base = $this->group->fullname . ' (' . $this->group->nickname . ')'; - } else { - $base = $this->group->nickname; - } + $base = $this->group->getFancyName(); if ($this->page == 1) { // TRANS: %s is a group name. |