From: Alexander Ebert Date: Thu, 13 Jun 2013 23:57:13 +0000 (+0200) Subject: Added support for content delete reason X-Git-Tag: 2.0.0_Beta_4~41^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=865142667d5d0d211fb301263a4cead312b777af;p=GitHub%2FWoltLab%2FWCF.git Added support for content delete reason --- diff --git a/com.woltlab.wcf/templates/moderationReport.tpl b/com.woltlab.wcf/templates/moderationReport.tpl index 7ccadf38b6..b4a3432d04 100644 --- a/com.woltlab.wcf/templates/moderationReport.tpl +++ b/com.woltlab.wcf/templates/moderationReport.tpl @@ -13,6 +13,7 @@ WCF.Language.addObject({ 'wcf.moderation.report.removeContent.confirmMessage': '{lang}wcf.moderation.report.removeContent.confirmMessage{/lang}', + 'wcf.moderation.report.removeContent.reason': '{lang}wcf.moderation.report.removeContent.reason{/lang}', 'wcf.moderation.report.removeReport.confirmMessage': '{lang}wcf.moderation.report.removeReport.confirmMessage{/lang}' }); }); diff --git a/wcfsetup/install/files/js/WCF.Moderation.js b/wcfsetup/install/files/js/WCF.Moderation.js index 44c6470539..71c56bccac 100644 --- a/wcfsetup/install/files/js/WCF.Moderation.js +++ b/wcfsetup/install/files/js/WCF.Moderation.js @@ -26,6 +26,12 @@ WCF.Moderation.Management = Class.extend({ */ _className: '', + /** + * list of templates for confirmation message by action name + * @var object + */ + _confirmationTemplate: { }, + /** * language item pattern * @var string @@ -85,19 +91,41 @@ WCF.Moderation.Management = Class.extend({ */ _click: function(event) { var $actionName = $(event.currentTarget).wcfIdentify(); + var $innerTemplate = ''; + if (this._confirmationTemplate[$actionName]) { + $innerTemplate = this._confirmationTemplate[$actionName]; + } WCF.System.Confirmation.show(WCF.Language.get(this._languageItem.replace(/{actionName}/, $actionName)), $.proxy(function(action) { if (action === 'confirm') { - this._proxy.setOption('data', { + var $parameters = { actionName: $actionName, className: this._className, objectIDs: [ this._queueID ] - }); + }; + if (this._confirmationTemplate[$actionName]) { + $parameters.parameters = { }; + $innerTemplate.find('input, textarea').each(function(index, element) { + var $element = $(element); + var $value = $element.val(); + if ($element.getTagName() === 'input' && $element.attr('type') === 'checkbox') { + if (!$element.is(':checked')) { + $value = null; + } + } + + if ($value !== null) { + $parameters.parameters[$element.attr('name')] = $value; + } + }); + } + + this._proxy.setOption('data', $parameters); this._proxy.sendRequest(); $(this._buttonSelector).disable(); } - }, this)); + }, this), { }, $innerTemplate); }, /** @@ -338,6 +366,8 @@ WCF.Moderation.Report.Management = WCF.Moderation.Management.extend({ this._className = 'wcf\\data\\moderation\\queue\\ModerationQueueReportAction'; this._super(queueID, redirectURL, 'wcf.moderation.report.{actionName}.confirmMessage'); + + this._confirmationTemplate.removeContent = $('