{include file='header'}
-<script type="text/javascript" src="{@$__wcf->getPath()}acp/js/WCF.ACP.StyleEditor.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}acp/js/WCF.ACP.Style.js"></script>
<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.ColorPicker.js"></script>
<script type="text/javascript">
//<![CDATA[
$useFluidLayout.change(useFluidLayout);
useFluidLayout();
- new WCF.ACP.StyleEditor.Upload(0, '{$tmpHash}');
+ new WCF.ACP.Style.ImageUpload(0, '{$tmpHash}');
+
+ {if $action == 'edit' && $__wcf->getSession()->getPermission('admin.style.canAddStyle')}new WCF.ACP.Style.CopyStyle({@$style->styleID});{/if}
+
+ WCF.Language.addObject({
+ 'wcf.acp.style.copyStyle.confirmMessage': '{lang}wcf.acp.style.copyStyle.confirmMessage{/lang}'
+ });
});
//]]>
</script>
<div class="contentNavigation">
<nav>
<ul>
+ {if $action == 'edit'}
+ <li><a href="{link controller='StyleExport' id=$style->styleID}{/link}" class="button"><img src="{@$__wcf->getPath()}icon/download.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.exportStyle{/lang}</span></a></li>
+ {if $__wcf->getSession()->getPermission('admin.style.canAddStyle')}<li><a class="jsCopyStyle button"><img src="{@$__wcf->getPath()}icon/add.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.copyStyle{/lang}</span></a></li>{/if}
+ {/if}
<li><a href="{link controller='StyleList'}{/link}" title="{lang}wcf.acp.menu.link.style.list{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.style.list{/lang}</span></a></li>
</ul>
</nav>
*/
WCF.ACP.Style = { };
+/**
+ * Handles style duplicating.
+ *
+ * @param integer styleID
+ */
+WCF.ACP.Style.CopyStyle = Class.extend({
+ /**
+ * style id
+ * @var integer
+ */
+ _styleID: 0,
+
+ /**
+ * Initializes the WCF.ACP.Style.CopyStyle class.
+ *
+ * @param integer styleID
+ */
+ init: function(styleID) {
+ this._styleID = styleID;
+
+ var self = this;
+ $('.jsCopyStyle').click(function() {
+ WCF.System.Confirmation.show(WCF.Language.get('wcf.acp.style.copyStyle.confirmMessage'), $.proxy(self._copy, self));
+ });
+ },
+
+ /**
+ * Invokes the style duplicating process.
+ *
+ * @param string action
+ */
+ _copy: function(action) {
+ if (action === 'confirm') {
+ new WCF.Action.Proxy({
+ autoSend: true,
+ data: {
+ actionName: 'copy',
+ className: 'wcf\\data\\style\\StyleAction',
+ objectIDs: [ this._styleID ]
+ },
+ success: $.proxy(this._success, this)
+ });
+ }
+ },
+
+ /**
+ * Redirects to newly created style.
+ *
+ * @param object data
+ * @param string textStatus
+ * @param jQuery jqXHR
+ */
+ _success: function(data, textStatus, jqXHR) {
+ window.location = data.returnValues.redirectURL;
+ }
+});
+
/**
* Handles the preview image upload.
*
<item name="wcf.acp.style.colors.tabular"><![CDATA[Tabellarische Auflistungen]]></item>
<item name="wcf.acp.style.colors.userPanel"><![CDATA[Benutzerleiste]]></item>
<item name="wcf.acp.style.copyright"><![CDATA[Copyright]]></item>
+ <item name="wcf.acp.style.copyStyle"><![CDATA[Stil kopieren]]></item>
+ <item name="wcf.acp.style.copyStyle.confirmMessage"><![CDATA[Möchten Sie den Stil „{$style->styleName}“ wirklich duplizieren?]]></item>
<item name="wcf.acp.style.delete.confirmMessage"><![CDATA[Möchten Sie den Stil „{$style->styleName}“ wirklich löschen?]]></item>
+ <item name="wcf.acp.style.edit"><![CDATA[Stil bearbeiten]]></item>
+ <item name="wcf.acp.style.exportStyle"><![CDATA[Stil exportieren]]></item>
<item name="wcf.acp.style.general"><![CDATA[Daten]]></item>
<item name="wcf.acp.style.general.data"><![CDATA[Allgemein]]></item>
<item name="wcf.acp.style.general.files"><![CDATA[Dateien]]></item>