diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-07-25 13:25:48 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-07-25 13:27:49 +0200 |
commit | 75aef80104351d276dda5dd3e6cf0b0dfa40d02d (patch) | |
tree | 56402f44e4c0d2f894f891be7c97f83400d13422 /phpBB/styles/subsilver2/template/mcp_ban.html | |
parent | 9e1802396f7fdc3a9908d7c2c4d3bfb8f6156e75 (diff) | |
download | forums-75aef80104351d276dda5dd3e6cf0b0dfa40d02d.tar forums-75aef80104351d276dda5dd3e6cf0b0dfa40d02d.tar.gz forums-75aef80104351d276dda5dd3e6cf0b0dfa40d02d.tar.bz2 forums-75aef80104351d276dda5dd3e6cf0b0dfa40d02d.tar.xz forums-75aef80104351d276dda5dd3e6cf0b0dfa40d02d.zip |
[ticket/12891] Replace template loops with 1 loop to reduce generation time
PHPBB3-12891
Diffstat (limited to 'phpBB/styles/subsilver2/template/mcp_ban.html')
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_ban.html | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html index b6d77c5709..cc24d21d73 100644 --- a/phpBB/styles/subsilver2/template/mcp_ban.html +++ b/phpBB/styles/subsilver2/template/mcp_ban.html @@ -5,27 +5,34 @@ var ban_length = new Array(); ban_length[-1] = ''; - <!-- BEGIN ban_length --> - ban_length['{ban_length.BAN_ID}'] = '{ban_length.A_LENGTH}'; - <!-- END ban_length --> - var ban_reason = new Array(); ban_reason[-1] = ''; - <!-- BEGIN ban_reason --> - ban_reason['{ban_reason.BAN_ID}'] = '{ban_reason.A_REASON}'; - <!-- END ban_reason --> - var ban_give_reason = new Array(); ban_give_reason[-1] = ''; - <!-- BEGIN ban_give_reason --> - ban_give_reason['{ban_give_reason.BAN_ID}'] = '{ban_give_reason.A_REASON}'; - <!-- END ban_give_reason --> + + <!-- BEGIN bans --> + ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}'; + <!-- IF bans.A_REASON --> + ban_reason['{bans.BAN_ID}'] = '{bans.A_REASON}'; + <!-- ENDIF --> + <!-- IF bans.A_GIVE_REASON --> + ban_give_reason['{bans.BAN_ID}'] = '{bans.A_GIVE_REASON}'; + <!-- ENDIF --> + <!-- END bans --> function display_details(option) { - document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option]; - document.getElementById('mcp_ban').unbanreason.value = ban_reason[option]; document.getElementById('mcp_ban').unbanlength.value = ban_length[option]; + if (option in ban_reason) { + document.getElementById('mcp_ban').unbanreason.value = ban_reason[option]; + } else { + document.getElementById('mcp_ban').unbanreason.value = ''; + } + if (option in ban_give_reason) { + document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option]; + } else { + document.getElementById('mcp_ban').unbangivereason.value = ''; + } } // ]]> |