From: Matthias Schmidt Date: Wed, 3 Apr 2019 17:20:33 +0000 (+0200) Subject: Add JavaScript data handlers for form builder forms X-Git-Tag: 5.2.0_Alpha_1~173 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=477f6668abcef42b09b5bcc8cdfd70be8f463983;p=GitHub%2FWoltLab%2FWCF.git Add JavaScript data handlers for form builder forms … for easier Ajax form support. See #2509 --- diff --git a/com.woltlab.wcf/templates/__captchaFormField.tpl b/com.woltlab.wcf/templates/__captchaFormField.tpl index f4202f8f1c..360f272abc 100644 --- a/com.woltlab.wcf/templates/__captchaFormField.tpl +++ b/com.woltlab.wcf/templates/__captchaFormField.tpl @@ -1 +1,3 @@ {@$field->getObjectType()->getProcessor()->getFormElement()} + +{include file='__formFieldDataHandler'} diff --git a/com.woltlab.wcf/templates/__form.tpl b/com.woltlab.wcf/templates/__form.tpl index 4a1fcadb94..8719c7e04b 100644 --- a/com.woltlab.wcf/templates/__form.tpl +++ b/com.woltlab.wcf/templates/__form.tpl @@ -1,7 +1,21 @@ diff --git a/com.woltlab.wcf/templates/__formFieldDataHandler.tpl b/com.woltlab.wcf/templates/__formFieldDataHandler.tpl new file mode 100644 index 0000000000..83b9800f29 --- /dev/null +++ b/com.woltlab.wcf/templates/__formFieldDataHandler.tpl @@ -0,0 +1,16 @@ +{if $field->getDocument()->isAjax() && !$javaScriptDataHandlerModule|empty} + +{/if} diff --git a/com.woltlab.wcf/templates/__formFieldFooter.tpl b/com.woltlab.wcf/templates/__formFieldFooter.tpl index bb5c687390..f420d74d3d 100644 --- a/com.woltlab.wcf/templates/__formFieldFooter.tpl +++ b/com.woltlab.wcf/templates/__formFieldFooter.tpl @@ -1,5 +1,6 @@ {include file='__formFieldDescription'} {include file='__formFieldErrors'} {include file='__formFieldDependencies'} + {include file='__formFieldDataHandler'} diff --git a/com.woltlab.wcf/templates/__labelFormField.tpl b/com.woltlab.wcf/templates/__labelFormField.tpl index 071acec516..971066d4b1 100644 --- a/com.woltlab.wcf/templates/__labelFormField.tpl +++ b/com.woltlab.wcf/templates/__labelFormField.tpl @@ -27,7 +27,7 @@ {js application='wcf' file='WCF.Label' bundle='WCF.Combined'} diff --git a/wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl b/wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl new file mode 100644 index 0000000000..d4651bd1c2 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl @@ -0,0 +1,16 @@ +{if $field->getDocument()->isAjax() && !$javaScriptDataHandlerModule|empty} + +{/if} diff --git a/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl b/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl index bb5c687390..f420d74d3d 100644 --- a/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl +++ b/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl @@ -1,5 +1,6 @@ {include file='__formFieldDescription'} {include file='__formFieldErrors'} {include file='__formFieldDependencies'} + {include file='__formFieldDataHandler'} diff --git a/wcfsetup/install/files/acp/templates/__labelFormField.tpl b/wcfsetup/install/files/acp/templates/__labelFormField.tpl index 071acec516..971066d4b1 100644 --- a/wcfsetup/install/files/acp/templates/__labelFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__labelFormField.tpl @@ -27,7 +27,7 @@ {js application='wcf' file='WCF.Label' bundle='WCF.Combined'}