/** * This method initialize the current language and the current step * */ private function init() { //get the current post-request and check if the language was given by POST $s_post = \Globals::get('_POST'); if (!is_null($s_post['game_language'])) { \Session::get_session()->set_value('language', $s_post['game_language']); } //Initialize the I18N-Class for templates-usage \I18N::init(); //if we have no language-value in the session, set the default install-language to ENGLISH if (is_null(\Session::get_session()->get_value('language'))) { \I18N::set_language('en_EN'); } else { \I18N::set_language(\Session::get_session()->get_value('language')); } \Replacer::set_language(\I18N::get_language()); //set the current step by POST $this->i_step = $s_post['install_step']; }
require_once DIR_FS_APP . DS . 'config' . DS . 'databases.php'; foreach ($DATABASES as $key => $dbcfg) { $db =& Factory::db($dbcfg); Registry::set('pronto:db:' . $key, $db); } // we leave $db set for scripts that expect it unset($key, $dbcfg); } // TODO: this should be unset, left for back-compat for now... //unset($db); /************************************************************************ * INTERNATIONALIZATION ************************************************************************/ $i18n = new I18N(); $i18n->autoset_language('en'); define('LANG', $i18n->get_language()); Registry::set('pronto:i18n', $i18n); unset($i18n); /************************************************************************ * PRELOAD PLUGINS ************************************************************************/ foreach (explode(' ', PLUGINS) as $p) { if ($p) { Factory::plugin($p, 'page'); } } unset($p); // left in the symbol table for the cmdline script $plugins =& Registry::get('pronto:plugins'); /************************************************************************ * REMAINING UTILITY CLASSES
<?php defined('CORE_PATH') or die('No direct script access.'); /** * @file install.php * @author Daniel <*****@*****.**> * @date 04.08.2015 * @package game_core * @subpackage views * * @description * The view for the install-script of the game * * @var string $i_step the current step of installation */ $a_supported_languages = I18N::get_all_supported_languages(false); $s_html = '<form method="post" action="' . BASE_URL . '"> '; $s_html .= '<select name="game_language">'; foreach ($a_supported_languages as $s_language_code => $s_language_name) { $s_is_selected = null; if (I18N::get_language() === $s_language_code) { $s_is_selected = 'selected'; } $s_html .= '<option ' . $s_is_selected . ' value="' . $s_language_code . '">' . $s_language_name . '</option>'; } $s_html .= '</select> <input type="submit" value="' . __('form_choose_submit_form', 'form') . '"> </form>'; Replacer::output($s_html);