/** * @param array $params plugin parameters for the current action * @return null or jSelectorAct if action should change */ public function beforeAction($params) { $langDetected = false; $lang = ''; if ($this->config['enableUrlDetection']) { $l = jApp::coord()->request->getParam($this->config['urlParamNameLanguage']); if ($l !== null) { $lang = jLocale::getCorrespondingLocale($l); if ($lang != '') { $langDetected = true; } } } if (!$langDetected) { if (isset($_SESSION['JX_LANG'])) { $lang = $_SESSION['JX_LANG']; } else { if ($this->config['useDefaultLanguageBrowser']) { $lang = jLocale::getPreferedLocaleFromRequest(); } } } if ($lang != '') { $_SESSION['JX_LANG'] = $lang; jApp::config()->locale = $lang; } return null; }
protected function _prepareTpl() { $lang = jApp::config()->locale; if (!$this->getParam('no_lang_check')) { $locale = jLocale::getPreferedLocaleFromRequest(); if (!$locale) { $locale = 'en_US'; } jApp::config()->locale = $locale; } $reporter = new checkZoneInstallReporter(); $check = new jInstallCheck($reporter, $lang); $reporter->messageProvider = $check->messages; $check->run(); $this->_tpl->assign('wwwpath', jApp::wwwPath()); $this->_tpl->assign('configpath', jApp::configPath()); $this->_tpl->assign('check', $reporter->trace); }
protected function _prepareTpl() { $lang = jApp::config()->locale; if (!$this->param('no_lang_check')) { $locale = jLocale::getPreferedLocaleFromRequest(); if (!$locale) { $locale = 'en_US'; } jApp::config()->locale = $locale; } $messages = new \Jelix\Installer\Checker\Messages($lang); $reporter = new \Jelix\Installer\Reporter\HtmlBuffer($messages); $check = new \Jelix\Installer\Checker\Checker($reporter, $messages); $check->run(); $this->_tpl->assign('wwwpath', jApp::wwwPath()); $this->_tpl->assign('configpath', jApp::configPath()); $this->_tpl->assign('check', $reporter->trace); }