Changes some more fields to support i18n. Meanwhile textareas with enabled i18n support may look a bit weird, @Luzifr will be fixing this within time.
</option>
<option name="page_description">
<categoryname>general.page</categoryname>
- <optiontype>text</optiontype>
+ <optiontype>texti18n</optiontype>
+ <supporti18n>1</supporti18n>
</option>
<option name="page_url">
<categoryname>general.page</categoryname>
</option>
<option name="mail_signature">
<categoryname>general.mail.general</categoryname>
- <optiontype>textarea</optiontype>
+ <optiontype>textareai18n</optiontype>
<defaultvalue><![CDATA[]]></defaultvalue>
+ <supporti18n>1</supporti18n>
</option>
<!-- /mail.general -->
--- /dev/null
+<script type="text/javascript">
+ //<![CDATA[
+ $(function() {
+ var $availableLanguages = { {implode from=$availableLanguages key=languageID item=languageName}{@$languageID}: '{$languageName}'{/implode} };
+ var $optionValues = { {implode from=$i18nValues[$option->optionName] key=languageID item=value}'{@$languageID}': '{$value}'{/implode} };
+ new WCF.MultipleLanguageInput('{$option->optionName}', false, $optionValues, $availableLanguages);
+ });
+ //]]>
+</script>
+<textarea id="{$option->optionName}" name="{$option->optionName}" cols="40" rows="10">{$i18nPlainValues[$option->optionName]}</textarea>
use wcf\system\language\I18nHandler;
use wcf\system\WCF;
+/**
+ * TextI18nOptionType is an implementation of IOptionType for 'input type="text"' tags with i18n support.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2011 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.option
+ * @category Community Framework
+ */
class TextI18nOptionType extends TextOptionType {
/**
* @see wcf\system\option\AbstractOptionType::$supportI18n
--- /dev/null
+<?php
+namespace wcf\system\option;
+use wcf\data\option\Option;
+use wcf\system\language\I18nHandler;
+use wcf\system\WCF;
+
+/**
+ * TextareaI18nOptionType is an implementation of IOptionType for 'textarea' tags with i18n support.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2011 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.option
+ * @category Community Framework
+ */
+class TextareaI18nOptionType extends TextareaOptionType {
+ /**
+ * @see wcf\system\option\AbstractOptionType::$supportI18n
+ */
+ protected $supportI18n = true;
+
+ /**
+ * @see wcf\system\option\IOptionType::getFormElement()
+ */
+ public function getFormElement(Option $option, $value) {
+ $useRequestData = (count($_POST)) ? true : false;
+ I18nHandler::getInstance()->assignVariables($useRequestData);
+
+ WCF::getTPL()->assign(array(
+ 'option' => $option,
+ 'value' => $value
+ ));
+ return WCF::getTPL()->fetch('optionTypeTextareaI18n');
+ }
+
+ /**
+ * @see wcf\system\option\IOptionType::validate()
+ */
+ public function validate(Option $option, $newValue) {
+ if (!I18nHandler::getInstance()->validateValue($option->optionName)) {
+ throw new UserInputException($option->optionName, 'validationFailed');
+ }
+ }
+}