aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/memberlist.php
diff options
context:
space:
mode:
authorOliver Schramm <oliver.schramm97@gmail.com>2015-05-28 17:31:21 +0200
committerOliver Schramm <oliver.schramm97@gmail.com>2015-08-05 17:50:24 +0200
commit185fbe41c954640a0aa5632b541055005ef776c2 (patch)
tree9119922e5408dd9821d06a8f512f79d88fc6d73b /phpBB/memberlist.php
parent4b3343e756be45ac1ca26e976ba79e6353f41de3 (diff)
downloadforums-185fbe41c954640a0aa5632b541055005ef776c2.tar
forums-185fbe41c954640a0aa5632b541055005ef776c2.tar.gz
forums-185fbe41c954640a0aa5632b541055005ef776c2.tar.bz2
forums-185fbe41c954640a0aa5632b541055005ef776c2.tar.xz
forums-185fbe41c954640a0aa5632b541055005ef776c2.zip
[ticket/12143] Replace group name output
So now we can use translated group names for non-special groups PHPBB3-12143
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r--phpBB/memberlist.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 36c760f298..67f535ad0c 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -83,6 +83,9 @@ switch ($mode)
break;
}
+/** @var \phpbb\group\helper $group_helper */
+$group_helper = $phpbb_container->get('group_helper');
+
$start = $request->variable('start', 0);
$submit = (isset($_POST['submit'])) ? true : false;
@@ -136,7 +139,7 @@ switch ($mode)
}
else
{
- $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
}
@@ -536,20 +539,14 @@ switch ($mode)
$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{
- if ($row['group_type'] == GROUP_SPECIAL)
- {
- // Lookup group name in language dictionary
- if (isset($user->lang['G_' . $row['group_name']]))
- {
- $row['group_name'] = $user->lang['G_' . $row['group_name']];
- }
- }
- else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
+ if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
{
// Skip over hidden groups the user cannot see
continue;
}
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
+
$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;
}
@@ -1136,7 +1133,7 @@ switch ($mode)
$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
- 'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($row['group_name']),
'GROUP_COLOR' => $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],
@@ -1315,7 +1312,7 @@ switch ($mode)
while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];
- $s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);