*/
_className: '',
+ /**
+ * list of templates for confirmation message by action name
+ * @var object
+ */
+ _confirmationTemplate: { },
+
/**
* language item pattern
* @var string
*/
_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);
},
/**
this._className = 'wcf\\data\\moderation\\queue\\ModerationQueueReportAction';
this._super(queueID, redirectURL, 'wcf.moderation.report.{actionName}.confirmMessage');
+
+ this._confirmationTemplate.removeContent = $('<fieldset><dl><dt><label for="message">' + WCF.Language.get('wcf.moderation.report.removeContent.reason') + '</label></dt><dd><textarea name="message" id="message" cols="40" rows="3" /></dd></dl></fieldset>');
}
});
<item name="wcf.moderation.report.reason.description"><![CDATA[Diese Funktion ist ausschließlich zu verwenden bei: Spam, Werbung und anderen problematischen (rassistischen, gewaltverherrlichenden, agressiven, beleidigenden oder sexistischen) Inhalten.]]></item>
<item name="wcf.moderation.report.removeContent"><![CDATA[Gemeldeten Inhalt löschen]]></item>
<item name="wcf.moderation.report.removeContent.confirmMessage"><![CDATA[Wollen Sie den gemeldeten Inhalt wirklich löschen?]]></item>
+ <item name="wcf.moderation.report.removeContent.reason"><![CDATA[Begründung (optional)]]></item>
<item name="wcf.moderation.report.removeReport"><![CDATA[Meldung löschen]]></item>
<item name="wcf.moderation.report.removeReport.confirmMessage"><![CDATA[Wollen Sie diese Meldung wirklich löschen?]]></item>
<item name="wcf.moderation.report.reportContent"><![CDATA[Inhalt melden]]></item>
<item name="wcf.moderation.report.reason.description"><![CDATA[This function is reserved for: Spam, Advertisement and other questionable (rassism, glorification of violence, offending or sexist) content]]></item>
<item name="wcf.moderation.report.removeContent"><![CDATA[Delete Reported Content]]></item>
<item name="wcf.moderation.report.removeContent.confirmMessage"><![CDATA[Do you really want to delete the reported content?]]></item>
+ <item name="wcf.moderation.report.removeContent.reason"><![CDATA[Reason (optional)]]></item>
<item name="wcf.moderation.report.removeReport"><![CDATA[Delete Report]]></item>
<item name="wcf.moderation.report.removeReport.confirmMessage"><![CDATA[Do you really want to delete this report?]]></item>
<item name="wcf.moderation.report.reportContent"><![CDATA[Report Content]]></item>