diff options
| author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-08-23 22:42:18 +0200 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-08-23 22:42:18 +0200 |
| commit | f6a4843c6df3a9b0490eb3d273ebed7d04a89582 (patch) | |
| tree | b031ba516adf54d5d3764528e696651b02ceef92 /phpBB/includes/functions_user.php | |
| parent | f56fe0ba8da2211d3947369e79952f294cffe7d6 (diff) | |
| parent | 25103698040977fd0d655d6e658157a07bb24990 (diff) | |
| download | forums-f6a4843c6df3a9b0490eb3d273ebed7d04a89582.tar forums-f6a4843c6df3a9b0490eb3d273ebed7d04a89582.tar.gz forums-f6a4843c6df3a9b0490eb3d273ebed7d04a89582.tar.bz2 forums-f6a4843c6df3a9b0490eb3d273ebed7d04a89582.tar.xz forums-f6a4843c6df3a9b0490eb3d273ebed7d04a89582.zip | |
Merge pull request #3652 from Elsensee/ticket/12143
[ticket/12143] Make it possible to use translated group names for non-special groups
* Elsensee/ticket/12143:
[ticket/12143] Fix tests after rebase
[ticket/12143] Avoid no output from get_group_name()
[ticket/12143] Fix those tests
[ticket/12143] Add some tests
[ticket/12143] Oops, fixed array index
[ticket/12143] Replace group name output
[ticket/12143] Add group helper class to translate groupnames
[ticket/12143] Add is_set method to language service
Diffstat (limited to 'phpBB/includes/functions_user.php')
| -rw-r--r-- | phpBB/includes/functions_user.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 45263ad018..98ffb4227d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2215,6 +2215,9 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container, $phpbb_log; + /** @var \phpbb\group\helper $group_helper */ + $group_helper = $phpbb_container->get('group_helper'); + $error = array(); // Attributes which also affect the users table @@ -2466,7 +2469,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow group_set_user_default($group_id, $user_ary, $sql_ary); } - $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; + $name = $group_helper->get_name($name); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($name)); group_update_listings($group_id); @@ -3320,7 +3323,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal */ function get_group_name($group_id) { - global $db, $user; + global $db, $user, $phpbb_container; $sql = 'SELECT group_name, group_type FROM ' . GROUPS_TABLE . ' @@ -3329,12 +3332,15 @@ function get_group_name($group_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$row || ($row['group_type'] == GROUP_SPECIAL && !$user->is_setup())) + if (!$row) { return ''; } - return ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; + /** @var \phpbb\group\helper $group_helper */ + $group_helper = $phpbb_container->get('group_helper'); + + return $group_helper->get_name($row['group_name']); } /** |
