<nav>
<ul>
<li><a href="{link controller='LanguageList'}{/link}" class="button"><span class="icon icon16 icon-list"></span> <span>{lang}wcf.acp.menu.link.language.list{/lang}</span></a></li>
-
+
{event name='contentNavigationButtons'}
</ul>
</nav>
</div>
-<form enctype="multipart/form-data" method="post" action="{link controller='LanguageExport' id=$languageID}{/link}">
+<form enctype="multipart/form-data" method="post" action="{link controller='LanguageExport'}{/link}">
<div class="container containerPadding marginTop">
<fieldset>
<legend>{lang}wcf.acp.language.export{/lang}</legend>
- <dl>
+ <dl{if $errorField == 'languageID'} class="formError"{/if}>
<dt><label for="languageID">{lang}wcf.user.language{/lang}</label></dt>
<dd>
{htmlOptions options=$languages selected=$languageID name='languageID' id='languageID'}
+ {if $errorField == 'languageID'}
+ <small class="innerError">
+ {if $errorType == 'noValidSelection'}
+ {lang}wcf.global.form.error.noValidSelection{/lang}
+ {else}
+ {lang}wcf.acp.language.languageID.error.{@$errorType}{/lang}
+ {/if}
+ </small>
+ {/if}
</dd>
</dl>
</div>
</form>
-{include file='footer'}
\ No newline at end of file
+{include file='footer'}
use wcf\data\package\Package;
use wcf\form\AbstractForm;
use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\UserInputException;
use wcf\system\language\LanguageFactory;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
* Shows the language export form.
*
* @author Marcel Werk
- * @copyright 2001-2014 WoltLab GmbH
+ * @copyright 2001-2015 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.form
public function readParameters() {
parent::readParameters();
- // get language editor object
if (isset($_REQUEST['id'])) $this->languageID = intval($_REQUEST['id']);
- $language = LanguageFactory::getInstance()->getLanguage($this->languageID);
- if ($language === null) {
- throw new IllegalLinkException();
- }
- $this->language = new LanguageEditor($language);
}
/**
if (isset($this->selectedPackages[0])) unset($this->selectedPackages[0]);
}
- if (isset($_POST['exportCustomValues'])) {
- $this->exportCustomValues = intval($_POST['exportCustomValues']);
+ if (isset($_POST['exportCustomValues'])) $this->exportCustomValues = intval($_POST['exportCustomValues']);
+ if (isset($_POST['languageID'])) $this->languageID = intval($_POST['languageID']);
+ }
+
+ /**
+ * @see \wcf\form\IForm::validate()
+ */
+ public function validate() {
+ parent::validate();
+
+ $language = LanguageFactory::getInstance()->getLanguage($this->languageID);
+ if ($language === null) {
+ throw new UserInputException('languageID', 'noValidSelection');
}
+ $this->language = new LanguageEditor($language);
}
/**
public function readData() {
parent::readData();
+ if (empty($_POST) && $this->languageID) {
+ $language = LanguageFactory::getInstance()->getLanguage($this->languageID);
+ if ($language === null) {
+ throw new IllegalLinkException();
+ }
+ $this->language = new LanguageEditor($language);
+ }
+
$this->readPackages();
}