diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-06-12 19:54:26 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-06-18 15:09:45 +0200 |
commit | 5f96e5d374d1702d3d81591b7c69ede1cafebfa7 (patch) | |
tree | d586a266b45f50e4c20941749e623672f8fb941a /phpBB/adm | |
parent | 435573a9cb82060ddae673aa1e1572bd78c7741d (diff) | |
download | forums-5f96e5d374d1702d3d81591b7c69ede1cafebfa7.tar forums-5f96e5d374d1702d3d81591b7c69ede1cafebfa7.tar.gz forums-5f96e5d374d1702d3d81591b7c69ede1cafebfa7.tar.bz2 forums-5f96e5d374d1702d3d81591b7c69ede1cafebfa7.tar.xz forums-5f96e5d374d1702d3d81591b7c69ede1cafebfa7.zip |
[feature/new-tz-handling] Fix timezone option when editing a user in the ACP
PHPBB3-9558
Diffstat (limited to 'phpBB/adm')
-rw-r--r-- | phpBB/adm/style/acp_users_prefs.html | 5 | ||||
-rw-r--r-- | phpBB/adm/style/timezone.js | 29 | ||||
-rw-r--r-- | phpBB/adm/style/timezone_option.html | 20 |
3 files changed, 50 insertions, 4 deletions
diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index 90db62984e..9439f0cf03 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -52,10 +52,7 @@ <dt><label for="style">{L_BOARD_STYLE}:</label></dt> <dd><select id="style" name="style">{S_STYLE_OPTIONS}</select></dd> </dl> - <dl> - <dt><label for="tz">{L_BOARD_TIMEZONE}:</label></dt> - <dd><select id="tz" name="tz" style="width: 100%;">{S_TZ_OPTIONS}</select></dd> - </dl> + <!-- INCLUDE timezone_option.html --> <dl> <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}:</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd> diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js new file mode 100644 index 0000000000..d02c965ab5 --- /dev/null +++ b/phpBB/adm/style/timezone.js @@ -0,0 +1,29 @@ +function phpbb_switch_tz_date(keep_selection) +{ + var timezone_groups = document.getElementById("timezone"); + for (var i = 0; i < timezone_groups.childElementCount; i++) { + if (timezone_groups.children[i].tagName == "OPTGROUP" && + timezone_groups.children[i].label != document.getElementById("tz_date").value) + { + timezone_groups.children[i].style.display = "none"; + } + else if (timezone_groups.children[i].tagName == "OPTGROUP") + { + // Display other options + timezone_groups.children[i].style.display = "block"; + } + } + if (typeof keep_selection !== 'undefined') + { + if (!keep_selection) + { + timezone_groups.children[0].selected = true; + } + } +} + +function phpbb_enable_tz_dates() +{ + var tz_select_date = document.getElementById("tz_select_date"); + tz_select_date.style.display = "block"; +} diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html new file mode 100644 index 0000000000..12e6e3700a --- /dev/null +++ b/phpBB/adm/style/timezone_option.html @@ -0,0 +1,20 @@ +<dl> + <dt><label for="timezone">{L_BOARD_TIMEZONE}:</label></dt> + <!-- IF S_TZ_DATE_OPTIONS --> + <dd id="tz_select_date" style="display: none;"> + <select name="tz_date" id="tz_date" class="autowidth tz_select" onchange="phpbb_switch_tz_date(false);"> + <option value="">{L_SELECT_CURRENT_TIME}</option> + {S_TZ_DATE_OPTIONS} + </select> + </dd> + <!-- ENDIF --> + <dd> + <select name="tz" id="timezone" class="autowidth tz_select"> + <option value="">{L_SELECT_TIMEZONE}</option> + {S_TZ_OPTIONS} + </select> + + <script type="text/javascript" src="{T_TEMPLATE_PATH}/timezone.js"></script> + <script type="text/javascript">phpbb_enable_tz_dates();</script> + </dd> +</dl> |