aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbattye <battye@phpbb.com>2018-11-29 14:37:14 +0000
committerbattye <battye@phpbb.com>2018-11-29 14:37:14 +0000
commit565f6925410b1022529670d47f3b00c244ccaed7 (patch)
tree859989638a437578cd27723b36579de34b9e5978
parent101829b4dce2874bbe53264c1769bf9699527c2f (diff)
downloadforums-565f6925410b1022529670d47f3b00c244ccaed7.tar
forums-565f6925410b1022529670d47f3b00c244ccaed7.tar.gz
forums-565f6925410b1022529670d47f3b00c244ccaed7.tar.bz2
forums-565f6925410b1022529670d47f3b00c244ccaed7.tar.xz
forums-565f6925410b1022529670d47f3b00c244ccaed7.zip
[ticket/15883] Use the new language object
Using the new ->lang() format. Made the username comparison case insensitive. Also fixed a bug where the return to previous page link in the UCP was going back to the list of groups rather than the specific manage group page when an error occurred. PHPBB3-15883
-rw-r--r--phpBB/includes/acp/acp_groups.php7
-rw-r--r--phpBB/includes/ucp/ucp_groups.php13
2 files changed, 14 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 20f913ff29..f541025bf2 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -29,6 +29,9 @@ class acp_groups
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_container, $phpbb_dispatcher;
+ /** @var \phpbb\language\language $language Language object */
+ $language = $phpbb_container->get('language');
+
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
$this->page_title = 'ACP_GROUPS_MANAGE';
@@ -293,7 +296,7 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{
- $display_message = $user->lang[$error];
+ $display_message = $language->lang($error);
if ($error == 'GROUP_USERS_INVALID')
{
@@ -302,7 +305,7 @@ class acp_groups
$actual_user_id_ary = false;
user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);
- $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary)));
+ $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp')));
}
trigger_error($display_message . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index e32c855179..d0ac598920 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -32,6 +32,9 @@ class ucp_groups
global $db, $user, $auth, $cache, $template;
global $request, $phpbb_container, $phpbb_log;
+ /** @var \phpbb\language\language $language Language object */
+ $language = $phpbb_container->get('language');
+
$user->add_lang('groups');
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
@@ -1054,10 +1057,12 @@ class ucp_groups
if (confirm_box(true))
{
+ $return_manage_page = '<br /><br />' . $language->lang('RETURN_PAGE', '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>');
+
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row))
{
- $display_message = $user->lang[$error];
+ $display_message = $language->lang($error);
if ($error == 'GROUP_USERS_INVALID')
{
@@ -1066,13 +1071,13 @@ class ucp_groups
$actual_user_id_ary = false;
user_get_id_name($actual_user_id_ary, $actual_name_ary, false, true);
- $display_message = sprintf($user->lang['GROUP_USERS_INVALID'], implode($user->lang['COMMA_SEPARATOR'], array_diff($name_ary, $actual_name_ary)));
+ $display_message = $language->lang('GROUP_USERS_INVALID', implode($language->lang('COMMA_SEPARATOR'), array_udiff($name_ary, $actual_name_ary, 'strcasecmp')));
}
- trigger_error($display_message . $return_page);
+ trigger_error($display_message . $return_manage_page);
}
- trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&amp;action=list&amp;g=' . $group_id . '">', '</a>'));
+ trigger_error($language->lang('GROUP_USERS_ADDED') . $return_manage_page);
}
else
{