diff options
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 41 |
2 files changed, 28 insertions, 14 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 04d0f91300..f286152d89 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -131,6 +131,7 @@ <li>[Change] Smilies no longer require the f_bbcode permission. (Bug #26545)</li> <li>[Change] Ability to define column split in FAQ/BBCode help (Bug #31405)</li> <li>[Change] Changed behaviour of group_create() function to support specifying additional group columns</li> ++ <li>[Feature] Add confirmation for deactivating styles (Bug #14304 - Patch by leviatan21)</li> <li>[Feature] Backported 3.2 captcha plugins.</li> <li>[Feature] Introduced new ACM plugins: <ul> diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 4c33aa1edb..16b1852cd6 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -210,23 +210,36 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'UPDATE ' . STYLES_TABLE . ' - SET style_active = ' . (($action == 'activate') ? 1 : 0) . ' - WHERE style_id = ' . $style_id; - $db->sql_query($sql); - - // Set style to default for any member using deactivated style - if ($action == 'deactivate') + if (($action == 'deactivate' && confirm_box(true)) || $action == 'activate') { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_style = ' . $config['default_style'] . " - WHERE user_style = $style_id"; + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET style_active = ' . (($action == 'activate') ? 1 : 0) . ' + WHERE style_id = ' . $style_id; $db->sql_query($sql); - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_style = 0 - WHERE forum_style = ' . $style_id; - $db->sql_query($sql); + // Set style to default for any member using deactivated style + if ($action == 'deactivate') + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = ' . $config['default_style'] . " + WHERE user_style = $style_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_style = 0 + WHERE forum_style = ' . $style_id; + $db->sql_query($sql); + } + } + elseif ( $action == 'deactivate' ) + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'style_id' => $style_id, + ); + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); } break; } |
