diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-10-17 15:40:03 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-10-17 15:40:03 +0200 |
commit | 01df1d3301ab533e92e374594d8cb35692def491 (patch) | |
tree | 02aece0323dffa60cc87c68b51defa691a50c0ef /phpBB/includes/acp | |
parent | 39e51e559980d239a08a59e789a1165cc2bbcfff (diff) | |
download | forums-01df1d3301ab533e92e374594d8cb35692def491.tar forums-01df1d3301ab533e92e374594d8cb35692def491.tar.gz forums-01df1d3301ab533e92e374594d8cb35692def491.tar.bz2 forums-01df1d3301ab533e92e374594d8cb35692def491.tar.xz forums-01df1d3301ab533e92e374594d8cb35692def491.zip |
[ticket/11863] Grey out unavailable activation methods when emails disabled
Further fall back to USER_ACTIVATION_DISABLE when emails are disabled
but evaluate it at runtime.
PHPBB3-11863
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index f4f7512f0c..dd6c731abb 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -792,20 +792,19 @@ class acp_board global $user, $config; $act_ary = array( - 'ACC_DISABLE' => USER_ACTIVATION_DISABLE, - 'ACC_NONE' => USER_ACTIVATION_NONE, + 'ACC_DISABLE' => array(true, USER_ACTIVATION_DISABLE), + 'ACC_NONE' => array(true, USER_ACTIVATION_NONE), + 'ACC_USER' => array($config['email_enable'], USER_ACTIVATION_SELF), + 'ACC_ADMIN' => array($config['email_enable'], USER_ACTIVATION_ADMIN), ); - if ($config['email_enable']) - { - $act_ary['ACC_USER'] = USER_ACTIVATION_SELF; - $act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN; - } - $act_options = ''; - foreach ($act_ary as $key => $value) + $act_options = ''; + foreach ($act_ary as $key => $data) { + list($available, $value) = $data; $selected = ($selected_value == $value) ? ' selected="selected"' : ''; - $act_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$key] . '</option>'; + $class = (!$available) ? ' class="disabled-option"' : ''; + $act_options .= '<option value="' . $value . '"' . $selected . $class . '>' . $user->lang($key) . '</option>'; } return $act_options; |