/** * method build_page * param * return main method, loads everything */ private function build_page() { $parse = $this->_lang; $parse['alert'] = ''; if (isset($_POST['opt_save']) && $_POST['opt_save'] == '1') { // CHECK BEFORE SAVE $this->run_validations(); Functions_Lib::update_config('game_name', $this->_game_config['game_name']); Functions_Lib::update_config('game_logo', $this->_game_config['game_logo']); Functions_Lib::update_config('lang', $this->_game_config['lang']); Functions_Lib::update_config('game_speed', $this->_game_config['game_speed']); Functions_Lib::update_config('fleet_speed', $this->_game_config['fleet_speed']); Functions_Lib::update_config('resource_multiplier', $this->_game_config['resource_multiplier']); Functions_Lib::update_config('admin_email', $this->_game_config['admin_email']); Functions_Lib::update_config('forum_url', $this->_game_config['forum_url']); Functions_Lib::update_config('reg_enable', $this->_game_config['reg_enable']); Functions_Lib::update_config('game_enable', $this->_game_config['game_enable']); Functions_Lib::update_config('close_reason', $this->_game_config['close_reason']); Functions_Lib::update_config('ssl_enabled', $this->_game_config['ssl_enabled']); Functions_Lib::update_config('date_time_zone', $this->_game_config['date_time_zone']); Functions_Lib::update_config('date_format', $this->_game_config['date_format']); Functions_Lib::update_config('date_format_extended', $this->_game_config['date_format_extended']); Functions_Lib::update_config('adm_attack', $this->_game_config['adm_attack']); Functions_Lib::update_config('debug', $this->_game_config['debug']); Functions_Lib::update_config('fleet_cdr', $this->_game_config['fleet_cdr']); Functions_Lib::update_config('defs_cdr', $this->_game_config['defs_cdr']); Functions_Lib::update_config('noobprotection', $this->_game_config['noobprotection']); Functions_Lib::update_config('noobprotectiontime', $this->_game_config['noobprotectiontime']); Functions_Lib::update_config('noobprotectionmulti', $this->_game_config['noobprotectionmulti']); $parse['alert'] = Administration_Lib::save_message('ok', $this->_lang['se_all_ok_message']); } $parse['game_name'] = $this->_game_config['game_name']; $parse['game_logo'] = $this->_game_config['game_logo']; $parse['language_settings'] = Functions_Lib::get_languages($this->_game_config['lang']); $parse['game_speed'] = $this->_game_config['game_speed'] / 2500; $parse['fleet_speed'] = $this->_game_config['fleet_speed'] / 2500; $parse['resource_multiplier'] = $this->_game_config['resource_multiplier']; $parse['admin_email'] = $this->_game_config['admin_email']; $parse['forum_url'] = $this->_game_config['forum_url']; $parse['closed'] = $this->_game_config['game_enable'] == 1 ? " checked = 'checked' " : ""; $parse['close_reason'] = stripslashes($this->_game_config['close_reason']); $parse['ssl_enabled'] = $this->_game_config['ssl_enabled'] == 1 ? " checked = 'checked' " : ""; $parse['date_time_zone'] = $this->time_zone_picker(); $parse['date_format'] = $this->_game_config['date_format']; $parse['date_format_extended'] = $this->_game_config['date_format_extended']; $parse['adm_attack'] = $this->_game_config['adm_attack'] == 1 ? " checked = 'checked' " : ""; $parse['debug'] = $this->_game_config['debug'] == 1 ? " checked = 'checked' " : ""; $parse['shiips'] = $this->_game_config['fleet_cdr']; $parse['defenses'] = $this->_game_config['defs_cdr']; $parse['noobprot'] = $this->_game_config['noobprotection'] == 1 ? " checked = 'checked' " : ""; $parse['noobprot2'] = $this->_game_config['noobprotectiontime']; $parse['noobprot3'] = $this->_game_config['noobprotectionmulti']; parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/server_view'), $parse)); }
/** * method install_navbar * param * return install navigation bar */ private function install_navbar() { // Update config language to the new setted value if (isset($_POST['language'])) { Functions_Lib::update_config('lang', $_POST['language']); Functions_Lib::redirect(XGP_ROOT . 'install/'); } $current_page = isset($_GET['page']) ? $_GET['page'] : NULL; $items = ''; $pages = array(0 => array('install', $this->_lang['ins_overview'], 'overview'), 1 => array('install', $this->_lang['ins_license'], 'license'), 2 => array('install', $this->_lang['ins_install'], 'step1'), 3 => array('update', $this->_lang['ins_update'], ''), 4 => array('migrate', $this->_lang['ins_migrate'], '')); // BUILD THE MENU foreach ($pages as $key => $data) { if ($data[2] != '') { // URL $items .= '<li' . ($current_page == $data[0] ? ' class="active"' : '') . '><a href="index.php?page=' . $data[0] . '&mode=' . $data[2] . '">' . $data[1] . '</a></li>'; } else { // URL $items .= '<li' . ($current_page == $data[0] ? ' class="active"' : '') . '><a href="index.php?page=' . $data[0] . '">' . $data[1] . '</a></li>'; } } // PARSE THE MENU AND OTHER DATA $parse = $this->_lang; $parse['menu_items'] = $items; $parse['language_select'] = Functions_Lib::get_languages(Functions_Lib::read_config('lang')); return $this->parse_template($this->get_template('install/topnav_view'), $parse); }