/** * Invokes the whole application. */ public function invoke() { $this->_pageKey = getGetValue('page', 'accounts'); $this->_subKey = getGetValue('sub'); $sessionLang = jpWotSession::get('active_language'); if (empty($sessionLang)) { jpWotSession::set('active_language', strtolower(trim(jpWotConfig::$lang))); } $changeLang = getPostValue('lang'); if (isset($changeLang['current'], $changeLang['new']) && $changeLang['current'] != $changeLang['new']) { jpWotSession::set('active_language', $changeLang['new']); $langKey = $changeLang['new']; } else { $langKey = jpWotSession::get('active_language'); } $langKey = $this->getIniLanguageKey($langKey); $language = jpWotLanguage::getInstance(); $language->load('main', BPATH, $langKey); $language->load('filter', BPATH, $langKey); $language->load($this->_pageKey, BPATH, $langKey); $controller = $this->getControllerInstance(); $page = getPostValue('request'); if (!empty($page)) { $controller->setRequestData($page); } $controller->index(); }
<?php /** * @package jpWot * @author Philipp John <*****@*****.**> * @copyright (c) 2014, Philipp John * @license http://opensource.org/licenses/MIT MIT see LICENSE.md */ $sessionLang = jpWotSession::get('active_language'); ?> <form method="post" id="changeLangForm"> <input id="currentLanguageValue" type="hidden" name="lang[current]" value="<?php echo $sessionLang; ?> " /> <input id="changeLanguageValue" type="hidden" name="lang[new]" value="<?php echo $sessionLang; ?> " /> <div id="langSwichter"> <a title="Françai" data-langkey="fr"> <i class="icon ico_fr <?php echo $sessionLang == 'fr' ? '' : 'inactive'; ?> "></i> <span class="sr-only">Françai</span> </a> <a title="English" data-langkey="en"> <i class="icon ico_en <?php echo $sessionLang == 'en' ? '' : 'inactive'; ?>