diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-11-13 21:14:21 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-11-13 21:14:21 +0100 |
commit | 3dfb11694247dc065529b193f51b9074ebda6784 (patch) | |
tree | 7c5298cf63e350596b6e4bf8398de648b41ab64e /phpBB/includes/acp/acp_ban.php | |
parent | 1b003fd244a9377731f118b62850861210d0a9b0 (diff) | |
parent | 9553b2239c7de8359489630943d8a4d0ab383478 (diff) | |
download | forums-3dfb11694247dc065529b193f51b9074ebda6784.tar forums-3dfb11694247dc065529b193f51b9074ebda6784.tar.gz forums-3dfb11694247dc065529b193f51b9074ebda6784.tar.bz2 forums-3dfb11694247dc065529b193f51b9074ebda6784.tar.xz forums-3dfb11694247dc065529b193f51b9074ebda6784.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/10087] Organize bans in acp_baninto optgroups
Diffstat (limited to 'phpBB/includes/acp/acp_ban.php')
-rw-r--r-- | phpBB/includes/acp/acp_ban.php | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 00e68367fd..d881fc6bdc 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -175,12 +175,21 @@ class acp_ban } $result = $db->sql_query($sql); - $banned_options = ''; + $banned_options = $excluded_options = array(); $ban_length = $ban_reasons = $ban_give_reasons = array(); while ($row = $db->sql_fetchrow($result)) { - $banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>'; + $option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>'; + + if ($row['ban_exclude']) + { + $excluded_options[] = $option; + } + else + { + $banned_options[] = $option; + } $time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0; @@ -241,10 +250,25 @@ class acp_ban } } + $options = ''; + if ($excluded_options) + { + $options .= '<optgroup label="' . $user->lang['OPTIONS_EXCLUDED'] . '">'; + $options .= implode('', $excluded_options); + $options .= '</optgroup>'; + } + + if ($banned_options) + { + $options .= '<optgroup label="' . $user->lang['OPTIONS_BANNED'] . '">'; + $options .= implode('', $banned_options); + $options .= '</optgroup>'; + } + $template->assign_vars(array( 'S_BAN_END_OPTIONS' => $ban_end_options, - 'S_BANNED_OPTIONS' => ($banned_options) ? true : false, - 'BANNED_OPTIONS' => $banned_options) - ); + 'S_BANNED_OPTIONS' => ($banned_options || $excluded_options) ? true : false, + 'BANNED_OPTIONS' => $options, + )); } } |