mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12045] Only display group selection if there are groups
Also fixed the empty option which is not allowed. PHPBB3-12045
This commit is contained in:
parent
d9c754a650
commit
5d69eddcf5
2 changed files with 10 additions and 2 deletions
|
@ -331,19 +331,26 @@ class acp_prune
|
||||||
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
|
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$s_group_list = '<option value="0"></option>';
|
|
||||||
$sql = 'SELECT group_id, group_name
|
$sql = 'SELECT group_id, group_name
|
||||||
FROM ' . GROUPS_TABLE . '
|
FROM ' . GROUPS_TABLE . '
|
||||||
WHERE group_type <> ' . GROUP_SPECIAL . '
|
WHERE group_type <> ' . GROUP_SPECIAL . '
|
||||||
ORDER BY group_name ASC';
|
ORDER BY group_name ASC';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$s_group_list = '';
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
|
$s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($s_group_list)
|
||||||
|
{
|
||||||
|
// Only prepend the "All groups" option if there are groups,
|
||||||
|
// otherwise we don't want to display this option at all.
|
||||||
|
$s_group_list = '<option value="0">' . $user->lang['PRUNE_USERS_GROUP_NONE'] . '</option>' . $s_group_list;
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
||||||
|
|
|
@ -52,6 +52,7 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'POSTS_ON_QUEUE' => 'Posts Awaiting Approval',
|
'POSTS_ON_QUEUE' => 'Posts Awaiting Approval',
|
||||||
'PRUNE_USERS_GROUP_EXPLAIN' => 'Limit to users within the selected group.',
|
'PRUNE_USERS_GROUP_EXPLAIN' => 'Limit to users within the selected group.',
|
||||||
|
'PRUNE_USERS_GROUP_NONE' => 'All groups',
|
||||||
'PRUNE_USERS_LIST' => 'Users to be pruned',
|
'PRUNE_USERS_LIST' => 'Users to be pruned',
|
||||||
'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed. You can remove individual users from the deletion list by unchecking the box next to their username.',
|
'PRUNE_USERS_LIST_DELETE' => 'With the selected critera for pruning users the following accounts will be removed. You can remove individual users from the deletion list by unchecking the box next to their username.',
|
||||||
'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated. You can remove individual users from the deactivation list by unchecking the box next to their username.',
|
'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated. You can remove individual users from the deactivation list by unchecking the box next to their username.',
|
||||||
|
|
Loading…
Add table
Reference in a new issue