--- /dev/null
+{include file='header'}
+
+<header class="boxHeadline">
+ <hgroup>
+ <h1>{lang}wcf.acp.style.exportStyle{/lang}</h1>
+ </hgroup>
+</header>
+
+<div class="contentNavigation">
+ <nav>
+ <ul>
+ <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>
+</div>
+
+<form method="post" action="{link controller='StyleExport'}{/link}">
+ <div class="container containerPadding marginTop shadow">
+ <fieldset>
+ <legend>{lang}wcf.acp.style.exportStyle.components{/lang}</legend>
+ <small>{lang}wcf.acp.style.exportStyle.components.description{/lang}</small>
+
+ <dl>
+ <dd>
+ <label><input type="checkbox" name="exportIcons" value="1"{if $exportIcons} checked="checked"{/if}{if !$canExportIcons} disabled="disabled"{/if} /> <span>{lang}wcf.acp.style.exportIcons{/lang}</span></label>
+ </dd>
+ </dl>
+ <dl>
+ <dd>
+ <label><input type="checkbox" name="exportImages" value="1"{if $exportImages} checked="checked"{/if}{if !$canExportImages} disabled="disabled"{/if} /> <span>{lang}wcf.acp.style.exportImages{/lang}</span></label>
+ </dd>
+ </dl>
+ <dl>
+ <dd>
+ <label><input type="checkbox" name="exportTemplates" value="1"{if $exportTemplates} checked="checked"{/if}{if !$canExportTemplates} disabled="disabled"{/if} /> <span>{lang}wcf.acp.style.exportTemplates{/lang}</span></label>
+ </dd>
+ </dl>
+ </fieldset>
+ </div>
+
+ <div class="formSubmit">
+ <input type="submit" value="{lang}wcf.acp.style.button.exportStyle{/lang}" accesskey="s" />
+ <input type="hidden" name="id" value="{@$styleID}" />
+ </div>
+</form>
+
+{include file='footer'}
\ No newline at end of file
--- /dev/null
+<?php
+namespace wcf\acp\form;
+use wcf\data\style\Style;
+use wcf\data\style\StyleEditor;
+use wcf\form\AbstractForm;
+use wcf\system\exception\IllegalLinkException;
+use wcf\system\WCF;
+use wcf\util\StringUtil;
+
+/**
+ * Shows the style export form.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf.acp.style
+ * @subpackage acp.form
+ * @category Community Framework
+ */
+class StyleExportForm extends AbstractForm {
+ /**
+ * true, if style has custom icons
+ * @var boolean
+ */
+ public $canExportIcons = false;
+
+ /**
+ * true, if style has custom images
+ * @var boolean
+ */
+ public $canExportImages = false;
+
+ /**
+ * true, if style has custom templates
+ * @var boolean
+ */
+ public $canExportTemplates = false;
+
+ /**
+ * true, if icons should be exported
+ * @var boolean
+ */
+ public $exportIcons = false;
+
+ /**
+ * true, if images should be exported
+ * @var boolean
+ */
+ public $exportImages = false;
+
+ /**
+ * true, if templates should be exported
+ * @var boolean
+ */
+ public $exportTemplates = false;
+
+ /**
+ * @see wcf\page\AbstractPage::$neededPermissions
+ */
+ public $neededPermissions = array('admin.style.canEditStyle');
+
+ /**
+ * style object
+ * @var wcf\data\style\Style
+ */
+ public $style = null;
+
+ /**
+ * style id
+ * @var integer
+ */
+ public $styleID = 0;
+
+ /**
+ * @see wcf\page\IPage::readParameters()
+ */
+ public function readParameters() {
+ parent::readParameters();
+
+ if (isset($_REQUEST['id'])) $this->styleID = intval($_REQUEST['id']);
+ $this->style = new Style($this->styleID);
+ if (!$this->style->styleID) {
+ throw new IllegalLinkException();
+ }
+
+ if ($this->style->iconPath && $this->style->iconPath != 'icon/') $this->canExportIcons = true;
+ if ($this->style->imagePath && $this->style->imagePath != 'images/') $this->canExportImages = true;
+ if ($this->style->templateGroupID) $this->canExportTemplates = true;
+ }
+
+ /**
+ * @see wcf\form\IForm::readFormParameters()
+ */
+ public function readFormParameters() {
+ parent::readFormParameters();
+
+ if ($this->canExportIcons && isset($_POST['exportIcons'])) $this->exportIcons = true;
+ if ($this->canExportImages && isset($_POST['exportImages'])) $this->exportImages = true;
+ if ($this->canExportTemplates && isset($_POST['exportTemplates'])) $this->exportTemplates = true;
+ }
+
+ /**
+ * @see wcf\form\IForm::save()
+ */
+ public function save() {
+ parent::save();
+
+ // get style filename
+ $filename = str_replace(' ', '-', preg_replace('/[^a-z0-9 _-]/', '', StringUtil::toLowerCase($this->style->styleName)));
+
+ // send headers
+ header('Content-Type: application/x-gzip; charset=utf-8');
+ header('Content-Disposition: attachment; filename="'.$filename.'-style.tgz"');
+
+ // export style
+ $styleEditor = new StyleEditor($this->style);
+ $styleEditor->export($this->exportTemplates, $this->exportImages, $this->exportIcons);
+
+ // call saved event
+ $this->saved();
+
+ exit;
+ }
+
+ /**
+ * @see wcf\form\IForm::assignVariables()
+ */
+ public function assignVariables() {
+ parent::assignVariables();
+
+ WCF::getTPL()->assign(array(
+ 'canExportIcons' => $this->canExportIcons,
+ 'canExportImages' => $this->canExportImages,
+ 'canExportTemplates' => $this->canExportTemplates,
+ 'exportIcons' => $this->exportIcons,
+ 'exportImages' => $this->exportImages,
+ 'exportTemplates' => $this->exportTemplates,
+ 'style' => $this->style,
+ 'styleID' => $this->styleID
+ ));
+ }
+}
<item name="wcf.acp.style.add"><![CDATA[Stil hinzufügen]]></item>
<item name="wcf.acp.style.authorName"><![CDATA[Autor]]></item>
<item name="wcf.acp.style.authorURL"><![CDATA[Website]]></item>
+ <item name="wcf.acp.style.button.exportStyle"><![CDATA[Export starten]]></item>
<item name="wcf.acp.style.button.setAsDefault"><![CDATA[Zum Standard machen]]></item>
<item name="wcf.acp.style.colors"><![CDATA[Farbpalette]]></item>
<item name="wcf.acp.style.colors.accentBackgroundColor"><![CDATA[Hintergrundfarbe (Akzent)]]></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.exportIcons"><![CDATA[Icons exportieren ({$style->iconPath})]]></item>
+ <item name="wcf.acp.style.exportImages"><![CDATA[Grafiken exportieren ({$style->imagePath})]]></item>
+ <item name="wcf.acp.style.exportTemplates"><![CDATA[Templates exportieren]]></item>
<item name="wcf.acp.style.exportStyle"><![CDATA[Stil exportieren]]></item>
+ <item name="wcf.acp.style.exportStyle.components"><![CDATA[Optionen]]></item>
+ <item name="wcf.acp.style.exportStyle.components.description"><![CDATA[Wählen Sie hier aus, welche Bestandteile des Stils „{$style->styleName}“ mit exportiert werden sollen]]></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>