From: Joshua Rüsweg Date: Mon, 28 Jan 2019 17:00:25 +0000 (+0100) Subject: Add support for uploads in the acp X-Git-Tag: 5.2.0_Alpha_1~296^2~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=48fa35d13af915ade635704071bbda4253daadef;p=GitHub%2FWoltLab%2FWCF.git Add support for uploads in the acp See #2825 --- diff --git a/syncTemplates.json b/syncTemplates.json index 1cab808a55..a2097268ce 100644 --- a/syncTemplates.json +++ b/syncTemplates.json @@ -34,6 +34,7 @@ "__tabTabMenuFormContainer", "__tagFormField", "__textFormField", + "__uploadFormField", "__userFormField", "__usernameFormField", "__valueFormFieldDependency", @@ -62,6 +63,7 @@ "sitemapEnd", "sitemapStart", "trophyImage", + "uploadFieldComponent", "userConditions", "userOptionsCondition", "worker", diff --git a/wcfsetup/install/files/acp/templates/__uploadFormField.tpl b/wcfsetup/install/files/acp/templates/__uploadFormField.tpl new file mode 100644 index 0000000000..83bcc45a13 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__uploadFormField.tpl @@ -0,0 +1,5 @@ +{include file='__formFieldHeader'} + +{@$__wcf->getUploadHandler()->renderField($field->getPrefixedId())} + +{include file='__formFieldFooter'} diff --git a/wcfsetup/install/files/acp/templates/uploadFieldComponent.tpl b/wcfsetup/install/files/acp/templates/uploadFieldComponent.tpl new file mode 100644 index 0000000000..3fa0ea00d7 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/uploadFieldComponent.tpl @@ -0,0 +1,48 @@ +{if !$uploadField->supportMultipleFiles() && $uploadField->isImageOnly()} +
{* + *}{if !$uploadFieldFiles|empty}{* + *}{assign var="file" value=$uploadFieldFiles|reset}{* + *}{* + *} + + {/if}{* + *}
+{else} +
+ +
+{/if} + +
+ + + + \ No newline at end of file diff --git a/wcfsetup/install/files/lib/acp/action/AJAXFileDeleteAction.class.php b/wcfsetup/install/files/lib/acp/action/AJAXFileDeleteAction.class.php new file mode 100644 index 0000000000..48729662e1 --- /dev/null +++ b/wcfsetup/install/files/lib/acp/action/AJAXFileDeleteAction.class.php @@ -0,0 +1,13 @@ + + * @package WoltLabSuite\Core\Acp\Action + * @since 5.2 + */ +class AJAXFileDeleteAction extends \wcf\action\AJAXFileDeleteAction { } diff --git a/wcfsetup/install/files/lib/acp/action/AJAXFileUploadAction.class.php b/wcfsetup/install/files/lib/acp/action/AJAXFileUploadAction.class.php new file mode 100644 index 0000000000..ad01d02aeb --- /dev/null +++ b/wcfsetup/install/files/lib/acp/action/AJAXFileUploadAction.class.php @@ -0,0 +1,13 @@ + + * @package WoltLabSuite\Core\Acp\Action + * @since 5.2 + */ +class AJAXFileUploadAction extends \wcf\action\AJAXFileUploadAction { }