From: Matthias Schmidt Date: Sun, 29 Sep 2019 13:51:39 +0000 (+0200) Subject: Fix wysiwyg form container for prefixed forms X-Git-Tag: 5.2.0_Beta_2~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b12192342f59cd28dc13c037a8f7834732a22740;p=GitHub%2FWoltLab%2FWCF.git Fix wysiwyg form container for prefixed forms --- diff --git a/com.woltlab.wcf/templates/__pollOptionsFormField.tpl b/com.woltlab.wcf/templates/__pollOptionsFormField.tpl index c2ea0a9edb..b582ffde89 100644 --- a/com.woltlab.wcf/templates/__pollOptionsFormField.tpl +++ b/com.woltlab.wcf/templates/__pollOptionsFormField.tpl @@ -16,7 +16,7 @@ new UiPollEditor( DomUtil.identify(DomTraverse.childByTag(elById('{@$field->getPrefixedId()}Container'), 'DD')), [ {implode from=$field->getValue() item=pollOption}{ optionID: {@$pollOption[optionID]}, optionValue: '{$pollOption[optionValue]|encodeJS}' }{/implode} ], - '{@$field->getWysiwygId()}', + '{@$field->getPrefixedWysiwygId()}', { isAjax: {if $field->getDocument()->isAjax()}true{else}false{/if}, maxOptions: {@POLL_MAX_OPTIONS} diff --git a/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl b/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl index 4a12ce6d37..6517d07e96 100644 --- a/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl +++ b/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl @@ -66,7 +66,7 @@ '{$field->getAttachmentHandler()->getTmpHashes()[0]|encodeJS}', '{@$field->getAttachmentHandler()->getParentObjectID()}', {@$field->getAttachmentHandler()->getMaxCount()}, - '{@$field->getWysiwygId()}' + '{@$field->getPrefixedWysiwygId()}' ); new WCF.Action.Delete('wcf\\data\\attachment\\AttachmentAction', '.formAttachmentList > li'); }); diff --git a/com.woltlab.wcf/templates/__wysiwygPreviewFormButton.tpl b/com.woltlab.wcf/templates/__wysiwygPreviewFormButton.tpl index ffdcb291fa..6501f1538e 100644 --- a/com.woltlab.wcf/templates/__wysiwygPreviewFormButton.tpl +++ b/com.woltlab.wcf/templates/__wysiwygPreviewFormButton.tpl @@ -11,7 +11,7 @@ }); new WCF.Message.DefaultPreview({ - messageFieldID: '{@$button->getWysiwygId()}', + messageFieldID: '{@$button->getPrefixedWysiwygId()}', previewButtonID: '{@$button->getPrefixedId()}', messageObjectType: '{@$button->getObjectType()->objectType}', messageObjectID: '{@$button->getObjectId()}' diff --git a/com.woltlab.wcf/templates/__wysiwygSmileyFormContainer.tpl b/com.woltlab.wcf/templates/__wysiwygSmileyFormContainer.tpl index 6f572aa277..4a6df1a9ee 100644 --- a/com.woltlab.wcf/templates/__wysiwygSmileyFormContainer.tpl +++ b/com.woltlab.wcf/templates/__wysiwygSmileyFormContainer.tpl @@ -3,9 +3,11 @@ diff --git a/wcfsetup/install/files/acp/templates/__pollOptionsFormField.tpl b/wcfsetup/install/files/acp/templates/__pollOptionsFormField.tpl index c2ea0a9edb..b582ffde89 100644 --- a/wcfsetup/install/files/acp/templates/__pollOptionsFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__pollOptionsFormField.tpl @@ -16,7 +16,7 @@ new UiPollEditor( DomUtil.identify(DomTraverse.childByTag(elById('{@$field->getPrefixedId()}Container'), 'DD')), [ {implode from=$field->getValue() item=pollOption}{ optionID: {@$pollOption[optionID]}, optionValue: '{$pollOption[optionValue]|encodeJS}' }{/implode} ], - '{@$field->getWysiwygId()}', + '{@$field->getPrefixedWysiwygId()}', { isAjax: {if $field->getDocument()->isAjax()}true{else}false{/if}, maxOptions: {@POLL_MAX_OPTIONS} diff --git a/wcfsetup/install/files/acp/templates/__wysiwygPreviewFormButton.tpl b/wcfsetup/install/files/acp/templates/__wysiwygPreviewFormButton.tpl index ffdcb291fa..6501f1538e 100644 --- a/wcfsetup/install/files/acp/templates/__wysiwygPreviewFormButton.tpl +++ b/wcfsetup/install/files/acp/templates/__wysiwygPreviewFormButton.tpl @@ -11,7 +11,7 @@ }); new WCF.Message.DefaultPreview({ - messageFieldID: '{@$button->getWysiwygId()}', + messageFieldID: '{@$button->getPrefixedWysiwygId()}', previewButtonID: '{@$button->getPrefixedId()}', messageObjectType: '{@$button->getObjectType()->objectType}', messageObjectID: '{@$button->getObjectId()}' diff --git a/wcfsetup/install/files/acp/templates/__wysiwygSmileyFormContainer.tpl b/wcfsetup/install/files/acp/templates/__wysiwygSmileyFormContainer.tpl index 6f572aa277..4a6df1a9ee 100644 --- a/wcfsetup/install/files/acp/templates/__wysiwygSmileyFormContainer.tpl +++ b/wcfsetup/install/files/acp/templates/__wysiwygSmileyFormContainer.tpl @@ -3,9 +3,11 @@ diff --git a/wcfsetup/install/files/lib/system/form/builder/TWysiwygFormNode.class.php b/wcfsetup/install/files/lib/system/form/builder/TWysiwygFormNode.class.php index a0f4a85da2..24bfff16fb 100644 --- a/wcfsetup/install/files/lib/system/form/builder/TWysiwygFormNode.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/TWysiwygFormNode.class.php @@ -18,6 +18,16 @@ trait TWysiwygFormNode { */ protected $wysiwygId; + /** + * Returns the prefixed id of the related `WysiwygFormField` form field. + * + * @return string + * @throws \BadMethodCallException if the id of the related `WysiwygFormField` form field is unknown + */ + public function getPrefixedWysiwygId() { + return $this->getDocument()->getPrefix() . $this->getWysiwygId(); + } + /** * Returns id of the related `WysiwygFormField` form field. *