Adds multipleLanguageInputJavascript frontend template
authorMatthias Schmidt <gravatronics@live.com>
Fri, 6 Jul 2012 19:53:22 +0000 (21:53 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 6 Jul 2012 19:53:22 +0000 (21:53 +0200)
com.woltlab.wcf/template/multipleLanguageInputJavascript.tpl [new file with mode: 0644]

diff --git a/com.woltlab.wcf/template/multipleLanguageInputJavascript.tpl b/com.woltlab.wcf/template/multipleLanguageInputJavascript.tpl
new file mode 100644 (file)
index 0000000..2a4a32a
--- /dev/null
@@ -0,0 +1,10 @@
+{if !$forceSelection|isset}{assign var=forceSelection value=false}{/if}
+<script type="text/javascript">
+       //<![CDATA[
+       $(function() {
+               var $availableLanguages = { {implode from=$availableLanguages key=languageID item=languageName}{@$languageID}: '{$languageName}'{/implode} };
+               var $values = { {implode from=$i18nValues[$elementIdentifier] key=languageID item=value}'{@$languageID}': '{$value}'{/implode} };
+               new WCF.MultipleLanguageInput('{@$elementIdentifier}', {if $forceSelection}true{else}false{/if}, $values, $availableLanguages);
+       });
+       //]]>
+</script>
\ No newline at end of file