diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html
index 1a09c4eee6..64592a5de2 100644
--- a/phpBB/adm/style/acp_board.html
+++ b/phpBB/adm/style/acp_board.html
@@ -33,9 +33,12 @@
+
+
-
-
« {L_BACK}
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html
index 496a8b2675..1cde52acf3 100644
--- a/phpBB/adm/style/acp_search.html
+++ b/phpBB/adm/style/acp_search.html
@@ -46,13 +46,13 @@
{L_SEARCH_TYPE_EXPLAIN}
-
+
-
-
-
diff --git a/phpBB/adm/style/auth_provider_ldap.html b/phpBB/adm/style/auth_provider_ldap.html
index 81afa44373..9e0567dfed 100644
--- a/phpBB/adm/style/auth_provider_ldap.html
+++ b/phpBB/adm/style/auth_provider_ldap.html
@@ -1,32 +1,35 @@
-
-
{L_LDAP_SERVER_EXPLAIN}
-
-
-
-
{L_LDAP_PORT_EXPLAIN}
-
-
-
-
{L_LDAP_DN_EXPLAIN}
-
-
-
-
{L_LDAP_UID_EXPLAIN}
-
-
-
-
{L_LDAP_USER_FILTER_EXPLAIN}
-
-
-
-
{L_LDAP_EMAIL_EXPLAIN}
-
-
-
-
{L_LDAP_USER_EXPLAIN}
-
-
-
-
{L_LDAP_PASSWORD_EXPLAIN}
-
-
+
+
+
+
{L_LDAP_SERVER_EXPLAIN}
+
+
+
+
{L_LDAP_PORT_EXPLAIN}
+
+
+
+
{L_LDAP_DN_EXPLAIN}
+
+
+
+
{L_LDAP_UID_EXPLAIN}
+
+
+
+
{L_LDAP_USER_FILTER_EXPLAIN}
+
+
+
+
{L_LDAP_EMAIL_EXPLAIN}
+
+
+
+
{L_LDAP_USER_EXPLAIN}
+
+
+
+
{L_LDAP_PASSWORD_EXPLAIN}
+
+
+
diff --git a/phpBB/adm/style/auth_provider_oauth.html b/phpBB/adm/style/auth_provider_oauth.html
index 25e40ff596..4c8ff4d36c 100644
--- a/phpBB/adm/style/auth_provider_oauth.html
+++ b/phpBB/adm/style/auth_provider_oauth.html
@@ -1,17 +1,18 @@
-{L_AUTH_PROVIDER_OAUTH_TITLE}
-{L_AUTH_PROVIDER_OAUTH_EXPLAIN}
+
diff --git a/phpBB/adm/style/avatars.js b/phpBB/adm/style/avatars.js
deleted file mode 100644
index 26ea24c0db..0000000000
--- a/phpBB/adm/style/avatars.js
+++ /dev/null
@@ -1,15 +0,0 @@
-(function($) { // Avoid conflicts with other libraries
-
-"use strict";
-
-function avatarHide() {
- $('#avatar_options > div').hide();
-
- var selected = $('#avatar_driver').val();
- $('#avatar_option_' + selected).show();
-}
-
-avatarHide();
-$('#avatar_driver').bind('change', avatarHide);
-
-})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ae8583ddbf..cd633ed2ae 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1475,6 +1475,21 @@ phpbb.toggleDisplay = function(id, action, type) {
$('#' + id).css('display', ((action === 1) ? type : 'none'));
}
+/**
+* Toggle additional settings based on the selected
+* option of select element.
+*
+* @param jQuery el jQuery select element object.
+* @return undefined
+*/
+phpbb.toggleSelectSettings = function(el) {
+ el.children().each(function() {
+ var option = $(this),
+ setting = $(option.data('toggle-setting'));
+ setting.toggle(option.is(':selected'));
+ });
+};
+
/**
* Get function from name.
* Based on http://stackoverflow.com/a/359910
@@ -1516,6 +1531,16 @@ $(document).ready(function() {
// Update browser history URL to point to specific post in viewtopic.php
// when using view=unread#unread link.
phpbb.history.replaceUrl($('#unread[data-url]').data('url'));
+
+ // Hide settings that are not selected via select element.
+ $('select[data-togglable-settings]').each(function() {
+ var select = $(this);
+
+ select.change(function() {
+ phpbb.toggleSelectSettings(select);
+ });
+ phpbb.toggleSelectSettings(select);
+ });
});
})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index cf0f23a16e..f054e82de3 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -363,7 +363,7 @@ class acp_board
'title' => 'ACP_AUTH_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AUTH_SETTINGS',
- 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false),
+ 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false),
)
);
break;
@@ -715,7 +715,7 @@ class acp_board
foreach ($auth_plugins as $method)
{
$selected = ($selected_method == $method) ? ' selected="selected"' : '';
- $auth_select .= '';
+ $auth_select .= "';
}
return $auth_select;
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index 11a2511aee..ce1e4afa9b 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -79,7 +79,8 @@ class acp_search
$name = $search->get_name();
$selected = ($config['search_type'] == $type) ? ' selected="selected"' : '';
- $search_options .= '';
+ $identifier = substr($type, strrpos($type, '\\') + 1);
+ $search_options .= "";
if (method_exists($search, 'acp'))
{
@@ -88,9 +89,10 @@ class acp_search
if (!$submit)
{
$template->assign_block_vars('backend', array(
- 'NAME' => $name,
- 'SETTINGS' => $vars['tpl'])
- );
+ 'NAME' => $name,
+ 'SETTINGS' => $vars['tpl'],
+ 'IDENTIFIER' => $identifier,
+ ));
}
else if (is_array($vars['config']))
{
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index 2c66f6009c..1c4d6966da 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -364,8 +364,9 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
if ($tpl_type[0] == 'select')
{
$size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1;
+ $data_toggle = (!empty($tpl_type[2])) ? ' data-togglable-settings="true"' : '';
- $tpl = '';
+ $tpl = '';
}
else
{
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 505709d513..b796206261 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -406,6 +406,7 @@ $lang = array_merge($lang, array(
'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username. Apache authentication can only be used with mod_php (not with a CGI version) and safe_mode disabled.',
+ 'LDAP' => 'LDAP',
'LDAP_DN' => 'LDAP base dn',
'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US.',
'LDAP_EMAIL' => 'LDAP email attribute',
diff --git a/phpBB/styles/prosilver/template/avatars.js b/phpBB/styles/prosilver/template/avatars.js
deleted file mode 100644
index 26ea24c0db..0000000000
--- a/phpBB/styles/prosilver/template/avatars.js
+++ /dev/null
@@ -1,15 +0,0 @@
-(function($) { // Avoid conflicts with other libraries
-
-"use strict";
-
-function avatarHide() {
- $('#avatar_options > div').hide();
-
- var selected = $('#avatar_driver').val();
- $('#avatar_option_' + selected).show();
-}
-
-avatarHide();
-$('#avatar_driver').bind('change', avatarHide);
-
-})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html
index 072f235eb1..4b4581a59c 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html
@@ -16,10 +16,10 @@
-
@@ -46,5 +46,3 @@
-
-
diff --git a/phpBB/styles/subsilver2/template/avatars.js b/phpBB/styles/subsilver2/template/avatars.js
deleted file mode 100644
index 146aca94d3..0000000000
--- a/phpBB/styles/subsilver2/template/avatars.js
+++ /dev/null
@@ -1,15 +0,0 @@
-(function($) { // Avoid conflicts with other libraries
-
-"use strict";
-
-function avatarHide() {
- $('.[class^="avatar_option_"]').hide();
-
- var selected = $('#avatar_driver').val();
- $('.avatar_option_' + selected).show();
-}
-
-avatarHide();
-$('#avatar_driver').bind('change', avatarHide);
-
-})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
index 60a816d00a..07b3edb498 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
@@ -27,10 +27,10 @@
{L_AVATAR_TYPE}{L_COLON} |
-
+
-
+
|
@@ -48,6 +48,4 @@
-
-
diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php
index b943554564..1eb442bb3d 100644
--- a/tests/acp_board/select_auth_method_test.php
+++ b/tests/acp_board/select_auth_method_test.php
@@ -18,8 +18,8 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
public static function select_auth_method_data()
{
return array(
- array('acp_board_valid', ''),
- array('acp_board_invalid', ''),
+ array('acp_board_valid', ''),
+ array('acp_board_invalid', ''),
);
}