From 37113f379c781a3ef96f91a48678c2ab56e00dc4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 6 Jan 2019 18:16:40 +0100 Subject: [PATCH] Language switch for the developement mode See #2819 --- .../templates/__devtoolsLanguageChooser.tpl | 37 +++++++++++++++++++ .../templates/headIncludeJavaScript.tpl | 2 + syncTemplates.json | 1 + .../templates/__devtoolsLanguageChooser.tpl | 37 +++++++++++++++++++ .../install/files/acp/templates/header.tpl | 2 + .../files/lib/data/user/UserAction.class.php | 25 +++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl create mode 100644 wcfsetup/install/files/acp/templates/__devtoolsLanguageChooser.tpl diff --git a/com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl b/com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl new file mode 100644 index 0000000000..fe8e59f50b --- /dev/null +++ b/com.woltlab.wcf/templates/__devtoolsLanguageChooser.tpl @@ -0,0 +1,37 @@ +{if ENABLE_DEBUG_MODE && ENABLE_DEVELOPER_TOOLS && $__wcf->user->userID} + +{/if} diff --git a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl index 677bc2ca04..32d332fb1b 100644 --- a/com.woltlab.wcf/templates/headIncludeJavaScript.tpl +++ b/com.woltlab.wcf/templates/headIncludeJavaScript.tpl @@ -148,6 +148,8 @@ requirejs.config({ define.amd = undefined; +{include file='__devtoolsLanguageChooser'} + {js application='wcf' lib='jquery' hasTiny=true} {js application='wcf' lib='jquery-ui' hasTiny=true} {js application='wcf' lib='jquery-ui' file='touchPunch' bundle='WCF.Combined' hasTiny=true} diff --git a/syncTemplates.json b/syncTemplates.json index d49a5662b7..1cab808a55 100644 --- a/syncTemplates.json +++ b/syncTemplates.json @@ -7,6 +7,7 @@ "__aclFormField", "__booleanFormField", "__dateFormField", + "__devtoolsLanguageChooser", "__dialogForm", "__form", "__formContainer", diff --git a/wcfsetup/install/files/acp/templates/__devtoolsLanguageChooser.tpl b/wcfsetup/install/files/acp/templates/__devtoolsLanguageChooser.tpl new file mode 100644 index 0000000000..fe8e59f50b --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__devtoolsLanguageChooser.tpl @@ -0,0 +1,37 @@ +{if ENABLE_DEBUG_MODE && ENABLE_DEVELOPER_TOOLS && $__wcf->user->userID} + +{/if} diff --git a/wcfsetup/install/files/acp/templates/header.tpl b/wcfsetup/install/files/acp/templates/header.tpl index 7ea46208dd..bafdb5ad74 100644 --- a/wcfsetup/install/files/acp/templates/header.tpl +++ b/wcfsetup/install/files/acp/templates/header.tpl @@ -148,6 +148,8 @@ }); + {include file='__devtoolsLanguageChooser'} +