--- /dev/null
+{include file='header'}
+
+<script type="text/javascript">
+ //<![CDATA[
+ {if $enable == 0}
+ window.onload = function(){
+ $('#languageIDs').hide();
+ }
+ {/if}
+ //]]>
+</script>
+
+<header class="box48 boxHeadline">
+ <img src="{@RELATIVE_WCF_DIR}icon/language1.svg" alt="" class="icon48" />
+ <hgroup>
+ <h1>{lang}wcf.acp.language.multilingualism{/lang}</h1>
+ </hgroup>
+</header>
+
+{if $errorField}
+ <p class="error">{lang}wcf.global.form.error{/lang}</p>
+{/if}
+
+{if $success|isset}
+ <p class="success">{lang}wcf.acp.language.multilingualism.success{/lang}</p>
+{/if}
+
+<form enctype="multipart/form-data" method="post" action="{link controller='LanguageMultilingualism'}{/link}">
+ <div class="container containerPadding marginTop shadow">
+ <dl>
+ <dt><input type="checkbox" id="enable" onclick="if (this.checked) $('#languageIDs').show(); else $('#languageIDs').hide();" name="enable" value="1" {if $enable == 1}checked="checked" {/if}/></dt>
+ <dd>
+ <label for="enable">{lang}wcf.acp.language.multilingualism.enable{/lang}</label>
+ <small>{lang}wcf.acp.language.multilingualism.enable.description{/lang}</small>
+ </dd>
+ </dl>
+
+ <dl{if $errorField == 'languageFile'} class="formError"{/if} id="languageIDs">
+ <dt><label for="languageIDs">{lang}wcf.acp.language.multilingualism.languages{/lang}</label></dt>
+ <dd>
+ <fieldset>
+ <legend>{lang}wcf.acp.language.multilingualism.languages{/lang}</legend>
+
+ <dd>
+ {htmlCheckboxes options=$languages name=languageIDs selected=$languageIDs disableEncoding=true}
+ </dd>
+ </fieldset>
+
+ {if $errorField == 'languageIDs'}
+ <small class="innerError">
+ {if $errorType == 'empty'}{lang}wcf.acp.language.multilingualism.languages.error.empty{/lang}{/if}
+ </small>
+ {/if}
+ </dd>
+ </dl>
+
+ {event name='additionalFields'}
+ </div>
+
+ <div class="formSubmit">
+ <input type="submit" accesskey="s" value="{lang}wcf.global.button.submit{/lang}" />
+ <input type="reset" accesskey="r" value="{lang}wcf.global.button.reset{/lang}" />
+ <input type="hidden" name="packageID" value="{@PACKAGE_ID}" />
+ </div>
+</form>
+
+{include file='footer'}
--- /dev/null
+<?php
+namespace wcf\acp\form;
+use wcf\data\language\LanguageEditor;
+use wcf\system\language\LanguageFactory;
+use wcf\system\exception\UserInputException;
+use wcf\system\cache\CacheHandler;
+use wcf\system\WCF;
+use wcf\system\WCFACP;
+use wcf\util\ArrayUtil;
+
+/**
+ * Shows the language multilingualism form.
+ *
+ * @author Jean-Marc Licht
+ * @copyright 2001-2012 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf.acp.language
+ * @subpackage acp.form
+ * @category Community Framework
+ */
+class LanguageMultilingualismForm extends ACPForm {
+ /**
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
+ */
+ public $activeMenuItem = 'wcf.acp.menu.link.language.multilingualism';
+
+ /**
+ * @see wcf\page\AbstractPage::$neededPermissions
+ */
+ public $neededPermissions = array('admin.language.canEditLanguage');
+
+ // data
+ public $enable = 0;
+ public $languageIDs = array();
+ public $languages = array();
+ public $languageList = array();
+
+ /**
+ * @see wcf\page\IPage::readParameters()
+ */
+ public function readParameters() {
+ parent::readParameters();
+
+ $this->languages = LanguageFactory::getInstance()->getLanguages();
+ }
+
+ /**
+ * @see wcf\form\IForm::readFormParameters()
+ */
+ public function readFormParameters() {
+ parent::readFormParameters();
+
+ if (isset($_POST['enable'])) $this->enable = intval($_POST['enable']);
+ if (isset($_POST['languageIDs']) && is_array($_POST['languageIDs'])) $this->languageIDs = ArrayUtil::toIntegerArray($_POST['languageIDs']);
+ }
+
+ /**
+ * @see wcf\form\IForm::validate()
+ */
+ public function validate() {
+ parent::validate();
+
+ if ($this->enable == 1) {
+ // add default language
+ if (!in_array(LanguageFactory::getInstance()->getDefaultLanguageID(), $this->languageIDs)) {
+ $this->languageIDs[] = LanguageFactory::getInstance()->getDefaultLanguageID();
+ }
+
+ // validate language ids
+ $contentLanguages = 0;
+ foreach ($this->languageIDs as $languageID) {
+ if (isset($this->languages[$languageID])) {
+ $contentLanguages++;
+ }
+ }
+
+ if ($contentLanguages < 2) {
+ throw new UserInputException('languageIDs');
+ }
+ }
+ }
+
+ /**
+ * @see wcf\form\IForm::save()
+ */
+ public function save() {
+ parent::save();
+
+ // save
+ LanguageEditor::enableMultilingualism(($this->enable == 1 ? $this->languageIDs : array()));
+
+ // clear cache
+ CacheHandler::getInstance()->clear(WCF_DIR.'cache/', 'cache.languages.php');
+ $this->saved();
+
+ // show success message
+ WCF::getTPL()->assign('success', true);
+ }
+
+ /**
+ * @see wcf\page\IPage::readData()
+ */
+ public function readData() {
+ parent::readData();
+
+ if (!count($_POST)) {
+ // default values
+ $contentLanguages = 0;
+ foreach ($this->languages as $languageID => $language) {
+ if ($language->hasContent) {
+ $contentLanguages++;
+ $this->languageIDs[] = $languageID;
+ }
+ }
+
+ // add default language
+ if (!in_array(LanguageFactory::getInstance()->getDefaultLanguageID(), $this->languageIDs)) {
+ $this->languageIDs[] = LanguageFactory::getInstance()->getDefaultLanguageID();
+ }
+
+ if ($contentLanguages > 1) {
+ $this->enable = 1;
+ }
+ }
+
+ $this->languageList = LanguageFactory::getInstance()->getLanguages();
+ }
+
+ /**
+ * @see wcf\page\IPage::assignVariables()
+ */
+ public function assignVariables() {
+ parent::assignVariables();
+
+ WCF::getTPL()->assign(array(
+ 'enable' => $this->enable,
+ 'languageIDs' => $this->languageIDs,
+ 'languages' => $this->languageList
+ ));
+ }
+
+ /**
+ * @see wcf\page\IPage::show()
+ */
+ public function show() {
+ // check master password
+ WCFACP::checkMasterPassword();
+
+ parent::show();
+ }
+}
<item name="wcf.acp.language.import.source.file"><![CDATA[Pfad zur Sprachdatei]]></item>
<item name="wcf.acp.language.import.source.file.description"><![CDATA[Geben Sie hier den relativen Pfad zu einer gültigen XML-Sprachdatei an.]]></item>
<item name="wcf.acp.language.import.source.upload"><![CDATA[Sprachdatei vom lokalen Computer hochladen]]></item>
+ <item name="wcf.acp.language.multilingualism"><![CDATA[Mehrsprachigkeit verwalten]]></item>
+ <item name="wcf.acp.language.multilingualism.enable"><![CDATA[Mehrsprachige Inhalte aktivieren]]></item>
+ <item name="wcf.acp.language.multilingualism.enable.description"><![CDATA[Haben Sie mehrere Sprachen installiert, können sich Ihre Mitglieder die Programmoberfläche in diesen Sprachen anzeigen lassen. Erstellte Inhalte werden durch die aktivierte Mehrsprachigkeit außerdem einer Sprache zugeordnet. Die Benutzer können in ihrem Profil auswählen, dass ausschließlich Inhalte von bestimmten Sprachen angezeigt werden. Bei der Erstellung von Inhalten ist standardmäßig die aktive Oberflächensprache vorausgewählt.]]></item>
+ <item name="wcf.acp.language.multilingualism.languages"><![CDATA[Inhalte in folgenden Sprachen zulassen]]></item>
+ <item name="wcf.acp.language.multilingualism.languages.error.empty"><![CDATA[Um die Mehrsprachigkeit zu nutzen, müssen Sie mindestens zwei Sprachen auswählen.]]></item>
+ <item name="wcf.acp.language.multilingualism.success"><![CDATA[Ihre Einstellungen wurden erfolgreich gespeichert.]]></item>
+
</category>
</language>
\ No newline at end of file