Files
webgui/plugins/dynamix/LanguageButton.page
2020-05-14 23:23:29 +02:00

32 lines
924 B
Plaintext

Menu="Buttons:1"
Title="English"
Icon="icon-u-switch"
Code="e982"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<script>
<?if (count(glob('/var/log/plugins/lang-*.xml'))==0 || $locale==''):?>
// hide switch button when no other language packs
$(function(){$('#nav-item.LanguageButton').hide();});
<?endif;?>
function LanguageButton() {
var locale = '<?=$locale?>';
if (locale) switchLanguage('');
}
function switchLanguage(lang) {
$.post('/webGui/include/LanguageReset.php',{lang:lang},function(){location.reload();});
}
</script>