From 185fbe41c954640a0aa5632b541055005ef776c2 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Thu, 28 May 2015 17:31:21 +0200 Subject: [ticket/12143] Replace group name output So now we can use translated group names for non-special groups PHPBB3-12143 --- phpBB/memberlist.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'phpBB/memberlist.php') 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&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 .= ''; + $s_group_select .= ''; } $db->sql_freeresult($result); -- cgit v1.2.1