diff --git a/.gitignore b/.gitignore index 24b99ed..3ca62fc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,4 @@ config.php .buildpath .project .settings/ -.idea/ coverage/ -src/application/cache/* -src/application/configs/local.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..5eb217c --- /dev/null +++ b/.htaccess @@ -0,0 +1,2 @@ +SetEnv DEBUG On +SetEnv DEPRECATION Off \ No newline at end of file diff --git a/src/LICENCE b/LICENCE similarity index 100% rename from src/LICENCE rename to LICENCE diff --git a/add_declare.php b/add_declare.php new file mode 100644 index 0000000..29a0909 --- /dev/null +++ b/add_declare.php @@ -0,0 +1,68 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + + + includeLang('admin'); + + $mode = $_POST['mode']; + + $PageTpl = gettemplate("add_declare"); + $parse = $lang; + + if ($mode == 'addit') { + $declarator = $user['id']; + $declarator_name = addslashes(htmlspecialchars($user['username'])); + $decl1 = addslashes(htmlspecialchars($_POST['dec1'])); + $decl2 = addslashes(htmlspecialchars($_POST['dec2'])); + $decl3 = addslashes(htmlspecialchars($_POST['dec3'])); + $reason1 = addslashes(htmlspecialchars($_POST['reason'])); + + $QryDeclare = "INSERT INTO {{table}} SET "; + $QryDeclare .= "`declarator` = '". $declarator ."', "; + $QryDeclare .= "`declarator_name` = '". $declarator_name ."', "; $QryDeclare .= "`declared_1` = '". $decl1 ."', "; + $QryDeclare .= "`declared_2` = '". $decl2 ."', "; + $QryDeclare .= "`declared_3` = '". $decl3 ."', "; + $QryDeclare .= "`reason` = '". $reason1 ."' "; + + doquery( $QryDeclare, "declared"); + doquery("UPDATE {{table}} SET multi_validated ='1' WHERE username='{$user['username']}'","users"); + + AdminMessage ( "Merci, votre demande a ete prise en compte. Les autres joueurs que vous avez implique doivent egalement et imperativement suivre cette procedure aussi.", "Ajout" ); + } + $Page = parsetemplate($PageTpl, $parse); + + display ($Page, "Declaration d\'IP partagee", false, '', true); + + +?> \ No newline at end of file diff --git a/src/admin/ElementQueueFixer.php b/admin/ElementQueueFixer.php similarity index 96% rename from src/admin/ElementQueueFixer.php rename to admin/ElementQueueFixer.php index be19843..542b7f9 100644 --- a/src/admin/ElementQueueFixer.php +++ b/admin/ElementQueueFixer.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/QueryExecute.php b/admin/QueryExecute.php similarity index 93% rename from src/admin/QueryExecute.php rename to admin/QueryExecute.php index 9e75ebf..6ec9889 100644 --- a/src/admin/QueryExecute.php +++ b/admin/QueryExecute.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/autounban.php b/admin/ShowFlyingFleets.php similarity index 68% rename from src/admin/autounban.php rename to admin/ShowFlyingFleets.php index 5d9a6a9..89f1eb1 100644 --- a/src/admin/autounban.php +++ b/admin/ShowFlyingFleets.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -33,15 +33,18 @@ define('INSTALL' , false); define('IN_ADMIN', true); require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; -if (in_array($user['authlevel'], array(LEVEL_ADMIN))) { - doquery("UPDATE {{table}} SET `banaday` =` banaday` - '1' WHERE `banaday` != '0';",'users'); - doquery("UPDATE {{table}} SET `bana` = '0' WHERE `banaday` < '1';",'users'); + if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { + includeLang('admin/fleets'); + $PageTPL = gettemplate('admin/fleet_body'); - $response = Wootook::getResponse() - ->setRedirect(Wootook::getStaticUrl('admin/overview.php')) - ->sendHeaders(); - exit(0); -} else { - message ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); -} + $parse = $lang; + $parse['flt_table'] = BuildFlyingFleetTable (); + $page = parsetemplate( $PageTPL, $parse ); + display ( $page, $lang['flt_title'], false, '', true); + + } else { + AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + +?> \ No newline at end of file diff --git a/src/admin/XNovaResetUnivers.php b/admin/XNovaResetUnivers.php similarity index 98% rename from src/admin/XNovaResetUnivers.php rename to admin/XNovaResetUnivers.php index e789d4d..e8d1026 100644 --- a/src/admin/XNovaResetUnivers.php +++ b/admin/XNovaResetUnivers.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/admin/activeplanet.php b/admin/activeplanet.php new file mode 100644 index 0000000..e8bf1b5 --- /dev/null +++ b/admin/activeplanet.php @@ -0,0 +1,66 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { + includeLang('admin'); + + $parse = $lang; + $parse['dpath'] = $dpath; + $parse['mf'] = $mf; + + $PageTPL = gettemplate('admin/activeplanet_body'); + $AllActivPlanet = doquery("SELECT * FROM {{table}} WHERE `last_update` >= '". (time()-15 * 60) ."' ORDER BY `id` ASC", 'planets'); + $Count = 0; + + while ($ActivPlanet = $AllActivPlanet->fetch(PDO::FETCH_BOTH)) { + $parse['online_list'] .= ""; + $parse['online_list'] .= "
". $ActivPlanet['name'] ."
"; + $parse['online_list'] .= "
[". $ActivPlanet['galaxy'] .":". $ActivPlanet['system'] .":". $ActivPlanet['planet'] ."]
"; + $parse['online_list'] .= "
". pretty_number($ActivPlanet['points'] / 1000) ."
"; + $parse['online_list'] .= "
". pretty_time(time() - $ActivPlanet['last_update']) . "
"; + $parse['online_list'] .= ""; + $Count++; + } + $parse['online_list'] .= ""; + $parse['online_list'] .= "". $lang['adm_pl_they'] ." ". $Count ." ". $lang['adm_pl_apla'] .""; + $parse['online_list'] .= ""; + + $page = parsetemplate( $PageTPL , $parse ); + display( $page, $lang['adm_pl_title'], false, '', true ); + } else { + message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + +?> \ No newline at end of file diff --git a/admin/add_fleet.php b/admin/add_fleet.php new file mode 100644 index 0000000..96d8a21 --- /dev/null +++ b/admin/add_fleet.php @@ -0,0 +1,101 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + if ($user['authlevel'] >= 1) { + includeLang('admin/add_fleet'); + $mode = $_GET['mode']; + + if($mode != 'add') { + $parse['ID'] = $lang['Id']; + $parse['Cle'] = $lang['cle']; + $parse['Clourd'] = $lang['clourd']; + $parse['Pt'] = $lang['pt']; + $parse['Gt'] = $lang['gt']; + $parse['Cruise'] = $lang['cruise']; + $parse['Vb'] = $lang['vb']; + $parse['Colo'] = $lang['colo']; + $parse['Rc'] = $lang['rc']; + $parse['Spy'] = $lang['spy']; + $parse['Bomb'] = $lang['bomb']; + $parse['Solar'] = $lang['solar']; + $parse['Des'] = $lang['des']; + $parse['Rip'] = $lang['rip']; + $parse['Traq'] = $lang['traq']; + + } elseif($mode == 'add') { + $id = $_POST['id']; + $cle = $_POST['cle']; + $clourd = $_POST['clourd']; + $pt = $_POST['pt']; + $gt = $_POST['gt']; + $cruise = $_POST['cruise']; + $vb = $_POST['vb']; + $colo = $_POST['colo']; + $rc = $_POST['rc']; + $spy = $_POST['spy']; + $bomb = $_POST['bomb']; + $solar = $_POST['solar']; + $des = $_POST['des']; + $rip = $_POST['rip']; + $traq = $_POST['traq']; + + $SqlAdd = "UPDATE {{table}} SET"; + $SqlAdd .= "`light_hunter` = '".$cle."+light_hunter', "; + $SqlAdd .= "`heavy_hunter` = '".$clourd."+heavy_hunter', "; + $SqlAdd .= "`small_ship_cargo` = '".$pt."+small_ship_cargo', "; + $SqlAdd .= "`big_ship_cargo` = '".$gt."+big_ship_cargo', "; + $SqlAdd .= "`crusher` = '".$cruise."+crusher', "; + $SqlAdd .= "`battle_ship` = '".$vb."+battle_ship', "; + $SqlAdd .= "`colonizer` = '".$colo."+colonizer', "; + $SqlAdd .= "`recycler` = '".$rc."+recycler', "; + $SqlAdd .= "`spy_sonde`= '".$spy."+spy_sonde', "; + $SqlAdd .= "`bomber_ship` = '".$bomb."+bomber_ship', "; + $SqlAdd .= "`solar_satelit` = '".$solar."+solar_satelit', "; + $SqlAdd .= "`destructor` = '".$des."+destructor', "; + $SqlAdd .= "`dearth_star` = '".$rip."+dearth_star', "; + $SqlAdd .= "`battleship` = '".$traq."+battleship', "; + $SqlAdd .= " WHERE `id` = '".$id."' LIMIT 1"; + doquery($SqlAdd, "planets"); + message('Ajout OK'); + } + + $page = parsetemplate(gettemplate('admin/add_fleet'), $parse); + display( $page); + + } else { + message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + +?> \ No newline at end of file diff --git a/admin/add_money.php b/admin/add_money.php new file mode 100644 index 0000000..142acd7 --- /dev/null +++ b/admin/add_money.php @@ -0,0 +1,67 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { + includeLang('admin'); + + $mode = $_POST['mode']; + + $PageTpl = gettemplate("admin/add_money"); + $parse = $lang; + + if ($mode == 'addit') { + $id = $_POST['id']; + $metal = $_POST['metal']; + $cristal = $_POST['cristal']; + $deut = $_POST['deut']; + + $QryUpdatePlanet = "UPDATE {{table}} SET "; + $QryUpdatePlanet .= "`metal` = `metal` + '". $metal ."', "; + $QryUpdatePlanet .= "`crystal` = `crystal` + '". $cristal ."', "; + $QryUpdatePlanet .= "`deuterium` = `deuterium` + '". $deut ."' "; + $QryUpdatePlanet .= "WHERE "; + $QryUpdatePlanet .= "`id` = '". $id ."' "; + doquery( $QryUpdatePlanet, "planets"); + + AdminMessage ( $lang['adm_am_done'], $lang['adm_am_ttle'] ); + } + $Page = parsetemplate($PageTpl, $parse); + + display ($Page, $lang['adm_am_ttle'], false, '', true); + } else { + AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + +?> \ No newline at end of file diff --git a/src/admin/add_moon.php b/admin/add_moon.php similarity index 95% rename from src/admin/add_moon.php rename to admin/add_moon.php index 63c2851..6607d27 100644 --- a/src/admin/add_moon.php +++ b/admin/add_moon.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/ShowFlyingFleets.php b/admin/autounban.php similarity index 66% rename from src/admin/ShowFlyingFleets.php rename to admin/autounban.php index c41270d..c5afbe6 100644 --- a/src/admin/ShowFlyingFleets.php +++ b/admin/autounban.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -33,18 +33,16 @@ define('INSTALL' , false); define('IN_ADMIN', true); require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; -include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT); + if (in_array($user['authlevel'], array(LEVEL_ADMIN))) { + $lang['PHP_SELF'] = 'options.'.PHPEXT; + doquery("UPDATE {{table}} SET `banaday` =` banaday` - '1' WHERE `banaday` != '0';",'users'); + doquery("UPDATE {{table}} SET `bana` = '0' WHERE `banaday` < '1';",'users'); + $parse = $gameConfig; + $parse['dpath'] = $dpath; + $parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":''; + } else { + message ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } -if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - includeLang('admin/fleets'); - $PageTPL = gettemplate('admin/fleet_body'); +?> - $parse = $lang; - $parse['flt_table'] = BuildFlyingFleetTable (); - - $page = parsetemplate( $PageTPL, $parse ); - display ( $page, $lang['flt_title'], false, '', true); - -} else { - AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); -} diff --git a/src/admin/banned.php b/admin/banned.php similarity index 96% rename from src/admin/banned.php rename to admin/banned.php index 89b6f01..f053aa8 100644 --- a/src/admin/banned.php +++ b/admin/banned.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/changelog.php b/admin/changelog.php similarity index 93% rename from src/admin/changelog.php rename to admin/changelog.php index 6ef7ced..5b63eaa 100644 --- a/src/admin/changelog.php +++ b/admin/changelog.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/chat.php b/admin/chat.php similarity index 95% rename from src/admin/chat.php rename to admin/chat.php index b6ca379..3618898 100644 --- a/src/admin/chat.php +++ b/admin/chat.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/credit.php b/admin/credit.php similarity index 96% rename from src/admin/credit.php rename to admin/credit.php index 00c282d..bccba11 100644 --- a/src/admin/credit.php +++ b/admin/credit.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/declare_list.php b/admin/declare_list.php similarity index 90% rename from src/admin/declare_list.php rename to admin/declare_list.php index 6ecc761..961bf04 100644 --- a/src/admin/declare_list.php +++ b/admin/declare_list.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -36,11 +36,7 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { includeLang('admin'); if ($_GET['cmd'] == 'dele') { - $player = new Wootook_Player_Model_Entity(); - $player->load(intval($_GET['user'])); - if ($player->getId()) { - $player->delete(); - } + DeleteSelectedUser ( $_GET['user'] ); } if ($_GET['cmd'] == 'sort') { $TypeSort = $_GET['type']; diff --git a/src/admin/deletuser.php b/admin/deletuser.php similarity index 93% rename from src/admin/deletuser.php rename to admin/deletuser.php index 370ddcb..70b9966 100644 --- a/src/admin/deletuser.php +++ b/admin/deletuser.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/errors.php b/admin/errors.php similarity index 95% rename from src/admin/errors.php rename to admin/errors.php index 0ff6a7b..c57083c 100644 --- a/src/admin/errors.php +++ b/admin/errors.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/leftmenu.php b/admin/leftmenu.php similarity index 79% rename from src/admin/leftmenu.php rename to admin/leftmenu.php index cce8699..180034a 100644 --- a/src/admin/leftmenu.php +++ b/admin/leftmenu.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -36,13 +36,13 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; includeLang('leftmenu'); if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - $parse = $lang; - $parse['mf'] = "Hauptframe"; - $parse['dpath'] = $dpath; + $parse = $lang; + $parse['mf'] = "Hauptframe"; + $parse['dpath'] = $dpath; $parse['WootookRelease'] = VERSION; - $parse['servername'] = 'Wootook'; - $Page = parsetemplate(gettemplate('admin/left_menu'), $parse); - display($Page, "", false, '', true); + $parse['servername'] = Wootook; + $Page = parsetemplate(gettemplate('admin/left_menu'), $parse); + display( $Page, "", false, '', true); } else { message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); } diff --git a/admin/mass_message.php b/admin/mass_message.php new file mode 100644 index 0000000..43998cf --- /dev/null +++ b/admin/mass_message.php @@ -0,0 +1,66 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); + +function mass_message_run($parent){ + if($_POST["mode"] == "change"){ + if(isset($_POST["tresc"])&& $_POST["tresc"] != ''){ + $gameConfig['tresc'] = $parent->safe_get_post_var("tresc"); + } + if(isset($_POST["temat"])&& $_POST["temat"] != ''){ + $gameConfig['temat'] = $parent->safe_get_post_var("temat"); + } + $kolor = 'red'; + if($gameConfig['tresc'] !='' and $gameConfig['temat']){ + $sq = $parent->db->query("SELECT `id` FROM {{table}}","users"); + while($u = $parent->db->fetch_assoc($sq)){ + doquery("INSERT INTO {{table}} SET + `message_owner`='{$u['id']}', + `message_sender`='1' , + `message_time`='".time()."', + `message_type`='0', + `message_from`='Administracja', + `message_subject`='{$gameConfig['temat']}', + `message_text`='{$gameConfig['tresc']}' + ","messages"); + $parent->db->query("UPDATE {{table}} SET new_message=new_message+1 WHERE id='{$u['id']}'",'users'); + } + $parent->smarty->assign("message","Wys�a�e� wiadomo�� do wszystkich graczy"); + } + } + $parent->smarty->display("mass_message.tpl"); +} + +function mass_message_info(){ + return array("name" => "Send MassMessages","description"=>"Sends messagess to all players","default_weight"=>"0"); +} \ No newline at end of file diff --git a/src/admin/md5changepass.php b/admin/md5changepass.php similarity index 94% rename from src/admin/md5changepass.php rename to admin/md5changepass.php index 71bf636..46c43d5 100644 --- a/src/admin/md5changepass.php +++ b/admin/md5changepass.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/md5enc.php b/admin/md5enc.php similarity index 94% rename from src/admin/md5enc.php rename to admin/md5enc.php index ba3c4e5..b4a96b7 100644 --- a/src/admin/md5enc.php +++ b/admin/md5enc.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/messagelist.php b/admin/messagelist.php similarity index 98% rename from src/admin/messagelist.php rename to admin/messagelist.php index a4c75cf..49c207c 100644 --- a/src/admin/messagelist.php +++ b/admin/messagelist.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/admin/messall.php b/admin/messall.php new file mode 100644 index 0000000..fb7b834 --- /dev/null +++ b/admin/messall.php @@ -0,0 +1,75 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { + if ($_POST && $mode == "change") { + if (isset($_POST["tresc"]) && $_POST["tresc"] != '') { + $gameConfig['tresc'] = $_POST['tresc']; + } + if (isset($_POST["temat"]) && $_POST["temat"] != '') { + $gameConfig['temat'] = $_POST['temat']; + } + if ($user['authlevel'] == LEVEL_ADMIN) { + $kolor = 'red'; + $ranga = 'Administrator'; + } elseif ($user['authlevel'] == LEVEL_OPERATOR) { + $kolor = 'skyblue'; + $ranga = 'Operator'; + } elseif ($user['authlevel'] == LEVEL_MODERATOR) { + $kolor = 'yellow'; + $ranga = 'Moderator'; + } + if ($gameConfig['tresc'] != '' and $gameConfig['temat']) { + $sq = doquery("SELECT `id` FROM {{table}}", "users"); + $Time = time(); + $From = "". $ranga ." ".$user['username'].""; + $Subject = "". $gameConfig['temat'] .""; + $Message = "". $gameConfig['tresc'] .""; + while ($u = $sq->fetch(PDO::FETCH_BOTH)) { + SendSimpleMessage ( $u['id'], $user['id'], $Time, 97, $From, $Subject, $Message); + } + message("Wys�a�e� wiadomo�� do wszystkich graczy", "Complete", "../overview." . PHPEXT, 3); + } + } else { + $parse = $gameConfig; + $parse['dpath'] = $dpath; + $parse['debug'] = ($gameConfig['debug'] == 1) ? " checked='checked'/":''; + $page .= parsetemplate(gettemplate('admin/messall_body'), $parse); + display($page, '', false,'', true); + } + } else { + message($lang['sys_noalloaw'], $lang['sys_noaccess']); + } +?> \ No newline at end of file diff --git a/src/admin/moonlist.php b/admin/moonlist.php similarity index 95% rename from src/admin/moonlist.php rename to admin/moonlist.php index 932e607..645d086 100644 --- a/src/admin/moonlist.php +++ b/admin/moonlist.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/multi.php b/admin/multi.php similarity index 94% rename from src/admin/multi.php rename to admin/multi.php index 4b41308..e174971 100644 --- a/src/admin/multi.php +++ b/admin/multi.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/admin/overview.php b/admin/overview.php new file mode 100644 index 0000000..1a7c5d3 --- /dev/null +++ b/admin/overview.php @@ -0,0 +1,116 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { + includeLang('admin'); + + if ($_GET['cmd'] == 'sort') { + $TypeSort = $_GET['type']; + } else { + $TypeSort = "id"; + } + + $PageTPL = gettemplate('admin/overview_body'); + $RowsTPL = gettemplate('admin/overview_rows'); + + $parse = $lang; + $parse['dpath'] = $dpath; + $parse['mf'] = $mf; + $parse['adm_ov_data_yourv'] = colorRed(VERSION); + + $Last15Mins = doquery("SELECT * FROM {{table}} WHERE `onlinetime` >= '". (time() - 15 * 60) ."' ORDER BY `". $TypeSort ."` ASC;", 'users'); + $Count = 0; + $Color = "lime"; + while ($TheUser = $Last15Mins->fetch(PDO::FETCH_ASSOC) ) { + if ($PrevIP != "") { + if ($PrevIP == $TheUser['user_lastip']) { + $Color = "red"; + } else { + $Color = "lime"; + } + } + + $UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $TheUser['id'] . "';", 'statpoints', true); + $Bloc['dpath'] = $dpath; + $Bloc['adm_ov_altpm'] = $lang['adm_ov_altpm']; + $Bloc['adm_ov_wrtpm'] = $lang['adm_ov_wrtpm']; + $Bloc['adm_ov_data_id'] = $TheUser['id']; + $Bloc['adm_ov_data_name'] = $TheUser['username']; + $Bloc['adm_ov_data_agen'] = $TheUser['user_agent']; + $Bloc['current_page'] = $TheUser['current_page']; + $Bloc['usr_s_id'] = $TheUser['id']; + + $Bloc['adm_ov_data_clip'] = $Color; + $Bloc['adm_ov_data_adip'] = $TheUser['user_lastip']; + $Bloc['adm_ov_data_ally'] = $TheUser['ally_name']; + $Bloc['adm_ov_data_point'] = pretty_number ( $UserPoints['total_points'] ); + $Bloc['adm_ov_data_activ'] = pretty_time ( time() - $TheUser['onlinetime'] ); + $Bloc['adm_ov_data_pict'] = "m.gif"; + $PrevIP = $TheUser['user_lastip']; + + //Tweaks vue g�n�rale + $Bloc['usr_email'] = $TheUser['email']; + $Bloc['usr_xp_raid'] = $TheUser['xpraid']; + $Bloc['usr_xp_min'] = $TheUser['xpminier']; + + if ($TheUser['urlaubs_modus'] == 1) { + $Bloc['state_vacancy'] = ""; + } else { + $Bloc['state_vacancy'] = ""; + } + + if ($TheUser['bana'] == 1) { + $Bloc['is_banned'] = ""; + } else { + $Bloc['is_banned'] = $lang['is_banned_lang']; + } + $Bloc['usr_planet_gal'] = $TheUser['galaxy']; + $Bloc['usr_planet_sys'] = $TheUser['system']; + $Bloc['usr_planet_pos'] = $TheUser['planet']; + + + $parse['adm_ov_data_table'] .= parsetemplate( $RowsTPL, $Bloc ); + $Count++; + } + + $parse['adm_ov_data_count'] = $Count; + $Page = parsetemplate($PageTPL, $parse); + + display ( $Page, $lang['sys_overview'], false, '', true); + } else { + AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + +?> diff --git a/src/admin/paneladmina.php b/admin/paneladmina.php similarity index 98% rename from src/admin/paneladmina.php rename to admin/paneladmina.php index 1ea59d8..f4097b7 100644 --- a/src/admin/paneladmina.php +++ b/admin/paneladmina.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/planetlist.php b/admin/planetlist.php similarity index 95% rename from src/admin/planetlist.php rename to admin/planetlist.php index 4a154a5..0d3eacc 100644 --- a/src/admin/planetlist.php +++ b/admin/planetlist.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/admin/settings.php b/admin/settings.php new file mode 100644 index 0000000..bd98595 --- /dev/null +++ b/admin/settings.php @@ -0,0 +1,253 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +define('IN_ADMIN', true); +require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; + + +function DisplayGameSettingsPage ( $CurrentUser ) { + global $lang, $gameConfig; + + includeLang('admin/settings'); + + if (in_array((int) $CurrentUser['authlevel'], array(LEVEL_ADMIN))) { + if (isset($_POST['opt_save']) && $_POST['opt_save'] == "1") { + // Jeu Ouvert ou Ferm� ! + if (isset($_POST['closed']) && $_POST['closed'] == 'on') { + $gameConfig['game_disable'] = "1"; + $gameConfig['close_reason'] = addslashes( $_POST['close_reason'] ); + } else { + $gameConfig['game_disable'] = "0"; + $gameConfig['close_reason'] = ""; + } + + // Y a un News Frame ? ! + if (isset($_POST['newsframe']) && $_POST['newsframe'] == 'on') { + $gameConfig['OverviewNewsFrame'] = "1"; + $gameConfig['OverviewNewsText'] = addslashes( $_POST['NewsText'] ); + } else { + $gameConfig['OverviewNewsFrame'] = "0"; + $gameConfig['OverviewNewsText'] = ""; + } + + // Y a un TCHAT externe ?? + if (isset($_POST['chatframe']) && $_POST['chatframe'] == 'on') { + $gameConfig['OverviewExternChat'] = "1"; + $gameConfig['OverviewExternChatCmd'] = addslashes( $_POST['ExternChat'] ); + } else { + $gameConfig['OverviewExternChat'] = "0"; + $gameConfig['OverviewExternChatCmd'] = ""; + } + + if (isset($_POST['googlead']) && $_POST['googlead'] == 'on') { + $gameConfig['OverviewBanner'] = "1"; + $gameConfig['OverviewClickBanner'] = addslashes( $_POST['GoogleAds'] ); + } else { + $gameConfig['OverviewBanner'] = "0"; + $gameConfig['OverviewClickBanner'] = ""; + } + + // Y a un BANNER Frame ? + if (isset($_POST['bannerframe']) && $_POST['bannerframe'] == 'on') { + $gameConfig['ForumBannerFrame'] = "1"; + } else { + $gameConfig['ForumBannerFrame'] = "0"; + } + + // Mode Debug ou pas ! + if (isset($_POST['debug']) && $_POST['debug'] == 'on') { + $gameConfig['debug'] = "1"; + } else { + $gameConfig['debug'] = "0"; + } + + // Nom du Jeu + if (isset($_POST['game_name']) && $_POST['game_name'] != '') { + $gameConfig['game_name'] = $_POST['game_name']; + } + + // Adresse du Forum + if (isset($_POST['forum_url']) && $_POST['forum_url'] != '') { + $gameConfig['forum_url'] = $_POST['forum_url']; + } + + // Vitesse du Jeu + if (isset($_POST['game_speed']) && is_numeric($_POST['game_speed'])) { + $gameConfig['game_speed'] = $_POST['game_speed']; + } + + // Vitesse des Flottes + if (isset($_POST['fleet_speed']) && is_numeric($_POST['fleet_speed'])) { + $gameConfig['fleet_speed'] = $_POST['fleet_speed']; + } + + // Multiplicateur de Production + if (isset($_POST['resource_multiplier']) && is_numeric($_POST['resource_multiplier'])) { + $gameConfig['resource_multiplier'] = $_POST['resource_multiplier']; + } + + // Taille de la planete mère + if (isset($_POST['initial_fields']) && is_numeric($_POST['initial_fields'])) { + $gameConfig['initial_fields'] = $_POST['initial_fields']; + } + + // Revenu de base Metal + if (isset($_POST['metal_basic_income']) && is_numeric($_POST['metal_basic_income'])) { + $gameConfig['metal_basic_income'] = $_POST['metal_basic_income']; + } + + // Revenu de base Cristal + if (isset($_POST['crystal_basic_income']) && is_numeric($_POST['crystal_basic_income'])) { + $gameConfig['crystal_basic_income'] = $_POST['crystal_basic_income']; + } + + // Revenu de base Deuterium + if (isset($_POST['deuterium_basic_income']) && is_numeric($_POST['deuterium_basic_income'])) { + $gameConfig['deuterium_basic_income'] = $_POST['deuterium_basic_income']; + } + + // Revenu de base Energie + if (isset($_POST['energy_basic_income']) && is_numeric($_POST['energy_basic_income'])) { + $gameConfig['energy_basic_income'] = $_POST['energy_basic_income']; + } + + // Lien supplémentaire dans le menu + if (isset($_POST['enable_link_']) && is_numeric($_POST['enable_link_'])) { + $gameConfig['link_enable'] = $_POST['enable_link_']; + } + // Texte de ce lien... +$gameConfig['link_name'] = addslashes( $_POST['name_link_']); + + // URL de ce lien... +$gameConfig['link_url'] = $_POST['url_link_']; + // Image de la bannière +$gameConfig['banner_source_post'] = $_POST['banner_source_post']; + // 1 point = ??? Ressources ? + if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings'])) { + $gameConfig['stat_settings'] = $_POST['stat_settings']; + } + // Activation -ou non- des annonces + if (isset($_POST['enable_announces_']) && is_numeric($_POST['enable_announces_'])) { + $gameConfig['enable_announces'] = $_POST['enable_announces_']; + } + // Activation -ou non- du marchand + if (isset($_POST['enable_marchand_']) && is_numeric($_POST['enable_marchand_'])) { + $gameConfig['enable_marchand'] = $_POST['enable_marchand_']; + } + // Activation -ou non- des notes + if (isset($_POST['enable_notes_']) && is_numeric($_POST['enable_notes_'])) { + $gameConfig['enable_notes'] = $_POST['enable_notes_']; + } + // Nom du bot antimulti + $gameConfig['bot_name'] = addslashes( $_POST['name_bot']); + + // email du bot antimulti + $gameConfig['bot_adress'] = addslashes( $_POST['adress_bot']); + + // Activation -ou non- des notes + if (isset($_POST['duration_ban']) && is_numeric($_POST['duration_ban'])) { + $gameConfig['ban_duration'] = $_POST['duration_ban']; + } + + // Activation -ou non- du bot + if (isset($_POST['bot_enable']) && is_numeric($_POST['bot_enable'])) { + $gameConfig['enable_bot'] = $_POST['bot_enable']; + } + + // BBCode ou pas ? + + if (isset($_POST['bbcode_field']) && is_numeric($_POST['bbcode_field'])) { + $gameConfig['enable_bbcode'] = $_POST['bbcode_field']; + } + + $gameConfig->save(); + + AdminMessage ('Options changees avec succes !', 'Succes', '?'); + } else { + + $parse = $lang; + $parse['game_name'] = $gameConfig['game_name']; + $parse['game_speed'] = $gameConfig['game_speed']; + $parse['fleet_speed'] = $gameConfig['fleet_speed']; + $parse['resource_multiplier'] = $gameConfig['resource_multiplier']; + $parse['forum_url'] = $gameConfig['forum_url']; + $parse['initial_fields'] = $gameConfig['initial_fields']; + $parse['metal_basic_income'] = $gameConfig['metal_basic_income']; + $parse['crystal_basic_income'] = $gameConfig['crystal_basic_income']; + $parse['deuterium_basic_income'] = $gameConfig['deuterium_basic_income']; + $parse['energy_basic_income'] = $gameConfig['energy_basic_income']; + $parse['enable_link'] = $gameConfig['link_enable']; + $parse['name_link'] = $gameConfig['link_name']; + $parse['url_link'] = $gameConfig['link_url']; + $parse['enable_announces'] = $gameConfig['enable_announces']; + $parse['enable_marchand'] = $gameConfig['enable_marchand']; + $parse['enable_notes'] = $gameConfig['enable_notes']; + $parse['bot_name'] = stripslashes($gameConfig['bot_name']); + $parse['bot_adress'] = stripslashes($gameConfig['bot_adress']); + $parse['ban_duration'] = stripslashes($gameConfig['ban_duration']); + $parse['enable_bot'] = stripslashes($gameConfig['enable_bot']); + $parse['enable_bbcode'] = stripslashes($gameConfig['enable_bbcode']); + + $parse['banner_source_post'] = $gameConfig['banner_source_post']; + $parse['stat_settings'] = stripslashes($gameConfig['stat_settings']); + + + + $parse['closed'] = ($gameConfig['game_disable'] == 1) ? " checked = 'checked' ":""; + $parse['close_reason'] = stripslashes( $gameConfig['close_reason'] ); + + $parse['newsframe'] = ($gameConfig['OverviewNewsFrame'] == 1) ? " checked = 'checked' ":""; + $parse['NewsTextVal'] = stripslashes( $gameConfig['OverviewNewsText'] ); + + $parse['chatframe'] = ($gameConfig['OverviewExternChat'] == 1) ? " checked = 'checked' ":""; + $parse['ExtTchatVal'] = stripslashes( $gameConfig['OverviewExternChatCmd'] ); + + $parse['googlead'] = ($gameConfig['OverviewBanner'] == 1) ? " checked = 'checked' ":""; + $parse['GoogleAdVal'] = stripslashes( $gameConfig['OverviewClickBanner'] ); + + $parse['debug'] = ($gameConfig['debug'] == 1) ? " checked = 'checked' ":""; + + $parse['bannerframe'] = ($gameConfig['ForumBannerFrame'] == 1) ? " checked = 'checked' ":""; + + $PageTPL = gettemplate('admin/options_body'); + $Page = parsetemplate( $PageTPL, $parse ); + + display ( $Page, $lang['adm_opt_title'], false, '', true ); + } + } else { + AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); + } + return $Page; +} + +$Page = DisplayGameSettingsPage($user); + diff --git a/src/admin/statbuilder.php b/admin/statbuilder.php similarity index 94% rename from src/admin/statbuilder.php rename to admin/statbuilder.php index 97caec7..28d13c4 100644 --- a/src/admin/statbuilder.php +++ b/admin/statbuilder.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -47,8 +47,6 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], $GameUsers = doquery("SELECT * FROM {{table}} WHERE authlevel<3", 'users'); - $resourceMultiplier = Wootook::getGameConfig('game/resource/multiplier'); - while ($CurUser = $GameUsers->fetch(PDO::FETCH_ASSOC)) { // Recuperation des anciennes statistiques $OldStatRecord = doquery ("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `id_owner` = '".$CurUser['id']."';", 'statpoints', true); @@ -71,7 +69,7 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], // Total des unitées consommée pour la recherche $Points = GetTechnoPoints ( $CurUser ); $TTechCount = $Points['TechCount']; - $TTechPoints = ($Points['TechPoint'] / $resourceMultiplier); + $TTechPoints = ($Points['TechPoint'] / $gameConfig['stat_settings']); // Totalisation des points accumulés par planete $TBuildCount = 0; @@ -87,20 +85,20 @@ if (strtolower(substr(PHP_SAPI, 0, 3)) == 'cli' || in_array($user['authlevel'], $Points = GetBuildPoints ( $CurPlanet ); $TBuildCount += $Points['BuildCount']; $GCount += $Points['BuildCount']; - $PlanetPoints = ($Points['BuildPoint'] / $resourceMultiplier); - $TBuildPoints += ($Points['BuildPoint'] / $resourceMultiplier); + $PlanetPoints = ($Points['BuildPoint'] / $gameConfig['stat_settings']); + $TBuildPoints += ($Points['BuildPoint'] / $gameConfig['stat_settings']); $Points = GetDefensePoints ( $CurPlanet ); $TDefsCount += $Points['DefenseCount'];; $GCount += $Points['DefenseCount']; - $PlanetPoints += ($Points['DefensePoint'] / $resourceMultiplier); - $TDefsPoints += ($Points['DefensePoint'] / $resourceMultiplier); + $PlanetPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']); + $TDefsPoints += ($Points['DefensePoint'] / $gameConfig['stat_settings']); $Points = GetFleetPoints ( $CurPlanet ); $TFleetCount += $Points['FleetCount']; $GCount += $Points['FleetCount']; - $PlanetPoints += ($Points['FleetPoint'] / $resourceMultiplier); - $TFleetPoints += ($Points['FleetPoint'] / $resourceMultiplier); + $PlanetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']); + $TFleetPoints += ($Points['FleetPoint'] / $gameConfig['stat_settings']); $GPoints += $PlanetPoints; $QryUpdatePlanet = "UPDATE {{table}} SET "; diff --git a/src/admin/statfunctions.php b/admin/statfunctions.php similarity index 97% rename from src/admin/statfunctions.php rename to admin/statfunctions.php index db1a760..de527b9 100644 --- a/src/admin/statfunctions.php +++ b/admin/statfunctions.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/unbanned.php b/admin/unbanned.php similarity index 94% rename from src/admin/unbanned.php rename to admin/unbanned.php index 8b0967d..cfc9027 100644 --- a/src/admin/unbanned.php +++ b/admin/unbanned.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/admin/userlist.php b/admin/userlist.php similarity index 91% rename from src/admin/userlist.php rename to admin/userlist.php index 84fb74f..ecb19df 100644 --- a/src/admin/userlist.php +++ b/admin/userlist.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -36,11 +36,7 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) { includeLang('admin'); if ($_GET['cmd'] == 'dele') { - $player = new Wootook_Player_Model_Entity(); - $player->load(intval($_GET['user'])); - if ($player->getId()) { - $player->delete(); - } + DeleteSelectedUser ( $_GET['user'] ); } if ($_GET['cmd'] == 'sort') { $TypeSort = $_GET['type']; diff --git a/src/admin/variables.php b/admin/variables.php similarity index 93% rename from src/admin/variables.php rename to admin/variables.php index bcc6642..527af4c 100644 --- a/src/admin/variables.php +++ b/admin/variables.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/ainfo.php b/ainfo.php new file mode 100644 index 0000000..4f12f4f --- /dev/null +++ b/ainfo.php @@ -0,0 +1,70 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + +$dpath = (!$userrow["dpath"]) ? DEFAULT_SKINPATH : $userrow["dpath"]; + + +if(!is_numeric($_GET["a"]) || !$_GET["a"] ){ message("Ungültige Allianz-ID","Fehler");} + +$allyrow = doquery("SELECT ally_name,ally_tag,ally_description,ally_web,ally_image FROM {{table}} WHERE id=".$_GET["a"],"alliance",true); + +if(!$allyrow){ message("Alliance non trouvée","Erreur");} + +$count = doquery("SELECT COUNT(DISTINCT(id)) FROM {{table}} WHERE ally_id=".$_GET["a"].";","users",true); +$ally_member_scount = $count[0]; + +$page .=""; + + if($allyrow["ally_image"] != ""){ + $page .= ""; + } + + $page .= ""; + + if($allyrow["ally_description"] != ""){ + $page .= ""; + } + + + if($allyrow["ally_web"] != ""){ + $page .=" + + + "; + } + $page .= "
Informations sur l'alliance
Tag".$allyrow["ally_tag"]."
Nom".$allyrow["ally_name"]."
Membres$ally_member_scount
".$allyrow["ally_description"]."
Site internet".$allyrow["ally_web"]."
"; + + display($page,"Information sur l'alliance [".$allyrow["ally_name"]."]",false); + +?> \ No newline at end of file diff --git a/src/alliance.php b/alliance.php similarity index 89% rename from src/alliance.php rename to alliance.php index 6b815fd..3c90d3c 100644 --- a/src/alliance.php +++ b/alliance.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -32,8 +32,8 @@ define('INSTALL' , false); define('INSIDE' , true); require_once dirname(__FILE__) .'/application/bootstrap.php'; -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); -$db = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection(Wootook_Core_Database_ConnectionManager::DEFAULT_CONNECTION_NAME); +$user = Wootook_Empire_Model_User::getSingleton(); +$db = Wootook_Database::getSingleton(); if(!$user->getId()){ echo ''; } -$request = Wootook::getRequest(); +$mode = isset($_GET['mode']) ? $_GET['mode'] : null; +$yes = isset($_GET['yes']) ? $_GET['yes'] : null; +$edit = isset($_GET['edit']) ? $_GET['edit'] : null; +$allyid = isset($_GET['allyid']) ? intval($_GET['allyid']) : null; +$kick = isset($_GET['kick']) ? $_GET['kick'] : null; +$show = isset($_GET['show']) ? intval($_GET['show']) : null; +$sort = isset($_GET['sort']) ? intval($_GET['sort']) : null; +$sendmail = isset($_GET['sendmail']) ? intval($_GET['sendmail']) : null; +$rank = isset($_GET['rank']) ? intval($_GET['rank']) : null; +$t = isset($_GET['t']) ? $_GET['t'] : null; +$a = isset($_GET['a']) ? intval($_GET['a']) : null; +$tag = isset($_GET['tag']) ? $db->quote($_GET['tag']) : null; +$page = isset($page) ? $page : null; +$d = isset($_GET['d']) ? $_GET['d'] : null; +$id = isset($_GET['id']) ? $_GET['id'] : null; -$mode = $request->getQuery('mode'); -$yes = $request->getQuery('yes'); -$edit = $request->getQuery('edit'); -$allyid = intval($request->getQuery('allyid')); -$kick = $request->getQuery('kick'); -$show = intval($request->getQuery('show')); -$sort = intval($request->getQuery('sort')); -$sendmail = intval($request->getQuery('sendmail')); -$rank = intval($request->getQuery('rank')); -$t = $request->getQuery('t'); -$allianceId = intval($request->getQuery('a')); -$tag = $request->getQuery('tag'); -$page = $request->getQuery('page'); -$d = $request->getQuery('d'); -$id = $request->getQuery('id'); - -$allianceIds = $request->getPost('id'); -$actionType = $request->getPost('t'); -$options = $request->getPost('options'); -$action = $request->getPost('action'); +$_POST['id'] = isset($_POST['id']) ? $_POST['id'] : null; +$_POST['t'] = isset($_POST['t']) ? $_POST['t'] : null; +$_POST['options'] = isset($_POST['options']) ? $_POST['options'] : null; +$_POST['action'] = isset($_POST['action']) ? $_POST['action'] : null; includeLang('alliance'); + /** *Alliance information display. */ @@ -74,9 +73,9 @@ if ($mode == 'ainfo') { $lang['Alliance_information'] = "Information Alliance"; if ($tag) { - $allyrow = doquery("SELECT * FROM {{table}} WHERE ally_tag={$db->quote($tag)}", "alliance", true); - } elseif (is_numeric($allianceId) && $allianceId != 0) { - $allyrow = doquery("SELECT * FROM {{table}} WHERE id='{$allianceId}'", "alliance", true); + $allyrow = doquery("SELECT * FROM {{table}} WHERE ally_tag={$tag}", "alliance", true); + } elseif (is_numeric($a) && $a != 0) { + $allyrow = doquery("SELECT * FROM {{table}} WHERE id='{$a}'", "alliance", true); } else { message("Cette alliance n'existe pas !", "Information Alliance (1)"); } @@ -139,17 +138,17 @@ if ($user->getData('ally_id') == 0) { /* * Creation of the alliance */ - if ($yes == 1 && $request->isPost()) { + if ($yes == 1 && isset($_POST)) { - if ($request->getPost('atag') !== null) { + if (empty($_POST['atag'])) { message($lang['have_not_tag'], $lang['make_alliance']); } - if ($request->getPost('aname') !== null) { + if (empty($_POST['aname'])) { message($lang['have_not_name'], $lang['make_alliance']); } - $alliance_name = $db->quote($request->getPost('aname')); - $alliance_tag = $db->quote($request->getPost('atag')); + $alliance_name = $db->quote($_POST['aname']); + $alliance_tag = $db->quote($_POST['atag']); $tagquery = doquery("SELECT * FROM {{table}} WHERE ally_tag=" .$alliance_tag. ";", 'alliance', true); @@ -157,7 +156,7 @@ if ($user->getData('ally_id') == 0) { message(str_replace('%s', $alliance_tag, $lang['always_exist']), $lang['make_alliance']); } $ranks = ''; - $allianz_raenge[] = array('name' => 'Novice', + $allianz_raenge[] = array('name' => 'Novice', 'mails' => 0, 'delete' => 0, 'kick' => 0, @@ -176,7 +175,7 @@ if ($user->getData('ally_id') == 0) { `ally_tag`=" . $alliance_tag . " , `ally_owner`='" .$user->getId(). "', `ally_owner_range`='Leader', - `ally_ranks`='" . $ranks . "', + `ally_ranks`='" . $ranks . "', `ally_members`='1', `ally_register_time`=" . time() , "alliance"); @@ -201,11 +200,11 @@ if ($user->getData('ally_id') == 0) { if ($mode == 'search' && $user->getData('ally_request') == 0) { $parse = $lang; - $search_text = $request->getPost('searchtext'); + $search_text = isset($_POST['searchtext']) ? $_POST['searchtext'] : null; $lang['searchtext'] = $search_text; $page = parsetemplate(gettemplate('alliance_searchform'), $lang); - if ($request->getPost('searchtext') !== null) { + if (isset($_POST['searchtext'])) { $stmt = $db->prepare("SELECT * FROM {$db->getTable('alliance')} WHERE ally_name LIKE :search_field OR ally_tag LIKE :search_field LIMIT 30"); $stmt->execute(array(':search_field' => '%' .$search_text. '%')); if ($stmt->rowCount() != 0) { @@ -245,8 +244,8 @@ if ($user->getData('ally_id') == 0) { extract($allyrow); - if ($request->getPost('further') !== null && $request->getPost('further') == $lang['Send']) { - doquery("UPDATE {{table}} SET `ally_request`='" . $allyid . "', ally_request_text=" . $db->quote($request->getPost('text')) . ", ally_register_time='" . time() . "' WHERE `id`='" . $user->getId(). "'", "users"); + if (isset($_POST['further']) && $_POST['further'] == $lang['Send']) { + doquery("UPDATE {{table}} SET `ally_request`='" . $allyid . "', ally_request_text=" . $db->quote($_POST['text']) . ", ally_register_time='" . time() . "' WHERE `id`='" . $user->getId(). "'", "users"); message($lang['apply_registered'], $lang['your_apply']); } else { $text_apply = ($ally_request) ? $ally_request : $lang['There_is_no_a_text_apply']; @@ -270,7 +269,7 @@ if ($user->getData('ally_id') == 0) { $allyquery = doquery("SELECT ally_tag FROM {{table}} WHERE id='" . $user->getData('ally_request') . "' ORDER BY `id`", "alliance", true); extract($allyquery); - if ($request->getPost('bcancel') !== null) { + if (isset($_POST['bcancel'])) { doquery("UPDATE {{table}} SET `ally_request`=0 WHERE `id`=" . $user->getId('id'), "users"); $lang['request_text'] = str_replace('%s', $ally_tag, $lang['Canceled_a_request_text']); @@ -395,9 +394,9 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { message($lang['Denied_access'], $lang['Members_list']); } // Order of displaying the different users - $sort2 = intval($request->getQuery('sort2')); + $sort2 = isset($_GET['sort2']) ? intval($_GET['sort2']) : null; if ($sort2) { - $sort1 = intval($request->getQuery('sort1')); + $sort1 = isset($_GET['sort1']) ? intval($_GET['sort1']) : null; switch($sort1){ case 1: $sort = " ORDER BY `username`"; @@ -507,9 +506,9 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { } if ($sendmail == 1) { - if ($request->getPost('r') !== null && is_numeric($request->getPost('r'))){ - $group_rank = intval($request->getPost('r')); - $message_text = $db->quote($request->getPost('text')); + if (isset($_POST['r']) && is_numeric($_POST['r'])){ + $group_rank = intval($_POST['r']); + $message_text = $db->quote($_POST['text']); if ($group_rang == 0) { $sq = doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user['ally_id']}'", "users"); } else { @@ -559,8 +558,8 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { if ($ally['ally_owner'] != $user->getId() && !$user_can_edit_rights) { message($lang['Denied_access'], $lang['Members_list']); - } else if ($request->getPost('newrangname') != '') { - $name = strip_tags($request->getPost('newrangname')); + } elseif (!empty($_POST['newrangname'])) { + $name = strip_tags($_POST['newrangname']); $allianz_raenge[] = array('name' => $name, 'mails' => 0, @@ -582,63 +581,63 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { header("Location: " . $goto); exit(); - } elseif (is_array($allianceIds) && !empty($allianceIds)) { + } elseif ($_POST['id'] != '' && is_array($_POST['id'])) { $ally_ranks_new = array(); - foreach ($allianceIds as $id) { + foreach ($_POST['id'] as $id) { $name = $allianz_raenge[$id]['name']; $ally_ranks_new[$id]['name'] = $name; - if ($request->getPost('u' . $id . 'r0') !== null) { + if (isset($_POST['u' . $id . 'r0'])) { $ally_ranks_new[$id]['delete'] = 1; } else { $ally_ranks_new[$id]['delete'] = 0; } - if ($request->getPost('u' . $id . 'r1') !== null && $ally['ally_owner'] == $user->getId()) { + if (isset($_POST['u' . $id . 'r1']) && $ally['ally_owner'] == $user->getId()) { $ally_ranks_new[$id]['kick'] = 1; } else { $ally_ranks_new[$id]['kick'] = 0; } - if ($request->getPost('u' . $id . 'r2') !== null) { + if (isset($_POST['u' . $id . 'r2'])) { $ally_ranks_new[$id]['bewerbungen'] = 1; } else { $ally_ranks_new[$id]['bewerbungen'] = 0; } - if ($request->getPost('u' . $id . 'r3') !== null) { + if (isset($_POST['u' . $id . 'r3'])) { $ally_ranks_new[$id]['memberlist'] = 1; } else { $ally_ranks_new[$id]['memberlist'] = 0; } - if ($request->getPost('u' . $id . 'r4') !== null) { + if (isset($_POST['u' . $id . 'r4'])) { $ally_ranks_new[$id]['bewerbungenbearbeiten'] = 1; } else { $ally_ranks_new[$id]['bewerbungenbearbeiten'] = 0; } - if ($request->getPost('u' . $id . 'r5') !== null) { + if (isset($_POST['u' . $id . 'r5'])) { $ally_ranks_new[$id]['administrieren'] = 1; } else { $ally_ranks_new[$id]['administrieren'] = 0; } - if ($request->getPost('u' . $id . 'r6') !== null) { + if (isset($_POST['u' . $id . 'r6'])) { $ally_ranks_new[$id]['onlinestatus'] = 1; } else { $ally_ranks_new[$id]['onlinestatus'] = 0; } - if ($request->getPost('u' . $id . 'r7') !== null) { + if (isset($_POST['u' . $id . 'r7'])) { $ally_ranks_new[$id]['mails'] = 1; } else { $ally_ranks_new[$id]['mails'] = 0; } - if ($request->getPost('u' . $id . 'r8') !== null) { + if (isset($_POST['u' . $id . 'r8'])) { $ally_ranks_new[$id]['rechtehand'] = 1; } else { $ally_ranks_new[$id]['rechtehand'] = 0; @@ -672,6 +671,7 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { foreach($ally_ranks as $a => $b) { if ($ally['ally_owner'] == $user->getId()) { $lang['id'] = $a; + $lang['delete'] = "\"{$lang['Delete_range']}\""; $lang['r0'] = $b['name']; $lang['a'] = $a; $lang['r1'] = ""; //{$b[1]} @@ -688,6 +688,7 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { } else { $lang['id'] = $a; $lang['r0'] = $b['name']; + $lang['delete'] = "\"{$lang['Delete_range']}\""; $lang['a'] = $a; $lang['r1'] = "-"; $lang['r2'] = ""; @@ -720,18 +721,24 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { if ($t != 1 && $t != 2 && $t != 3) { $t = 1; } + if (!get_magic_quotes_gpc()) { + $_POST['owner_range'] = isset($_POST['owner_range']) ? stripslashes($_POST['owner_range']) : null; + $_POST['web'] = isset($_POST['web']) ? stripslashes($_POST['web']) : null; + $_POST['image'] = isset($_POST['image']) ? stripslashes($_POST['image']) : null; + $_POST['text'] = isset($_POST['text']) ? stripslashes($_POST['text']) : null; + } - if ($options) { - $ally['ally_owner_range'] = htmlspecialchars(strip_tags($request->getPost('owner_range'))); + if ($_POST['options']) { + $ally['ally_owner_range'] = htmlspecialchars(strip_tags($_POST['owner_range'])); - $ally['ally_web'] = htmlspecialchars(strip_tags($request->getPost('web'))); + $ally['ally_web'] = htmlspecialchars(strip_tags($_POST['web'])); - $ally['ally_image'] = htmlspecialchars(strip_tags($request->getPost('image'))); + $ally['ally_image'] = htmlspecialchars(strip_tags($_POST['image'])); - $ally['ally_request_notallow'] = intval($request->getPost('request_notallow')); + $ally['ally_request_notallow'] = intval($_POST['request_notallow']); if ($ally['ally_request_notallow'] != 0 && $ally['ally_request_notallow'] != 1) { - message("Aller � \"Candidature\" et sur une option dans le formulaire!", "Erreur"); + message("Aller � \"Candidature\" et sur une option dans le formulaire!", "Erreur"); exit; } @@ -741,20 +748,20 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { `ally_web`={$db->quote($ally['ally_web'])}, `ally_request_notallow`='{$ally['ally_request_notallow']}' WHERE `id`='{$ally['id']}'", "alliance"); - } elseif ($actionType) { + } elseif ($_POST['t']) { if ($t == 3) { - $ally['ally_request'] = strip_tags($request->getPost('text')); + $ally['ally_request'] = strip_tags($_POST['text']); doquery("UPDATE {{table}} SET `ally_request`={$db->quote($ally['ally_request'])} WHERE `id`='{$ally['id']}'", "alliance"); } elseif ($t == 2) { - $ally['ally_text'] = strip_tags($request->getPost('text')); + $ally['ally_text'] = strip_tags($_POST['text']); doquery("UPDATE {{table}} SET `ally_text`={$db->quote($ally['ally_text'])} WHERE `id`='{$ally['id']}'", "alliance"); } else { - $ally['ally_description'] = strip_tags($request->getPost('text')); + $ally['ally_description'] = strip_tags($_POST['text']); doquery("UPDATE {{table}} SET `ally_description`=" . $db->quote($ally['ally_description']) . " @@ -801,8 +808,8 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { } if ($mode == 'admin' && $edit == 'give') { - if ($request->getPost('id')) { - doquery("update {{table}} set `ally_owner`=".$db->quote($request->getPost('id'))." where `id`='".$user['ally_id']."'",'alliance'); + if ($_POST["id"]) { + doquery("update {{table}} set `ally_owner`=".$db->quote($_POST["id"])." where `id`='".$user['ally_id']."'",'alliance'); } else { $selection=doquery("SELECT * FROM {{table}} where ally_id='".$user['ally_id']."'",'users'); $select=''; @@ -841,12 +848,12 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { if ($u['ally_id'] == $ally['id'] && $u['id'] != $ally['ally_owner']) { doquery("UPDATE {{table}} SET `ally_id`='0', `ally_name`='', `ally_rank_id` = '0' WHERE `id`='{$u['id']}'", 'users'); } - } else if ($request->getPost('newrang') !== null) { - $newrank = $request->getPost('newrang'); - $selectedUser = Wootook_Player_Model_Entity::factory($id); + } elseif (isset($_POST['newrang'])) { + $newrank = isset($_POST['newrang']) ? intval($_POST['newrang']) : null; + $q = doquery("SELECT * FROM {{table}} WHERE id='{intval($id}' LIMIT 1", 'users', true); - if ($newrank !== null && isset($ally_ranks[$newrank]) && $selectedUser->getId() != $ally['ally_owner']) { - $selectedUser->setData('ally_rank_id', $newrank)->save(); + if (isset($ally_ranks[$newrank]) && $q['id'] != $ally['ally_owner']) { + doquery("UPDATE {{table}} SET `ally_rank_id`=" . $newrank . " WHERE `id`='" . intval($id) . "'", 'users'); } } @@ -854,9 +861,9 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { $f_template = gettemplate('alliance_admin_members_function'); // Order of displaying the different users - $sort2 = intval($request->getQuery('sort2')); + $sort2 = isset($_GET['sort2']) ? intval($_GET['sort2']) : null; if ($sort2) { - $sort1 = intval($request->getQuery('sort1')); + $sort1 = isset($_GET['sort1']) ? intval($_GET['sort1']) : null; switch($sort1){ case 1: $sort = " ORDER BY `username`"; @@ -992,7 +999,9 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { message($lang['Denied_access'], $lang['Check_the_requests']); } - if ($action == "Accepter") { + if ($_POST['action'] == "Accepter") { + $_POST['text'] = strip_tags($_POST['text']); + $u = doquery("SELECT * FROM {{table}} WHERE id=$show", 'users', true); // add points from the user who join the alliance doquery("UPDATE {{table}} SET @@ -1008,7 +1017,7 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { mnl_alliance=mnl_alliance+1 WHERE id='{$show}'", 'users'); - $message = "Bonjour,
L'Alliance {$ally['ally_name']} a accepté votre candidature.
Charte:
{$request->getPost('text')}"; + $message = "Bonjour,
L'Alliance {$ally['ally_name']} a accepté votre candidature.
Charte:
{$_POST['text']}"; // Send a message to the new member of the alliance doquery("INSERT INTO {{table}} SET `message_owner`=" .$db->quote($show).", @@ -1022,10 +1031,12 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { header('Location: alliance.php?mode=admin&edit=requests'); die(); - } elseif ($action == "Refuser" && $action != '') { + } elseif ($_POST['action'] == "Refuser" && $_POST['action'] != '') { + $_POST['text'] = strip_tags($_POST['text']); + doquery("UPDATE {{table}} SET ally_request_text='',ally_request='0',ally_id='0',new_message=new_message+1, mnl_alliance=mnl_alliance+1 WHERE id={$db->quote($show)}", 'users'); - $message = "Bonjour,
L'Alliance {$ally['ally_name']} a refusé votre candidature.
Raison:
{$request->getPost('text')}"; + $message = "Bonjour,
L'Alliance {$ally['ally_name']} a refusé votre candidature.
Raison:
{$_POST['text']}"; // Send a polite message to the player that he is too noobish for that alliance. doquery("INSERT INTO {{table}} SET `message_owner`=" .$db->quote($show).", @@ -1093,10 +1104,10 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { message($lang['Denied_access'], $lang['Members_list']); } - if ($request->getPost('newname') !== null) { + if (isset($_POST['newname'])) { // Y a le nouveau Nom // New name so lets update all - $ally['ally_name'] = strip_tags($request->getPost('newname')); + $ally['ally_name'] = strip_tags($_POST['newname']); doquery("UPDATE {{table}} SET `ally_name` = ". $db->quote($ally['ally_name']) ." WHERE `id` = '". $user->getData('ally_id') ."';", 'alliance'); doquery("UPDATE {{table}} SET `ally_name` = ". $db->quote($ally['ally_name']) ." WHERE `ally_id` = '". $ally['id'] ."';", 'users'); } @@ -1121,10 +1132,10 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) { message($lang['Denied_access'], $lang['Members_list']); } - if ($request->getPost('newtag') !== null) { + if (isset($_POST['newtag'])) { // Y a le nouveau TAG // new TAG, lets update the table - $ally['ally_tag'] = strip_tags($request->getPost('newtag')); + $ally['ally_tag'] = strip_tags($_POST['newtag']); doquery("UPDATE {{table}} SET `ally_tag` = ". $db->quote($ally['ally_tag']) ." WHERE `id` = '". $user->getData('ally_id') ."';", 'alliance'); } diff --git a/src/annonce.php b/annonce.php similarity index 68% rename from src/annonce.php rename to annonce.php index 9c0b506..169ca4d 100644 --- a/src/annonce.php +++ b/annonce.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -31,26 +31,35 @@ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/application/bootstrap.php'; - -$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); -$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write'); - -$action = isset($_GET['action']) ? $_GET['action'] : null; +$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users'); +$annonce = doquery("SELECT * FROM {{table}} ", 'annonce'); +$action = $_GET['action']; if ($action == 5) { - $writeAdapter->insert() - ->into($writeAdapter->getTable('annonce')) - ->set('user', $user->getUsername()) - ->set('galaxie', $planet->getGalaxy()) - ->set('systeme', $planet->getSystem()) - ->set('metala', Wootook::getRequest()->getParam('metalvendre')) - ->set('cristala', Wootook::getRequest()->getParam('cristalvendre')) - ->set('deuta', Wootook::getRequest()->getParam('deutvendre')) - ->set('metals', Wootook::getRequest()->getParam('metalsouhait')) - ->set('cristals', Wootook::getRequest()->getParam('cristalsouhait')) - ->set('deuts', Wootook::getRequest()->getParam('deutsouhait')) - ->execute() - ; + $metalvendre = $_POST['metalvendre']; + $cristalvendre = $_POST['cristalvendre']; + $deutvendre = $_POST['deutvendre']; + + $metalsouhait = $_POST['metalsouhait']; + $cristalsouhait = $_POST['cristalsouhait']; + $deutsouhait = $_POST['deutsouhait']; + + while ($v_annonce = $users->fetch(PDO::FETCH_BOTH)) { + $user = $v_annonce['username']; + $galaxie = $v_annonce['galaxy']; + $systeme = $v_annonce['system']; + } + + doquery("INSERT INTO {{table}} SET +user='{$user}', +galaxie='{$galaxie}', +systeme='{$systeme}', +metala='{$metalvendre}', +cristala='{$cristalvendre}', +deuta='{$deutvendre}', +metals='{$metalsouhait}', +cristals='{$cristalsouhait}', +deuts='{$deutsouhait}'" , "annonce"); $page2 .= << @@ -64,7 +73,7 @@ HTML; } if ($action != 5) { - $statement = $readAdapter->select()->from(array('annonce' => $readAdapter->getTable('annonce')))->order('id', 'DESC')->prepare(); + $annonce = doquery("SELECT * FROM {{table}} ORDER BY `id` DESC ", "annonce"); $page2 = "
@@ -73,9 +82,12 @@ if ($action != 5) { Petites Annonces Infos de livraisonRessources à vendreRessources souhaitéesAction VendeurGalaxieSystèmeMétalCristalDeuteriumMétalCristalDeuteriumDelet -"; - foreach ($statement as $b) { + + + +"; + while ($b = $annonce->fetch(PDO::FETCH_BOTH)) { $page2 .= ' '; $page2 .= $b["user"] ; $page2 .= ''; @@ -107,3 +119,4 @@ if ($action != 5) { display($page2); } +?> \ No newline at end of file diff --git a/src/annonce2.php b/annonce2.php similarity index 95% rename from src/annonce2.php rename to annonce2.php index 29baec1..7f90582 100644 --- a/src/annonce2.php +++ b/annonce2.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/application/bootstrap.php b/application/bootstrap.php similarity index 67% rename from src/application/bootstrap.php rename to application/bootstrap.php index b0b3c9c..fd5a0f1 100644 --- a/src/application/bootstrap.php +++ b/application/bootstrap.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -28,11 +28,9 @@ * */ -if (!defined('PHP_VERSION_ID')) { - $version = explode('.',PHP_VERSION); - define('PHP_VERSION_ID', (((int)$version[0]) * 10000 + ((int)$version[1]) * 100 + ((int)$version[2]))); - unset($version); -} +defined('BCNUMBERS') || define('BCNUMBERS', true); +defined('DEPRECATION') || define('DEPRECATION', true); +defined('DEBUG') || define('DEBUG', true); if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { define('DEBUG', true); @@ -64,7 +62,7 @@ defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DI defined('PHPEXT') || define('PHPEXT', 'php'); -defined('VERSION') || define('VERSION', '1.5.0-beta2'); +defined('VERSION') || define('VERSION', '2011.1'); set_include_path(implode(PATH_SEPARATOR, array( APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries', @@ -78,36 +76,23 @@ function __autoload($class) { include_once str_replace('_', '/', $class) . '.php'; } -if (defined('IN_ADMIN')) { - $website = new Wootook_Core_Model_Website(); - $website->setId(0)->setData('code', 'admin'); - Wootook::addWebsite($website); - Wootook::setDefaultWebsite($website); +Wootook_Core_Time::init(); +Wootook_Core_ErrorProfiler::register(); +Wootook_Core_Model_Config_Events::registerEvents(); - $game = new Wootook_Core_Model_Game(); - $game->setId(0)->setData('code', 'admin')->setData('website_id', $website->getId()); - Wootook::addGame($game); - Wootook::setDefaultGame($game); -} - -include ROOT_PATH . 'includes/constants.php'; - -if (defined('DEBUG')) { - Wootook_Core_ErrorProfiler::register(); -} -Wootook_Core_Helper_Config_Events::registerEvents(); - -if (!Wootook::$isInstalled) { - Wootook::getResponse() - ->setRedirect(Wootook::getStaticUrl('install/'), Wootook_Core_Mvc_Controller_Response_Http::REDIRECT_TEMPORARY) - ->sendHeaders(); - exit(0); +if (0 === filesize(ROOT_PATH . 'config.php')) { + header('Location: install/'); + die(); } $lang = array(); define('DEFAULT_LANG', 'fr'); +include(ROOT_PATH . 'includes/debug.class.'.PHPEXT); +$debug = new Debug(); + +include(ROOT_PATH . 'includes/constants.' . PHPEXT); include(ROOT_PATH . 'includes/functions.' . PHPEXT); include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT); include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT); @@ -115,26 +100,20 @@ include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg'); include(ROOT_PATH . 'includes/vars.' . PHPEXT); include(ROOT_PATH . 'includes/strings.' . PHPEXT); -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); +$gameConfig = Wootook_Core_Model_Config::getSingleton(); +if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) { + Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']); +} +$user = Wootook_Empire_Model_User::getSingleton(); if (!defined('DISABLE_IDENTITY_CHECK')) { - if ($user === null || !$user->getId()) { - Wootook::getResponse() - ->setRedirect(Wootook::getUrl('player/account/login')) - ->sendHeaders(); + if (($user === null || !$user->getId())) { + header('Location: login.php'); exit(0); } - //var_dump(Wootook::getGameConfig('game/general/active')); - if (!Wootook::getGameConfig('game/general/active')/* && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))*/) { - $layout = new Wootook_Core_Model_Layout(Wootook_Core_Model_Layout::DOMAIN_FRONTEND); - $layout->load('message'); - - $block = $layout->getBlock('message'); - $block['title'] = Wootook::__('Game is disabled.'); - $block['message'] = Wootook::getGameConfig('game/general/closing-message'); - - echo $layout->render(); + if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) { + message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name')); exit(0); } } @@ -160,4 +139,4 @@ if (($user !== null && $user->getId())) { 'planet' => $planet )); $planet->save(); -} +} \ No newline at end of file diff --git a/src/application/cache/.placeholder b/application/code/community/.placeholder similarity index 100% rename from src/application/cache/.placeholder rename to application/code/community/.placeholder diff --git a/src/application/code/core/Legacies/Empire.php b/application/code/core/Legacies/Empire.php similarity index 95% rename from src/application/code/core/Legacies/Empire.php rename to application/code/core/Legacies/Empire.php index eb5b24b..f0c44b0 100644 --- a/src/application/code/core/Legacies/Empire.php +++ b/application/code/core/Legacies/Empire.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -99,7 +99,6 @@ class Legacies_Empire const ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK = 123; const ID_RESEARCH_EXPEDITION_TECHNOLOGY = 124; const ID_RESEARCH_ASTROPHYSICS = 124; - const ID_RESEARCH_ORE_MINING = 125; const ID_RESEARCH_GRAVITON_TECHNOLOGY = 199; const ID_SHIP_LIGHT_TRANSPORT = 202; @@ -117,7 +116,6 @@ class Legacies_Empire const ID_SHIP_DEATH_STAR = 214; const ID_SHIP_BATTLECRUISER = 215; const ID_SHIP_SUPERNOVA = 216; - const ID_SHIP_ORE_MININER = 217; const ID_DEFENSE_ROCKET_LAUNCHER = 401; const ID_DEFENSE_LIGHT_LASER = 402; @@ -146,11 +144,10 @@ class Legacies_Empire const ID_MISSION_DESTROY = 9; const ID_MISSION_MISSILES = 10; const ID_MISSION_EXPEDITION = 15; - const ID_MISSION_ORE_MINING = 16; public static function getFieldName($id) { - $fieldsAlias = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fieldsAlias = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); if (!isset($fieldsAlias[$id])) { return null; @@ -158,4 +155,4 @@ class Legacies_Empire return $fieldsAlias[$id]; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php similarity index 92% rename from src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php rename to application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php index 1c995b4..841f1a1 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php +++ b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -49,7 +49,7 @@ class Legacies_Empire_Block_Planet_ResearchLab public function getPlanet() { if ($this->_planet === null) { - $this->_planet = Wootook_Player_Model_Session::getSingleton()->getPlayer() + $this->_planet = Wootook_Empire_Model_User::getSingleton() ->getCurrentPlanet() ; } @@ -58,7 +58,7 @@ class Legacies_Empire_Block_Planet_ResearchLab public function _initChildBlocks() { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); /** @var Wootook_Core_Block_Concat $parentBlock */ $parentBlock = $this->getLayout()->getBlock('item-list.items'); diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php similarity index 96% rename from src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php rename to application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php index 8d5e448..4068617 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php +++ b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -27,7 +27,6 @@ * documentation for further information about customizing Wootook. * */ - /** * * Enter description here ... @@ -39,7 +38,7 @@ class Legacies_Empire_Block_Planet_ResearchLab_Item { public function getLevel() { - return $this->getPlayer()->getElement($this->getItemId()); + return $this->getUser()->getElement($this->getItemId()); } public function getResourcesNeeded($level) diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php rename to application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php index a880688..f69418e 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php +++ b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php similarity index 86% rename from src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php rename to application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php index a825cfa..a95ee9a 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php +++ b/application/code/core/Legacies/Empire/Block/Planet/ResearchLab/Queue/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -37,11 +37,11 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract { - protected $_itemIdField = 'technology_id'; + protected $_itemIdField = 'research_id'; public function getLevel() { - return $this->getPlayer()->getElement($this->getItemId()); + return $this->getUser()->getElement($this->getItemId()); } public function getResourcesNeeded($level) @@ -49,6 +49,11 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item return $this->getPlanet()->getResearchLab()->getResourcesNeeded($this->getItemId(), $this->getQueuedLevel() + 1); } + public function getItemQueuedLevel() + { + return $this->getItem()->getData('level'); + } + public function getQueuedLevel() { return $this->getPlanet()->getResearchLab()->getResearchLevelQueued($this->getItemId()); @@ -59,15 +64,6 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item return $this->getPlanet()->getResearchLab()->getBuildingTime($this->getItemId(), $level); } - public function getBuildingRemainingTime() - { - $totalTime = $this->getPlanet()->getResearchLab() - ->getResearchTime($this->getItemId(), $this->getItemQueuedLevel()); - $item = $this->getItem(); - - return $totalTime - ($item->getData('created_at') - $item->getData('updated_at')); - } - public function getResourcesConfigForLevel($level) { $resources = $this->getResourcesNeeded($level); @@ -98,4 +94,4 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item { return $this->getBuildingTime($this->getNextLevel()); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php b/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php similarity index 91% rename from src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php rename to application/code/core/Legacies/Empire/Block/Planet/Shipyard.php index c33a6e4..f84b8d1 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php +++ b/application/code/core/Legacies/Empire/Block/Planet/Shipyard.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -54,7 +54,7 @@ class Legacies_Empire_Block_Planet_Shipyard public function getPlanet() { if ($this->_planet === null) { - $this->_planet = Wootook_Player_Model_Session::getSingleton()->getPlayer() + $this->_planet = Wootook_Empire_Model_User::getSingleton() ->getCurrentPlanet() ; } @@ -97,11 +97,7 @@ class Legacies_Empire_Block_Planet_Shipyard public function _initChildBlocks() { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); - - if (!$this->getPlanet() || !$this->getPlanet()->getShipyard()) { - return $this; - } + $types = Wootook_Empire_Model_Game_Types::getSingleton(); /** @var Wootook_Core_Block_Concat $parentBlock */ $parentBlock = $this->getLayout()->getBlock('item-list.items'); @@ -116,4 +112,4 @@ class Legacies_Empire_Block_Planet_Shipyard return $this; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php similarity index 95% rename from src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php rename to application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php index 0b42ac2..e5d9768 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php +++ b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -42,11 +42,6 @@ class Legacies_Empire_Block_Planet_Shipyard_Item return $this->getPlanet()->getElement($this->getItemId()); } - public function getClass() - { - return $this->getLabel('class'); - } - public function getResourcesNeeded($qty) { return $this->getPlanet()->getShipyard()->getResourcesNeeded($this->getItemId(), $qty); @@ -82,4 +77,4 @@ class Legacies_Empire_Block_Planet_Shipyard_Item } return $resourceConfig; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php rename to application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php index ea621fa..1bcd0c0 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php +++ b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php similarity index 82% rename from src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php rename to application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php index 64eec1d..54c9938 100644 --- a/src/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php +++ b/application/code/core/Legacies/Empire/Block/Planet/Shipyard/Queue/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -37,9 +37,9 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract { - protected $_itemIdField = 'ship_id'; + protected $_itemIdField = 'research_id'; - public function getQty() + public function getLevel() { return $this->getPlanet()->getElement($this->getItemId()); } @@ -49,26 +49,12 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item return $this->getPlanet()->getShipyard()->getResourcesNeeded($this->getItemId(), 1); } - public function getItemQueuedQty() - { - return $this->getItem()->getData('qty'); - } - public function getBuildingTime($qty) { return $this->getPlanet()->getShipyard()->getBuildingTime($this->getItemId(), $qty); } - public function getBuildingRemainingTime() - { - $totalTime = $this->getPlanet()->getShipyard() - ->getBuildingTime($this->getItemId(), $this->getItemQueuedQty()); - $item = $this->getItem(); - - return $totalTime - ($item->getData('created_at') - $item->getData('updated_at')); - } - - public function getResourcesConfigForQty($qty) + public function getResourcesConfigForLevel($qty) { $resources = $this->getResourcesNeeded($qty); @@ -98,4 +84,4 @@ class Legacies_Empire_Block_Planet_Shipyard_Queue_Item { return $this->getBuildingTime($this->getNextLevel()); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Exception.php b/application/code/core/Legacies/Empire/Exception.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Exception.php rename to application/code/core/Legacies/Empire/Exception.php index 6527b43..70fcf02 100644 --- a/src/application/code/core/Legacies/Empire/Exception.php +++ b/application/code/core/Legacies/Empire/Exception.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php b/application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php index ef720df..2cd8971 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/CristalMine.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -36,7 +36,7 @@ class Legacies_Empire_Model_Planet_Building_CristalMine implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player) + public function getProductionRatios($level, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_CRISTAL => 10 + 20 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio), diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php b/application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php index 5556a4c..69447dc 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/DeuteriumSynthetiser.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -36,7 +36,7 @@ class Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player) + public function getProductionRatios($level, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_DEUTERIUM => 10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio), diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php b/application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php index e3d32aa..923a6eb 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/FusionReactor.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -36,7 +36,7 @@ class Legacies_Empire_Model_Planet_Building_FusionReactor implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player) + public function getProductionRatios($level, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_DEUTERIUM => -10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio), diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php b/application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php index e67f459..884a964 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/MetalMine.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -37,7 +37,7 @@ class Legacies_Empire_Model_Planet_Building_MetalMine implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player) + public function getProductionRatios($level, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_METAL => 20 + 30 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio), diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php b/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php similarity index 76% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php index 05f1163..08554ec 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/NaniteFactory.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -36,16 +36,17 @@ class Legacies_Empire_Model_Planet_Building_NaniteFactory implements Wootook_Empire_Model_Planet_BuildingInterface { - public static function buildingEnhancementListener(Wootook_Core_Event $event) + public static function buildingTimeListener($event) { - /** @var float $enhancement */ - $enhancement = $event->getData('enhancement'); - - /** @var Wootook_Empire_Model_Planet $planet */ $planet = $event->getData('planet'); - $level = $planet->getElement(Legacies_Empire::ID_BUILDING_NANITE_FACTORY); + if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_NANITE_FACTORY)) <= 0) { + return; + } - $event->setData('enhancement', $enhancement * pow(.5, $level)); + $time = $event->getData('time'); + + $speedFactor = pow(2, $level); + $event->setData('time', $time / $speedFactor); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php similarity index 78% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php index 6c5ff41..31789d2 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -38,8 +38,7 @@ * @subpackage Legacies_Empire */ class Legacies_Empire_Model_Planet_Building_ResearchLab - implements Wootook_Empire_Model_Planet_BuildingInterface, - Wootook_Empire_Model_Planet_QueueInterface + implements Wootook_Empire_Model_Planet_BuildingInterface { private $_eventPrefix = 'planet.laboratory.'; @@ -50,14 +49,14 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab protected $_currentPlanet = null; /** - * Player instance - * @var Woootook_Player_Model_Entity + * User instance + * @var Legacies_Empire_Model_User */ - protected $_currentPlayer = null; + protected $_currentUser = null; /** * construction queue - * @var Legacies_Empire_Model_Planet_Building_ResearchLab_Builder + * @var array */ protected $_builder = null; @@ -72,17 +71,17 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab * it doesn't yet exist. * * @param Legacies_Empire_Model_Planet $currentPlanet - * @param Woootook_Player_Model_Entity $currentPlayer + * @param Legacies_Empire_Model_User $currentUser * @return Legacies_Empire_Model_Planet_Building_ResearchLab */ - public static function factory($currentPlanet, $currentPlayer) + public static function factory($currentPlanet, $currentUser) { if ($currentPlanet->getId()) { return null; } if (!isset(self::$_instances[$currentPlanet->getId()])) { - self::$_instances[$currentPlanet->getId()] = new self($currentPlanet, $currentPlayer); + self::$_instances[$currentPlanet->getId()] = new self($currentPlanet, $currentUser); } return self::$_instances[$currentPlanet->getId()]; } @@ -93,14 +92,14 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab * @see Legacies_Empire_Model_Planet_Building_ResearchLab::factory() * * @param Legacies_Empire_Model_Planet $currentPlanet - * @param Woootook_Player_Model_Entity $currentPlayer + * @param Legacies_Empire_Model_User $currentUser */ - public function __construct($currentPlanet, $currentPlayer) + public function __construct($currentPlanet, $currentUser) { $this->_currentPlanet = $currentPlanet; - $this->_currentPlayer = $currentPlayer; + $this->_currentUser = $currentUser; - $this->_builder = new Legacies_Empire_Model_Planet_Building_ResearchLab_Builder($currentPlanet, $currentPlayer); + $this->_builder = new Legacies_Empire_Model_Planet_Building_ResearchLab_Builder($currentPlanet, $currentUser); } /** @@ -120,14 +119,16 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab * @param int|string $level * @return Legacies_Empire_Model_Planet_Building_ResearchLab */ - public function appendQueue($researchId, $level = null, Wootook_Core_DateTime $time = null) + public function appendQueue($researchId, $destroy = false, $time = null) { if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } - if ($level === null) { - $level = $this->_currentPlayer->getElement($researchId) + 1; + if ($destroy === false) { + $level = $this->_currentUser->getElement($researchId) + 1; + } else { + $level = max($this->_currentUser->getElement($researchId) - 1, 0); } // Dispatch event @@ -137,7 +138,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab 'time' => &$time, 'laboratory' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); $this->_builder->appendQueue($researchId, $level, $time); @@ -149,7 +150,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab 'time' => $time, 'laboratory' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); return $this; @@ -160,10 +161,10 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab * * @return Legacies_Empire_Model_Planet_Building_ResearchLab */ - public function updateQueue(Wootook_Core_DateTime $time = null) + public function updateQueue($time = null) { if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } // Dispatch event @@ -171,7 +172,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab 'time' => &$time, 'laboratory' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); $this->_builder->updateQueue($time); @@ -181,7 +182,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab 'time' => $time, 'laboratory' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); return $this; @@ -208,22 +209,18 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab public function checkAvailability($researchId) { try { - if (!$this->_builder->checkAvailability($researchId)) { - return false; - } - // Dispatch event Wootook::dispatchEvent($this->_eventPrefix . 'check-availability', array( 'research_id' => $researchId, 'laboratory' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); } catch (Legacies_Core_Event_Break $e) { return false; } - return true; + return $this->_builder->checkAvailability($researchId); } public function getResourcesNeeded($researchId, $level) @@ -233,12 +230,12 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab public function getResearchTime($researchId, $level) { - return $this->_builder->getBuildingTime($researchId, $level); + $this->_builder->getBuildingTime($researchId, $level); } public function getResearchLevelQueued($researchId) { - $level = $this->_currentPlayer->getElement($researchId); + $level = $this->_currentUser->getElement($researchId); foreach ($this->_builder as $item) { if ($item->getData('research_id') != $researchId) { continue; @@ -263,9 +260,9 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab $time = $eventData['time']; } - $researchLab = $planet->getResearchLab(); - if ($researchLab !== null) { - $researchLab->updateQueue(); + $shipyard = $planet->getResearchLab(); + if ($shipyard !== null) { + $shipyard->updateQueue(); } } } diff --git a/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php new file mode 100644 index 0000000..82777f1 --- /dev/null +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Builder.php @@ -0,0 +1,252 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ +/** + * + * Enter description here ... + * @author Greg + * + */ +class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder + extends Wootook_Empire_Model_BuilderAbstract +{ + /** + * @var int + */ + protected $_maxLength = 0; + + public function init() + { + $this->_unserializeQueue($this->_currentUser->getData('b_laboratory_id')); + } + + /** + * @param int $buildingId + * @param int $level + * @param int $time + */ + protected function _initItem(Array $params) + { + if (!isset($params['technology_id']) || !isset($params['level'])) { + return null; + } + + $technologyId = $params['technology_id']; + $level = $params['level']; + if (!isset($params['created_at'])) { + $createdAt = time(); + } else { + $createdAt = $params['created_at']; + } + if (!isset($params['updated_at'])) { + $updatedAt = $createdAt; + } else { + $updatedAt = $params['updated_at']; + } + + return new Legacies_Empire_Model_Planet_Building_ResearchLab_Item(array( + 'technology_id' => $technologyId, + 'level' => $level, + 'created_at' => $createdAt, + 'updated_at' => $updatedAt + )); + } + + /** + * Check if a technology type is actually buildable on the current + * planet, depending on the technology and buildings requirements. + * + * @param int $technologyId + * @return bool + */ + public function checkAvailability($technologyId) + { + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + + if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) { + return false; + } + + parent::checkAvailability($technologyId); + + return true; + } + + /** + * Returns the time needed to build $level of $technologyId + * + * @param int $technologyId + * @param int $level + */ + public function getBuildingTime($technologyId, $level) + { + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + $gameConfig = Wootook_Core_Model_Config::getSingleton(); + + Math::setPrecision(50); + + // FIXME: Resource dependency + $totalCost = Math::mul(Math::add($prices[$technologyId][Legacies_Empire::RESOURCE_METAL], $prices[$technologyId][Legacies_Empire::RESOURCE_CRISTAL]), $level); + $speedFactor = $gameConfig->getData('game_speed'); + + // FIXME: Building & Technology dependency + $extraLaboratoriesLevels = 0; + $researchNetworkLevel = $this->_currentUser->getElement(Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK); + if ($researchNetworkLevel > 0) { + $laboratoriesLevels = array(); + foreach ($this->_currentUser->getPlanetCollection() as $planet) { + if ($this->_currentPlanet->getId() == $planet->getId()) { + continue; + } + $level = $planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB); + if ($level > 0) { + $laboratoriesLevels[] = (int) $level; + } + } + sort($laboratoriesLevels, SORT_NUMERIC); + $extraLaboratoriesLevels = array_sum(array_slice(array_reverse($laboratoriesLevels), 0, $researchNetworkLevel)); + } + + $laboratorySpeedup = Math::div($totalCost, ($this->_currentPlanet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB) + 1 + $extraLaboratoriesLevels)); + + Math::setPrecision(); + + $baseTime = ($totalCost / $speedFactor) * $laboratorySpeedup; + + return (int) Math::floor($baseTime * 3600); + } + + /** + * (non-PHPdoc) + * @see Legacies_Empire_Model_BuilderAbstract::getResourcesNeeded() + */ + public function getResourcesNeeded($technologyId, $level) + { + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); + + if (!isset($prices[$technologyId])) { + return array(); + } + $resourcesNeeded = array(); + foreach ($resources as $resourceId => $resourceConfig) { + if (!isset($prices[$technologyId][$resourceId])) { + continue; + } + if (Math::isPositive($prices[$technologyId][$resourceId])) { + $firstLevelCost = $prices[$technologyId][$resourceId]; + $partialLevelCost = Math::mul($firstLevelCost, Math::pow($prices[$technologyId][Legacies_Empire::RESOURCE_MULTIPLIER], $level)); + $resourcesNeeded[$resourceId] = Math::sub($partialLevelCost, $firstLevelCost); + } + } + + return $resourcesNeeded; + } + + /** + * Update the contruction queue. + * + * @return Legacies_Empire_Model_Planet_Building_ResearchLab + */ + public function updateQueue($time) + { + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); + + $elapsedTime = $time - $this->_currentUser->getData('b_laboratory'); + + foreach ($this->getQueue() as $element) { + $technologyId = $element->getData('research_id'); + $level = $element->getData('level'); + $buildTime = $this->getBuildingTime($technologyId, $level); + + if ($elapsedTime >= $buildTime) { + $this->_currentUser[$fields[$technologyId]] = Math::add($this->_currentUser[$fields[$technologyId]], $level); + $elapsedTime -= $buildTime; + $this->dequeue($element); + continue; + } + + $timeRatio = $elapsedTime / $buildTime; + $itemsBuilt = Math::mul($timeRatio, $level); + + $element->setData('updated_at', $time); + $element->setData('level', Math::sub($level, $itemsBuilt)); + $this->_currentUser->setData($fields[$technologyId], Math::add($this->_currentUser->getData($fields[$technologyId]), $itemsBuilt)); + break; + } + + $this->_currentUser->setData('b_laboratory_id', $this->serialize()); + $this->_currentUser->setData('b_laboratory', $time); + + return $this; + } + + /** + * Append items to build to the construction list + * + * @param int $technologyId + * @param int|string $level + * @return Legacies_Empire_Model_Planet_Building_ResearchLab + */ + public function appendQueue($technologyId, $level, $time) + { + if ($this->_maxLength > 0 && $this->count() >= $this->_maxLength) { + return $this; + } + + if (!Math::isPositive($level)) { + return $this; + } + + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) { + return $this; + } + + if (!$this->checkAvailability($technologyId)) { + return $this; + } + + $resourcesNeeded = $this->getResourcesNeeded($technologyId, $level); + $remainingAmounts = $this->_calculateResourceRemainingAmounts($resourcesNeeded); + if ($remainingAmounts === false) { + return $this; + } + + $this->enqueue($technologyId, $level, $time); + $this->_currentUser->setData('b_laboratory_id', $this->serialize()); + + foreach ($remainingAmounts as $resourceId => $resourceAmount) { + $this->_currentPlanet[$resourceId] = $resourceAmount; + } + + return $this; + } +}; \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php index c70a8fa..557c257 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/ResearchLab/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php b/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php similarity index 76% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php index 5e6b3c8..574156b 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/RoboticFactory.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -36,16 +36,17 @@ class Legacies_Empire_Model_Planet_Building_RoboticFactory implements Wootook_Empire_Model_Planet_BuildingInterface { - public static function buildingEnhancementListener(Wootook_Core_Event $event) + public static function buildingTimeListener($event) { - /** @var float $enhancement */ - $enhancement = $event->getData('enhancement'); - - /** @var Wootook_Empire_Model_Planet $planet */ $planet = $event->getData('planet'); - $level = $planet->getElement(Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY); + if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY)) <= 0) { + return; + } - $event->setData('enhancement', $enhancement * (2 / (1 + $level))); + $time = $event->getData('time'); + + $speedFactor = 1 + $level; + $event->setData('time', $time / $speedFactor); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php similarity index 84% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php index b8c93b9..c41bcca 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -38,8 +38,7 @@ * @subpackage Legacies_Empire */ class Legacies_Empire_Model_Planet_Building_Shipyard - implements Wootook_Empire_Model_Planet_BuildingInterface, - Wootook_Empire_Model_Planet_QueueInterface + implements Wootook_Empire_Model_Planet_BuildingInterface { private $_eventPrefix = 'planet.shipyard.'; @@ -50,10 +49,10 @@ class Legacies_Empire_Model_Planet_Building_Shipyard protected $_currentPlanet = null; /** - * Player instance - * @var Woootook_Player_Model_Entity + * User instance + * @var Legacies_Empire_Model_User */ - protected $_currentPlayer = null; + protected $_currentUser = null; /** * construction queue @@ -84,17 +83,17 @@ class Legacies_Empire_Model_Planet_Building_Shipyard * it doesn't yet exist. * * @param Legacies_Empire_Model_Planet $currentPlanet - * @param Woootook_Player_Model_Entity $currentPlayer + * @param Legacies_Empire_Model_User $currentUser * @return Legacies_Empire_Model_Planet_Building_Shipyard */ - public static function factory($currentPlanet, $currentPlayer) + public static function factory($currentPlanet, $currentUser) { if ($currentPlanet->getId()) { return null; } if (!isset(self::$_instances[$currentPlanet->getId()])) { - self::$_instances[$currentPlanet->getId()] = new self($currentPlanet, $currentPlayer); + self::$_instances[$currentPlanet->getId()] = new self($currentPlanet, $currentUser); } return self::$_instances[$currentPlanet->getId()]; } @@ -105,14 +104,25 @@ class Legacies_Empire_Model_Planet_Building_Shipyard * @see Legacies_Empire_Model_Planet_Building_Shipyard::factory() * * @param Legacies_Empire_Model_Planet $currentPlanet - * @param Woootook_Player_Model_Entity $currentPlayer + * @param Legacies_Empire_Model_User $currentUser */ - public function __construct($currentPlanet, $currentPlayer) + public function __construct($currentPlanet, $currentUser) { $this->_currentPlanet = $currentPlanet; - $this->_currentPlayer = $currentPlayer; + $this->_currentUser = $currentUser; - $this->_builder = new Legacies_Empire_Model_Planet_Building_Shipyard_Builder($currentPlanet, $currentPlayer); + $this->_builder = new Legacies_Empire_Model_Planet_Building_Shipyard_Builder($currentPlanet, $currentUser); + } + + /** + * Returns the timestamp at the instance creation. + * + * @deprecated + * @return int + */ + protected function _now() + { + return Wootook::now(); } /** @@ -132,10 +142,10 @@ class Legacies_Empire_Model_Planet_Building_Shipyard * @param int|string $qty * @return Legacies_Empire_Model_Planet_Building_Shipyard */ - public function appendQueue($shipId, $qty, Wootook_Core_DateTime $time = null) + public function appendQueue($shipId, $qty, $time = null) { if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } // Dispatch event @@ -145,7 +155,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard 'time' => &$time, 'shipyard' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); $this->_builder->appendQueue($shipId, $qty, $time); @@ -157,7 +167,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard 'time' => $time, 'shipyard' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); return $this; @@ -168,10 +178,10 @@ class Legacies_Empire_Model_Planet_Building_Shipyard * * @return Legacies_Empire_Model_Planet_Building_Shipyard */ - public function updateQueue(Wootook_Core_DateTime $time = null) + public function updateQueue($time = null) { if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } // Dispatch event @@ -179,7 +189,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard 'time' => &$time, 'shipyard' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); $this->_builder->updateQueue($time); @@ -189,7 +199,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard 'time' => $time, 'shipyard' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); return $this; @@ -221,7 +231,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard 'ship_id' => $shipId, 'shipyard' => $this, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer + 'user' => $this->_currentUser )); } catch (Legacies_Core_Event_Break $e) { return false; @@ -266,7 +276,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard $time = $eventData['time']; } - $shipyard = self::factory($planet, $planet->getPlayer()); + $shipyard = self::factory($planet, $planet->getUser()); if ($shipyard !== null) { $shipyard->updateQueue(); } diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php similarity index 83% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php index a9bee0b..37f5682 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Builder.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -42,11 +42,6 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ protected $_maxLength = 0; - /** - * @var float - */ - protected $_speedEnhancement = null; - public function init() { $this->_unserializeQueue($this->_currentPlanet->getData('b_hangar_id')); @@ -66,7 +61,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder $shipId = $params['ship_id']; $qty = $params['qty']; if (!isset($params['created_at'])) { - $createdAt = new Wootook_Core_DateTime(); + $createdAt = time(); } else { $createdAt = $params['created_at']; } @@ -84,21 +79,6 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder )); } - public function getSpeedEnhancement() - { - if ($this->_speedEnhancement === null) { - $event = Wootook::dispatchEvent('planet.shipyard.speed-enhancement', array( - 'player' => $this->_currentPlanet, - 'planet' => $this->_currentPlanet, - 'enhancement' => 1 - )); - - $this->_speedEnhancement = $event->getData('enhancement'); - } - - return $this->_speedEnhancement; - } - /** * Check if a ship or defense type is actually buildable on the current * planet, depending on the technology and buildings requirements. @@ -108,13 +88,15 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ public function checkAvailability($shipId) { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); if (!$types->is($shipId, Legacies_Empire::TYPE_SHIP) && !$types->is($shipId, Legacies_Empire::TYPE_DEFENSE)) { return false; } - return parent::checkAvailability($shipId); + parent::checkAvailability($shipId); + + return true; } /** @@ -126,9 +108,9 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ public function getMaximumBuildableElementsCount($shipId) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); $qty = 0; foreach ($resources as $resourceId => $_) { @@ -202,20 +184,22 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ public function getBuildingTime($shipId, $qty) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $gameConfig = Wootook_Core_Model_Config::getSingleton(); Math::setPrecision(50); - $buildingTime = Math::mul($prices[$shipId][Legacies_Empire::BASE_BUILDING_TIME], intval($qty)); + $buildingTime = Math::mul($prices[$shipId][Legacies_Empire::BASE_BUILDING_TIME], $qty); + + $speedFactor = $gameConfig->getData('game_speed'); + $baseTime = Math::div($buildingTime, $speedFactor); - $speedFactor = Wootook::getGameConfig('game/speed/general') / 1000; - $baseTime = Math::mul(Math::div($buildingTime, 5000), Math::mul($speedFactor, $this->getSpeedEnhancement())); Math::setPrecision(); $event = Wootook::dispatchEvent('planet.shipyard.building-time', array( 'time' => $baseTime, 'base_time' => $baseTime, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer, + 'user' => $this->_currentUser, 'ship_id' => $shipId, 'qty' => $qty )); @@ -229,8 +213,8 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder */ public function getResourcesNeeded($shipId, $qty) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); if (!isset($prices[$shipId])) { return array(); @@ -266,11 +250,11 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder * * @return Legacies_Empire_Model_Planet_Building_Shipyard */ - public function updateQueue(Wootook_Core_DateTime $time) + public function updateQueue($time) { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); - $elapsedTime = $time->getTimestamp() - $this->_currentPlanet->getData('b_hangar')->getTimestamp(); + $elapsedTime = $time - $this->_currentPlanet->getData('b_hangar'); foreach ($this->getQueue() as $element) { $shipId = $element->getData('ship_id'); @@ -287,7 +271,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder $timeRatio = $elapsedTime / $buildTime; $itemsBuilt = Math::mul($timeRatio, $qty); - $element->setData('updated_at', $time->getTimestamp()); + $element->setData('updated_at', $time); $element->setData('qty', Math::sub($qty, $itemsBuilt)); $this->_currentPlanet->setData($fields[$shipId], Math::add($this->_currentPlanet->getData($fields[$shipId]), $itemsBuilt)); break; @@ -306,7 +290,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder * @param int|string $qty * @return Legacies_Empire_Model_Planet_Building_Shipyard */ - public function appendQueue($shipId, $qty, Wootook_Core_DateTime $time) + public function appendQueue($shipId, $qty, $time) { if ($this->_maxLength > 0 && $this->count() >= $this->_maxLength) { return $this; @@ -316,7 +300,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder return $this; } - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); if (!$types->is($shipId, Legacies_Empire::TYPE_SHIP) && !$types->is($shipId, Legacies_Empire::TYPE_DEFENSE)) { return $this; } @@ -344,8 +328,8 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder $this->enqueue(array( 'ship_id' => $shipId, 'qty' => $qty, - 'created_at' => $time->getTimestamp(), - 'updated_at' => $time->getTimestamp() + 'created_at' => $time, + 'updated_at' => $time )); $this->_currentPlanet->setData('b_hangar_id', $this->serialize()); @@ -355,4 +339,4 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder return $this; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php similarity index 97% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php index 6dac60d..9bc8df3 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/Shipyard/Item.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php b/application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php similarity index 96% rename from src/application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php rename to application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php index e4cab3b..7e57176 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Building/SolarPlant.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -31,7 +31,7 @@ class Legacies_Empire_Model_Planet_Building_SolarPlant implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player) + public function getProductionRatios($level, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_ENERGY => 20 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio) diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php b/application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php similarity index 81% rename from src/application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php rename to application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php index f0d31e4..6e2c7db 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Ship/LargeTransport.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -39,15 +39,15 @@ class Legacies_Empire_Model_Planet_Ship_LargeTransport { const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE = 4; - public function getBaseSpeed(Wootook_Player_Model_Entity $player) + public function getBaseSpeed(Wootook_Empire_Model_User $user) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); return $prices[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT][Legacies_Empire::SHIPS_CELERITY_PRIMARY]; } - public function getSpeedMultiplier(Wootook_Player_Model_Entity $player) + public function getSpeedMultiplier(Wootook_Empire_Model_User $user) { - return pow(1.1, $player->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); + return pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); } } \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php b/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php similarity index 70% rename from src/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php rename to application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php index 15be57f..e08f79e 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Ship/LightTransport.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -39,23 +39,23 @@ class Legacies_Empire_Model_Planet_Ship_LightTransport { const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE = 4; - public function getBaseSpeed(Wootook_Player_Model_Entity $player) + public function getBaseSpeed(Wootook_Empire_Model_User $user) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); - if ($player->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE) { + if ($user->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE) { return $prices[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT][Legacies_Empire::SHIPS_CELERITY_PRIMARY]; } else { return $prices[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT][Legacies_Empire::SHIPS_CELERITY_SECONDARY]; } } - public function getSpeedMultiplier(Wootook_Player_Model_Entity $player) + public function getSpeedMultiplier(Wootook_Empire_Model_User $user) { - if ($player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE) { - return pow(1.1, $player->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); + if ($user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE) { + return pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); } else { - return pow(1.2, $player->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE)); + return pow(1.2, $user->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE)); } } } \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php b/application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php similarity index 83% rename from src/application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php rename to application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php index b6f132c..39848de 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Ship/SolarSatellite.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -37,29 +37,29 @@ class Legacies_Empire_Model_Planet_Ship_SolarSatellite extends Wootook_Empire_Model_Planet_ShipAbstract implements Wootook_Empire_Model_Planet_ResourceProductionInterface { - public function getProductionRatios($quantity, $produtionRatio, $planet, $player) + public function getProductionRatios($quantity, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_ENERGY => ((floatval($planet->getData('temp_max')) / 4) + 20) * (0.1 * $produtionRatio) * floatval($quantity) ); } - public function getBaseSpeed(Wootook_Player_Model_Entity $player) + public function getBaseSpeed(Wootook_Empire_Model_User $user) { return 0; } - public function getSpeedMultiplier(Wootook_Player_Model_Entity $player) + public function getSpeedMultiplier(Wootook_Empire_Model_User $user) { return 0; } - public function getActualSpeed(Wootook_Player_Model_Entity $player) + public function getActualSpeed(Wootook_Empire_Model_User $user) { return 0; } - public function getBaseConsumption(Wootook_Player_Model_Entity $player) + public function getBaseConsumption(Wootook_Empire_Model_User $user) { return 0; } diff --git a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php b/application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php similarity index 63% rename from src/application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php rename to application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php index 7025166..ade59ad 100644 --- a/src/application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php +++ b/application/code/core/Legacies/Empire/Model/Planet/Ship/Supernova.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -40,37 +40,37 @@ class Legacies_Empire_Model_Planet_Ship_Supernova const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE = 20; const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY = 15; - public function getProductionRatios($quantity, $produtionRatio, $planet, $player) + public function getProductionRatios($quantity, $produtionRatio, $planet, $user) { return array( Legacies_Empire::RESOURCE_ENERGY => ((floatval($planet->getData('temp_max')) / 4) + 20) * (0.1 * $produtionRatio) * floatval($quantity) * -1250 ); } - public function getBaseSpeed(Wootook_Player_Model_Entity $player) + public function getBaseSpeed(Wootook_Empire_Model_User $user) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); - if ($player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE && - $player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY) { + if ($user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE && + $user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY) { return $prices[Legacies_Empire::ID_SHIP_SUPERNOVA][Legacies_Empire::SHIPS_CELERITY_PRIMARY]; } else { return $prices[Legacies_Empire::ID_SHIP_SUPERNOVA][Legacies_Empire::SHIPS_CELERITY_SECONDARY]; } } - public function getSpeedMultiplier(Wootook_Player_Model_Entity $player) + public function getSpeedMultiplier(Wootook_Empire_Model_User $user) { - if ($player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE && - $player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY) { - return pow(1.2, $player->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE)); + if ($user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE && + $user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY) < self::REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY) { + return pow(1.2, $user->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE)); } else { - return pow(1.3, $player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE)) * - pow(1.1, $player->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY)); + return pow(1.3, $user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE)) * + pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY)); } } - public function getBaseConsumption(Wootook_Player_Model_Entity $player) + public function getBaseConsumption(Wootook_Empire_Model_User $user) { return 0; } diff --git a/src/application/code/core/Legacies/Exception.php b/application/code/core/Legacies/Exception.php similarity index 97% rename from src/application/code/core/Legacies/Exception.php rename to application/code/core/Legacies/Exception.php index a86c60b..95d7b9a 100644 --- a/src/application/code/core/Legacies/Exception.php +++ b/application/code/core/Legacies/Exception.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/core/Wootook/Core/Event.php b/application/code/core/Legacies/Officers/Exception.php similarity index 93% rename from src/application/code/core/Wootook/Core/Event.php rename to application/code/core/Legacies/Officers/Exception.php index 42b4de7..a389e3b 100644 --- a/src/application/code/core/Wootook/Core/Event.php +++ b/application/code/core/Legacies/Officers/Exception.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -27,14 +27,11 @@ * documentation for further information about customizing Wootook. * */ - /** * * Enter description here ... * @author Greg * */ -class Wootook_Core_Event - extends Wootook_Object -{ -} \ No newline at end of file + +interface Legacies_Officers_Exception {} \ No newline at end of file diff --git a/application/code/core/Legacies/Officers/Model/Observer.php b/application/code/core/Legacies/Officers/Model/Observer.php new file mode 100644 index 0000000..eaf0b17 --- /dev/null +++ b/application/code/core/Legacies/Officers/Model/Observer.php @@ -0,0 +1,70 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ +/** + * + * Enter description here ... + * @author Greg + * + */ +class Legacies_Officers_Model_Observer +{ + public static function planetUpdateListener($eventData) + { + if (isset($eventData['planet'])) { + $planet = $eventData['planet']; + + $user = $planet->getUser(); + + $level = floor(sqrt($user->getData('xpminier') / 500)); + if ($user->getData('lvl_minier') < $level) { + $difference = $level - $user->getData('lvl_minier'); + if ($difference == 1) { + Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained 1 miner level.'); + } else { + Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained %1$d miner level.', (int) $difference); + } + } + + $level = floor(sqrt($user->getData('xpraid'))); + if ($user->getData('lvl_raid') < $level) { + $difference = $level - $user->getData('lvl_raid'); + if ($difference == 1) { + Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained 1 raider level.'); + } else { + Wootook::getSession(Wootook_Empire_Model_User::SESSION_KEY) + ->addInfo('You gained %1$d raider level.', (int) $difference); + } + } + } + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Exception.php b/application/code/core/Legacies/Oficers.php similarity index 95% rename from src/application/code/core/Wootook/Exception.php rename to application/code/core/Legacies/Oficers.php index c3b339a..089b825 100644 --- a/src/application/code/core/Wootook/Exception.php +++ b/application/code/core/Legacies/Oficers.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. @@ -27,11 +27,14 @@ * documentation for further information about customizing Wootook. * */ - /** * * Enter description here ... * @author Greg * */ -interface Wootook_Exception {} \ No newline at end of file + +class Legacies_Officers +{ + +} \ No newline at end of file diff --git a/application/code/core/Wootook.php b/application/code/core/Wootook.php new file mode 100644 index 0000000..4197254 --- /dev/null +++ b/application/code/core/Wootook.php @@ -0,0 +1,342 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +/** + * Bootstrap class, used to access main and global functionalities + * + * @package Wootook + * @category core + */ +class Wootook +{ + /** + * Static list of application event listeners + * + * @var array + */ + private static $_listeners = array(); + + /** + * Static list of all locale translators + * + * @var array + */ + private static $_translators = array(); + + /** + * HTTP request management object + * + * @var Legacies_Core_Controller_Request_Http + */ + protected static $_request = null; + + /** + * HTTP response management object + * + * @var Legacies_Core_Controller_Response + */ + protected static $_response = null; + + /** + * The current timestamp + * + * @var int + */ + protected static $_now = null; + + /** + * Default locale identifier + * + * @var string + */ + protected static $_defaultLocale = 'fr_FR'; + + /** + * + * Enter description here ... + * @var array + */ + protected static $_config = null; + + /** + * Registers an event listener to be called later in the application. + * + * @param string $event The event identifier + * @param callback $listener The event callback to be called + */ + public static function registerListener($event, $listener) + { + if (!isset(self::$_listeners[$event])) { + self::$_listeners[$event] = array(); + } + self::$_listeners[$event][] = $listener; + } + + /** + * Clear all event listeners + */ + public static function clearAllListeners() + { + self::$_listeners = array(); + } + + /** + * Clear a specific event's listeners + * + * @param unknown_type $event + */ + public static function clearEventListeners($event) + { + if (isset(self::$_listeners[$event])) { + self::$_listeners[$event] = array(); + } + } + + /** + * Dispatches an event, calls all callbacks that were previously registered + * + * @param string $event The event identifier + * @param array $params The event params + */ + public static function dispatchEvent($event, $params) + { + $eventObject = new Wootook_Core_Event($params); + + if (!isset(self::$_listeners[$event])) { + return $eventObject; + } + + foreach (self::$_listeners[$event] as $listener) { + call_user_func($listener, $eventObject); + } + + return $eventObject; + } + + /** + * + * Enter description here ... + * @param unknown_type $namespace + * @return Legacies_Core_Model_Session + */ + public static function getSession($namespace) + { + return Wootook_Core_Model_Session::factory($namespace); + } + + public static function getTranslator($locale = null) + { + if ($locale === null) { + $locale = self::getLocale(); + } + + if (!isset($translator[$locale])) { + $path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'locale'; + $translator[$locale] = new Wootook_Core_Model_Translator($path, $locale); + } + return $translator[$locale]; + } + + public static function translate($locale, $message, Array $args) + { + return self::getTranslator($locale)->translateArgs($message, $args); + } + + public static function __($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return self::getTranslator(self::getLocale())->translateArgs($message, $args); + } + + public static function getLocale() + { + $availableLocales = self::getConfig('global/locales'); + + return self::getPreferredLocale($availableLocales); + } + + public static function setDefaultLocale($locale) + { + $oldLocale = self::$_defaultLocale; + self::$_defaultLocale = $locale; + + return $oldLocale; + } + + public static function getDefaultLocale() + { + return self::$_defaultLocale; + } + + public function getPreferredLocale($availableLocales = array()) + { + if (empty($availableLocales)) { + return self::getDefaultLocale(); + } + + $userLocale = self::getSession('user')->getData('locale'); + if ($userLocale !== null) { + return $userLocale; + } + + $locales = array(); + + if (($accept = self::getRequest()->getServer('HTTP_ACCEPT_LANGUAGE')) !== null) { + // break up string into pieces (languages and q factors) + preg_match_all('/([a-z]{1,8}(?:-([a-z]{1,8}))?)\s*(?:;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $accept, $matches); + + $length = count($matches[1]); + for ($i = 0; $i < $length; $i++) { + $locale = $lang_parse[1]; + if (!empty($lang_parse[2])) { + $locale .= '_' . strtoupper($lang_parse[2]); + } + $locales[$locale] = !empty($lang_parse[3]) ? min(max(floatval($lang_parse[3]), 0), 1) : 1; + } + + arsort($locales, SORT_NUMERIC); + } + + if (empty($locales)) { + return self::getDefaultLocale(); + } + + $preferredLocale = key($locales); + $preferredPriority = current($locales); + foreach ($locales as $locale => $piority) { + if (!in_array($locale, $availableLocales)) { + continue; + } + if ($preferredPriority < $piority) { + $preferredPriority = $piority; + $preferredLocale = $locale; + } + } + + self::getSession('user')->setData('locale', $preferredLocale); + + return $preferredLocale; + } + + public static function now() + { + if (self::$_now === null) { + self::$_now = time(); + } + return self::$_now; + } + + public static function getRequest() + { + if (self::$_request === null) { + self::$_request = new Wootook_Core_Controller_Request_Http(); + } + return self::$_request; + } + + public static function setRequest($request) + { + self::$_request = $request; + } + + public static function getResponse() + { + if (self::$_response === null) { + self::$_response = new Wootook_Core_Controller_Response_Http(); + } + return self::$_response; + } + + public static function setResponse($response) + { + self::$_response = $response; + } + + public static function getConfig($path = null) + { + if (self::$_config === null) { + self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php'; + } + + if ($path === null || !is_string($path)) { + return self::$_config; + } + $config = self::$_config; + foreach (explode('/', $path) as $chunk) { + if (!isset($config[$chunk])) { + return null; + } + $config = $config[$chunk]; + } + return $config; + } + + public static function getBaseUrl() + { + return self::getConfig('global/web/base_url'); + } + + public static function getSkinUrl($package, $theme, $uri, Array $params = array()) + { + return self::getUrl("skin/{$package}/{$theme}/{$uri}", $params); + } + + public static function getUrl($uri, Array $params = array()) + { + $baseUrl = self::getBaseUrl(); + + $serializedParams = array(); + foreach ($params as $paramKey => $paramValue) { + if ($paramValue) { + $serializedParams[] = "{$paramKey}={$paramValue}"; + } + } + + if (count($serializedParams) > 0) { + return $baseUrl . $uri . '?' . implode('&', $serializedParams); + } + return $baseUrl . $uri; + } + + public static function fileExists($path) + { + if ($path === null || empty($path)) { + return false; + } + + if (($fp = @fopen($path, 'r', true)) === false) { + return false; + } + fclose($fp); + return true; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Block/Concat.php b/application/code/core/Wootook/Core/Block/Concat.php similarity index 85% rename from src/application/code/core/Wootook/Core/Block/Concat.php rename to application/code/core/Wootook/Core/Block/Concat.php index cb8dc89..5c9afc5 100644 --- a/src/application/code/core/Wootook/Core/Block/Concat.php +++ b/application/code/core/Wootook/Core/Block/Concat.php @@ -1,7 +1,7 @@ getTitleDefaultConcat(); } - if ($concatType == self::TITLE_OVERWRITE || $this->_title === null) { + if ($concatType == self::TITLE_OVERWRITE) { $this->_title = $title; } else if ($concatType == self::TITLE_CONCAT_BEFORE) { $this->_title = $title . $this->getTitleSeparator() . $this->_title; @@ -86,56 +85,37 @@ class Wootook_Core_Block_Html_Head return $this; } - public function addJs($script, $type = 'text/javascript', Array $options = array(), $theme = null, $package = null) + public function addJs($script, $type = 'text/javascript', Array $options = array()) { $options['type'] = $type; $options['path'] = $script; - $options['theme'] = $theme; - $options['package'] = $package; $this->addItem(self::TYPE_GLOBAL_JS, $options); return $this; } - public function addCss($stylesheet, $type = 'text/css', $condition = null, Array $options = array(), $theme = null, $package = null) + public function addCss($stylesheet, $type = 'text/css', $condition = null, Array $options = array()) { $options['type'] = $type; $options['path'] = $stylesheet; $options['condition'] = $condition; - $options['theme'] = $theme; - $options['package'] = $package; - $this->addItem(self::TYPE_GLOBAL_CSS, $options); + $this->addItem(self::TYPE_SKIN_CSS, $options); return $this; } - public function addSkinJs($script, $type = 'text/javascript', Array $options = array(), $theme = null, $package = null) + public function addSkinJs($script, $type = 'text/javascript', Array $options = array()) { $options['type'] = $type; $options['path'] = $script; - $options['theme'] = $theme; - $options['package'] = $package; $this->addItem(self::TYPE_SKIN_JS, $options); return $this; } - public function addSkinCss($stylesheet, $type = 'text/css', $condition = null, Array $options = array(), $theme = null, $package = null) - { - $options['type'] = $type; - $options['path'] = $stylesheet; - $options['condition'] = $condition; - $options['theme'] = $theme; - $options['package'] = $package; - - $this->addItem(self::TYPE_SKIN_CSS, $options); - - return $this; - } - public function addInlineJs($content, $type = 'text/javascript', Array $options = array()) { $options['type'] = $type; @@ -149,6 +129,7 @@ class Wootook_Core_Block_Html_Head public function addInlineCss($content, $type = 'text/css', Array $options = array()) { $options['type'] = $type; + $options['path'] = $path; $options['content'] = $content; $this->addItem(self::TYPE_INLINE_CSS, $options); @@ -157,14 +138,6 @@ class Wootook_Core_Block_Html_Head } public function getCss() - { - if (isset($this->_items[self::TYPE_GLOBAL_CSS])) { - return $this->_items[self::TYPE_GLOBAL_CSS]; - } - return array(); - } - - public function getSkinCss() { if (isset($this->_items[self::TYPE_SKIN_CSS])) { return $this->_items[self::TYPE_SKIN_CSS]; @@ -211,35 +184,8 @@ class Wootook_Core_Block_Html_Head if (!isset($css['media'])) { $css['media'] = 'all'; } - $url = $this->getStaticUrl($css['path'], array()); $render .=<< -HTML_EOF; - } - } - - public function renderSkinCss() - { - $render = ''; - foreach ($this->getSkinCss() as $css) { - if (!isset($css['media'])) { - $css['media'] = 'all'; - } - $url = $this->getSkinUrl($css['path'], array(), $css['theme'], $css['package']); - $render .=<< -HTML_EOF; - } - } - - public function renderInlineCss() - { - foreach ($this->getInlineCss() as $css) { - if (!isset($css['media'])) { - $css['media'] = 'all'; - } - $render .=<</**/ + HTML_EOF; } return $render; @@ -252,34 +198,8 @@ HTML_EOF; if (!isset($js['type'])) { $js['type'] = 'text/javascript'; } - $url = $this->getStaticUrl($js['path']); $render .=<< -HTML_EOF; - } - return $render; - } - - public function renderSkinJs() - { - $render = ''; - foreach ($this->getJs() as $js) { - if (!isset($js['type'])) { - $js['type'] = 'text/javascript'; - } - $url = $this->getSkinUrl($js['path'], array(), $js['theme'], $js['package']); - $render .=<< -HTML_EOF; - } - return $render; - } - - public function renderInlineJs() - { - foreach ($this->getInlineJs() as $js) { - $render .=<</**/ + HTML_EOF; } return $render; diff --git a/src/application/code/core/Wootook/Core/Block/Html/Navigation.php b/application/code/core/Wootook/Core/Block/Html/Navigation.php similarity index 74% rename from src/application/code/core/Wootook/Core/Block/Html/Navigation.php rename to application/code/core/Wootook/Core/Block/Html/Navigation.php index efbcd35..acc05fe 100644 --- a/src/application/code/core/Wootook/Core/Block/Html/Navigation.php +++ b/application/code/core/Wootook/Core/Block/Html/Navigation.php @@ -17,34 +17,7 @@ class Wootook_Core_Block_Html_Navigation ), 'label' => $label, 'title' => $title, - 'classes' => $classes, - 'attributes' => $attributes - )); - $parent->setPartial($baseName, $child); - - if ($template !== null) { - $child->setTemplate($template); - } - - return $this; - } - public function addStaticLink($name, $label, $title, $uri, Array $params = array(), Array $classes = array(), $template = null, Array $attributes = array()) - { - $explodedPath = explode('/', $name); - $baseName = array_pop($explodedPath); - $parent = $this->_getNode($explodedPath); - - $child = $this->getLayout() - ->createBlock('core/html.navigation.link', $this->getNameInLayout() . '.' . $baseName, array( - 'url' => array( - 'uri' => $uri, - 'params' => $params, - 'static' => true - ), - 'label' => $label, - 'title' => $title, - 'classes' => $classes, - 'attributes' => $attributes + 'classes' => $classes )); $parent->setPartial($baseName, $child); @@ -80,7 +53,7 @@ class Wootook_Core_Block_Html_Navigation public function addPopupLink($name, $label, $title, $uri, Array $params = array(), Array $classes = array(), $template = null, Array $attributes = array()) { - $uri = $this->getStaticUrl($uri, $params); + $uri = $this->getUrl($uri, $params); $attributes['onclick'] = "f('{$params}', '{$label}');return false;"; @@ -124,4 +97,4 @@ class Wootook_Core_Block_Html_Navigation } return $child->_getNode($explodedPath); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Block/Html/Navigation/Link.php b/application/code/core/Wootook/Core/Block/Html/Navigation/Link.php similarity index 80% rename from src/application/code/core/Wootook/Core/Block/Html/Navigation/Link.php rename to application/code/core/Wootook/Core/Block/Html/Navigation/Link.php index 82a09fa..44e373f 100644 --- a/src/application/code/core/Wootook/Core/Block/Html/Navigation/Link.php +++ b/application/code/core/Wootook/Core/Block/Html/Navigation/Link.php @@ -43,19 +43,6 @@ class Wootook_Core_Block_Html_Navigation_Link return $this->_title; } - public function setStaticUrl($uri, $params = array()) - { - if ($uri === null) { - return $this; - } - - $this->_uri = $uri; - $this->_params = $params; - $this->_url = $this->getStaticUrl($uri, $params); - - return $this; - } - public function setUrl($uri, $params = array()) { if ($uri === null) { @@ -84,7 +71,7 @@ class Wootook_Core_Block_Html_Navigation_Link return $this->_url; } $params = array_merge($this->_params, $moreParams); - return $this->getStaticUrl($this->_uri, $params); + return $this->getUrl($this->_uri, $params); } public function setAttribute($attributeName, $attributeValue) @@ -157,18 +144,10 @@ class Wootook_Core_Block_Html_Navigation_Link if (isset($data['url'])) { if (is_array($data['url']) && isset($data['url']['uri'])) { - if (isset($data['url']['static']) && $data['url']['static']) { - if (isset($data['url']['params'])) { - $this->setStaticUrl($data['url']['uri'], $data['url']['params']); - } else { - $this->setStaticUrl($data['url']['uri']); - } + if (isset($data['url']['params'])) { + $this->setUrl($data['url']['uri'], $data['url']['params']); } else { - if (isset($data['url']['params'])) { - $this->setUrl($data['url']['uri'], $data['url']['params']); - } else { - $this->setUrl($data['url']['uri']); - } + $this->setUrl($data['url']['uri']); } } else { $this->setExternalUrl($data['url']); @@ -198,4 +177,4 @@ class Wootook_Core_Block_Html_Navigation_Link return $this; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Block/Html/Navigation/Node.php b/application/code/core/Wootook/Core/Block/Html/Navigation/Node.php similarity index 100% rename from src/application/code/core/Wootook/Core/Block/Html/Navigation/Node.php rename to application/code/core/Wootook/Core/Block/Html/Navigation/Node.php diff --git a/src/application/code/core/Wootook/Core/Block/Html/Page.php b/application/code/core/Wootook/Core/Block/Html/Page.php similarity index 99% rename from src/application/code/core/Wootook/Core/Block/Html/Page.php rename to application/code/core/Wootook/Core/Block/Html/Page.php index 12c7775..b2879f8 100644 --- a/src/application/code/core/Wootook/Core/Block/Html/Page.php +++ b/application/code/core/Wootook/Core/Block/Html/Page.php @@ -16,4 +16,4 @@ class Wootook_Core_Block_Html_Page return $this; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Block/Template.php b/application/code/core/Wootook/Core/Block/Template.php similarity index 51% rename from src/application/code/core/Wootook/Core/Block/Template.php rename to application/code/core/Wootook/Core/Block/Template.php index 1383a4e..130f183 100644 --- a/src/application/code/core/Wootook/Core/Block/Template.php +++ b/application/code/core/Wootook/Core/Block/Template.php @@ -1,13 +1,12 @@ getScriptPath() == '') { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_RuntimeException("No script path defined in block {$this->getNameInLayout()}.")); + trigger_error("No script path defined in block {$this->getNameInLayout()}.", E_USER_NOTICE); return null; } @@ -16,31 +15,29 @@ class Wootook_Core_Block_Template $package = $this->getLayout()->getPackage(); $theme = $this->getLayout()->getTheme(); - if ($package !== Wootook_Core_Model_Layout::DEFAULT_PACKAGE) { - if ($theme !== Wootook_Core_Model_Layout::DEFAULT_THEME) { + if ($package !== Wootook_Core_Layout::DEFAULT_PACKAGE) { + if ($theme !== Wootook_Core_Layout::DEFAULT_THEME) { $path = sprintf($pattern, $package, $theme); if (Wootook::fileExists($path)) { return $path; } } - $path = sprintf($pattern, $package, Wootook_Core_Model_Layout::DEFAULT_THEME); + $path = sprintf($pattern, $package, Wootook_Core_Layout::DEFAULT_THEME); if (Wootook::fileExists($path)) { return $path; } } } else { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_RuntimeException("No layout defined.")); + trigger_error("No layout defined.", E_USER_NOTICE); } - $path = sprintf($pattern, Wootook_Core_Model_Layout::DEFAULT_PACKAGE, Wootook_Core_Model_Layout::DEFAULT_THEME); + $path = sprintf($pattern, Wootook_Core_Layout::DEFAULT_PACKAGE, Wootook_Core_Layout::DEFAULT_THEME); if (Wootook::fileExists($path)) { return $path; } - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_RuntimeException("Template '{$file}' could not be found.")); + trigger_error("Template '{$file}' could not be found.", E_USER_ERROR); return null; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Block/Text.php b/application/code/core/Wootook/Core/Block/Text.php similarity index 91% rename from src/application/code/core/Wootook/Core/Block/Text.php rename to application/code/core/Wootook/Core/Block/Text.php index dabe336..129df11 100644 --- a/src/application/code/core/Wootook/Core/Block/Text.php +++ b/application/code/core/Wootook/Core/Block/Text.php @@ -1,7 +1,7 @@ setTableName($tableName); + } + if ($entityClassName != null) { + $this->setEntityClassName($entityClassName); + } + } + + protected function _init() + { + return $this; + } + + public function setTableName($tableName) + { + if (!is_array($tableName)) { + $this->_tableName = $tableName; + } else { + $this->_tableName = current($tableName); + $this->_tableAlias = key($tableName); + } + + return $this; + } + + public function getTableName() + { + return $this->_tableName; + } + + public function setEntityClassName($entityClassName) + { + $this->_entityClassName = $entityClassName; + + return $this; + } + + public function getEntityClassName() + { + return $this->_entityClassName; + } + + public function quote($data) + { + static $database = null; + + if ($database === null) { + $database = Wootook_Database::getSingleton(); + } + + return $database->quote($data); + } + + public function column($column = '*', $alias = null) + { + if (is_array($column)) { + foreach ($column as $alias => $field) { + if (is_int($alias)) { + $this->_columns[] = array($field); + } else { + $this->_columns[] = array($alias => $field); + } + } + } else if ($alias === null || is_int($alias)) { + $this->_columns[] = array($column); + } else { + $this->_columns[] = array($alias => $column); + } + + return $this; + } + + public function where($condition) + { + $this->_where[] = $condition; + + return $this; + } + + public function join($table, $condition, $fields = array('*'), $mode = 'INNER') + { + static $database = null; + + if ($database === null) { + $database = Wootook_Database::getSingleton(); + } + + if (is_array($table)) { + $alias = key($table); + $table = current($table); + + foreach ($fields as $fieldAlias => $fieldName) { + $this->column("{$alias}.{$field}", $fieldAlias); + } + + $this->_join[] = "{$mode} JOIN {$database->getTable($table)} AS {$alias} ON {$condition}"; + } else { + foreach ($fields as $field) { + $this->column("{$field}"); + } + + $this->_join[] = "{$mode} JOIN {$database->getTable($table)} ON {$condition}"; + } + + return $this; + } + + public function order($field, $direction = 'ASC') + { + $this->_order[] = "{$field} {$direction}"; + + return $this; + } + + public function union($collection) + { + $this->_union[] = $collection; + + return $this; + } + + public function limit($limit, $offset = null) + { + $this->_limit = intval($limit); + $this->_offset = $offset; + + return $this; + } + + public function group($groupField) + { + $this->_group[] = $groupField; + + return $this; + } + + protected function _prepareSql() + { + if (empty($this->_union)) { + $database = Wootook_Database::getSingleton(); + + $fields = array(); + foreach ($this->_columns as $field) { + $fieldName = current($field); + $fieldAlias = key($field); + if (is_string($fieldAlias)) { + $fields[] = "{$fieldName} AS {$fieldAlias}"; + } else { + $fields[] = $fieldName; + } + } + if (!empty($fields)) { + $fields = implode(", ", $fields); + } else { + $fields = '*'; + } + if (!empty($this->_where)) { + $where = 'WHERE (' . implode(") AND (", $this->_where) . ')'; + } else { + $where = ''; + } + $joinedTables = implode("\n ", $this->_join); + + $order = ''; + if (!empty($this->_order)) { + $order = 'ORDER BY ' . implode(", ", $this->_order); + } + $alias = ''; + if ($this->_tableAlias !== null) { + $alias = " AS {$this->_tableAlias}"; + } + $limit = ''; + if ($this->_limit) { + if ($this->_offset) { + $limit = "LIMIT {$this->_limit}, {$this->_offset}"; + } else { + $limit = "LIMIT {$this->_limit}"; + } + } + $group = ''; + if (!empty($this->_group)) { + $group = 'GROUP BY ' . implode(', ', $this->_group); + } + + return <<getTable($this->getTableName())}{$alias} + {$joinedTables} + {$where} + {$group} + {$order} + {$limit} +SQL_EOF; + } else { + $statements = array(); + foreach ($this->_union as $statement) { + $statements[] = $statement->_prepareSql(); + } + + $statements = '(' . implode(') UNION (', $statements) . ')'; + if (!empty($where)) { + $where = 'WHERE ' . implode(" AND ", $this->_where); + } else { + $where = ''; + } + $where = implode(" AND ", $this->_where); + + $limit = ''; + if ($this->_limit) { + if ($this->_offset) { + $limit = "LIMIT {$this->_limit}, {$this->_offset}"; + } else { + $limit = "LIMIT {$this->_limit}"; + } + } + + return <<_prepareSql(); + } + + protected function _load() + { + $sql = $this->_prepareSql(); + + $database = Wootook_Database::getSingleton(); + $statement = $database->prepare($sql); + + $args = func_get_args(); + $statement->execute(array_shift($args)); + + $this->_items = array(); + if (func_num_args() > 1) { + $reflection = new ReflectionClass(array_shift($args)); + } else { + $reflection = new ReflectionClass($this->getEntityClassName()); + } + + while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { + $params = array_merge(array($row), $args); + $this->_items[] = $reflection->newInstanceArgs($params); + } + + return $this; + } + + protected function _save() + { + foreach ($this->_items as $child) { + $child->save(); + } + + return $this; + } + + protected function _delete() + { + foreach ($this->_items as $child) { + $child->delete(); + } + + return $this; + } + + public function getSize() + { + $clone = clone $this; + $clone->_fields = array(); + $clone->column('1'); + + $sql = $clone->_prepareSql(); + + $database = Wootook_Database::getSingleton(); + $statement = $database->prepare($sql); + + $args = func_get_args(); + $statement->execute(array_shift($args)); + $count = $statement->rowCount(); + $statement->closeCursor(); + + return $count; + } + + public function count() + { + return count($this->_items); + } + + public function current() + { + return current($this->_items); + } + + public function next() + { + next($this->_items); + + return $this; + } + + public function rewind() + { + reset($this->_items); + + return $this; + } + + public function key() + { + return key($this->_items); + } + + public function valid() + { + return current($this->_items) !== false; + } + + public function getFirstItem() + { + if (!$this->_) + if (count($this->_items) > 0) { + return $this->_items[0]; + } + return null; + } + + public function getLastItem() + { + $size = count($this->_items); + if ($size > 0) { + return $this->_items[$size - 1]; + } + return null; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Controller/Action.php b/application/code/core/Wootook/Core/Controller/Action.php new file mode 100644 index 0000000..58aa8ec --- /dev/null +++ b/application/code/core/Wootook/Core/Controller/Action.php @@ -0,0 +1,50 @@ +_request; + } + + public function getResponse() + { + return $this->_response; + } + + protected function _forward($action, $controller = null, $module = null) + { + $request = $this->getRequest(); + + $request->setAction($action); + if ($controller !== null) { + $request->setController($controller); + if ($module != null) { + $request->setModule($module); + } + } + $request->setIsDispatched(false); + } + + protected function _redirect($url) + { + $this->getResponse()->setRedirect($url); + + return $this; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Controller/Request/Http.php b/application/code/core/Wootook/Core/Controller/Request/Http.php new file mode 100644 index 0000000..611294f --- /dev/null +++ b/application/code/core/Wootook/Core/Controller/Request/Http.php @@ -0,0 +1,102 @@ +setData($key, $value); + } + + public function getParam($key, $default = null) + { + if ($this->hasData($key)) { + return $this->getData($key); + } + if (isset($_POST[$key])) { + return $_POST[$key]; + } + if (isset($_GET[$key])) { + return $_GET[$key]; + } + if (isset($_FILES[$key])) { + return $_FILES[$key]; + } + if (isset($_COOKIE[$key])) { + return $_COOKIE[$key]; + } + if (isset($_SERVER[$key])) { + return $_SERVER[$key]; + } + return $default; + } + + public function getQuery($key, $default = null) + { + if (!isset($_GET[$key])) { + return $default; + } + return $_GET[$key]; + } + + public function getFile($key, $default = null) + { + if (!isset($_FILES[$key])) { + return $default; + } + return $_FILES[$key]; + } + + public function getCookie($key, $default = null) + { + if (!isset($_COOKIE[$key])) { + return $default; + } + return unserialize(stripslashes($_COOKIE[$key])); + } + + public function getRawCookie($key, $default = null) + { + if (!isset($_COOKIE[$key])) { + return $default; + } + return $_COOKIE[$key]; + } + + public function getPost($key, $default = null) + { + if (!isset($_POST[$key])) { + return $default; + } + return $_POST[$key]; + } + + public function getServer($key, $default = null) + { + if (!isset($_SERVER[$key])) { + return $default; + } + return $_SERVER[$key]; + } + + public function isPost() + { + if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') { + return true; + } + return false; + } + + public function isGet() + { + if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php b/application/code/core/Wootook/Core/Controller/Response/Http.php similarity index 79% rename from src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php rename to application/code/core/Wootook/Core/Controller/Response/Http.php index 3025249..2e4ffcd 100644 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Http.php +++ b/application/code/core/Wootook/Core/Controller/Response/Http.php @@ -1,10 +1,8 @@ 'Temporary Redirect' ); - protected $_returnCode = self::STATUS_OK; + public function __construct() + { + parent::__construct(array()); + } public function setBody($data) { @@ -45,9 +46,6 @@ class Wootook_Core_Mvc_Controller_Response_Http public function sendBody() { - if (!isset($this->_data['body']) || empty($this->_data['body'])) { - return ''; - } return implode('', $this->_data['body']); } @@ -83,7 +81,7 @@ class Wootook_Core_Mvc_Controller_Response_Http return $this; } - public function setRawHeader($value) + public function setRawHeader($name, $value) { if (!isset($this->_data['raw_headers']) || !is_array($this->_data['raw_headers'])) { $this->clearRawHeaders(); @@ -110,9 +108,22 @@ class Wootook_Core_Mvc_Controller_Response_Http return $this; } - public function isRedirect() + public function setIsRedirect($value = null) { - return $this->_returnCode >= 300 && $this->_returnCode < 400; + if (is_bool($value)) { + $this->_data['is_redirect'] = $value; + } + return $this->_data['is_redirect']; + } + + public function setIsDispatched($dispatched = true) + { + return $this->setData('id_dispatched', $dispatched); + } + + public function getIsDispatched() + { + return $this->getData('id_dispatched'); } public function setCookie($name, $value, $lifetime = null, $path = null, $domain = null) @@ -127,10 +138,7 @@ class Wootook_Core_Mvc_Controller_Response_Http public function setRawCookie($name, $value, $lifetime = null, $path = null, $domain = null) { - $date = new Wootook_Core_DateTime(); - $date->add($lifetime); - - setcookie($name, $value, $date->getTimestamp(), $path, $domain); + setcookie($name, $value, time() + $lifetime, $path, $domain); return $this; } @@ -140,22 +148,11 @@ class Wootook_Core_Mvc_Controller_Response_Http $code = self::REDIRECT_FOUND; } - $this->_returnCode = $code; - $statusText = self::$_redirectCodes[$code]; $this->setRawHeader("HTTP/1.1 {$code} {$statusText}") - ->setHeader('Location', $url); + ->setHeader('Location', $url) + ->setIsRedirect(true); return $this; } - - public function render($send = true) - { - if ($send) { - $this->sendHeaders(); - echo $this->sendBody(); - } else { - return $this->sendBody(); - } - } -} +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Email.php b/application/code/core/Wootook/Core/Email.php new file mode 100644 index 0000000..0dfcba4 --- /dev/null +++ b/application/code/core/Wootook/Core/Email.php @@ -0,0 +1,32 @@ +_prepareHeaders($headers); + } + + public function setHeader($name, $value) + { + $this->_headers[$name] = $value; + } + + protected function _prepareHeaders($headers) + { + foreach ($headers as $name => $value) { + $this->setHeader($name, $value); + } + + $this->addHeader('X-Mailer', 'PHP/' . PHP_VERSION . ' Wootook/' . VERSION); + $this->addHeader('Content-Transfer-Encoding', '7bit'); + $this->addHeader('Content-Type', 'text/plain; charset=utf-8'); + + return $this; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Entity.php b/application/code/core/Wootook/Core/Entity.php new file mode 100644 index 0000000..9c736ee --- /dev/null +++ b/application/code/core/Wootook/Core/Entity.php @@ -0,0 +1,153 @@ +_idFieldName = $fieldName; + + return $this; + } + + public function getIdFieldName() + { + return $this->_idFieldName; + } + + public function setTableName($tableName) + { + $this->_tableName = $tableName; + + return $this; + } + + public function getTableName() + { + return $this->_tableName; + } + + public function setId($id) + { + $this->setData($this->getIdFieldName(), $id); + + return $this; + } + + public function getId() + { + return $this->getData($this->getIdFieldName()); + } + + protected function _load() + { + $id = func_get_arg(0); + + $idFieldName = self::getIdFieldName(); + $database = Wootook_Database::getSingleton(); + + $sql =<<getTable(self::getTableName())} + WHERE {$idFieldName}=:id + LIMIT 1 +SQL_EOF; + $statement = $database->prepare($sql); + $statement->execute(array( + 'id' => $id + )); + + $datas = $statement->fetch(PDO::FETCH_ASSOC); + if (!is_array($datas) || empty($datas)) { + throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id could not be found.'); + } + unset($datas[self::getIdFieldName()]); + + $this->_data = $datas; + $this->setId($id); + + return $this; + } + + protected function _save() + { + if ($this->getId() !== null) { + $fields = array(); + $values = array(); + foreach ($this->getAllDatas() as $field => $value) { + if ($field == self::getIdFieldName()) { + continue; + } + $fields[] = "{$field}=:{$field}"; + $values[$field] = $value; + } + + $fieldsImploded = implode(', ', $fields); + $idFieldName = self::getIdFieldName(); + $values[$idFieldName] = $this->getId(); + + $database = Wootook_Database::getSingleton(); + $sql =<<getTable(self::getTableName())} + SET {$fieldsImploded} + WHERE {$idFieldName}=:{$idFieldName} +SQL_EOF; + $statement = $database->prepare($sql); + + $statement->execute($values); + } else { + $datas = $this->getAllDatas(); + $fieldsImploded = implode(', ', array_keys($datas)); + + $tokens = array(); + $values = array(); + foreach ($datas as $field => $value) { + if ($field == self::getIdFieldName()) { + continue; + } + $tokens[] = ":{$field}"; + $values[$field] = $value; + } + $tokensImploded = implode(', ', $tokens); + + $database = Wootook_Database::getSingleton(); + $sql =<<getTable(self::getTableName())} ($fieldsImploded) + VALUES ({$tokensImploded}) +SQL_EOF; + $statement = $database->prepare($sql); + + $statement->execute($values); + + $this->setId($database->lastInsertId()); + } + + return $this; + } + + protected function _delete() + { + $fields = array(); + foreach ($this->getAllDatas() as $field => $value) { + if ($field == self::getIdFieldName()) { + continue; + } + $fields[] = "{$field}=:{$field}"; + } + + $fieldsImploded = implod(', ', $fields); + $idFieldName = self::getIdFieldName(); + $database = Wootook_Database::getSingleton(); + $sql =<<getTable(self::getTableName())} + WHERE {$idFieldName}=:{$idFieldName} +SQL_EOF; + + $statement->execute($this->getAllDatas()); + + return $this; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Mvc/Model/Entity/SubTable.php b/application/code/core/Wootook/Core/Entity/SubTable.php similarity index 75% rename from src/application/code/core/Wootook/Core/Mvc/Model/Entity/SubTable.php rename to application/code/core/Wootook/Core/Entity/SubTable.php index 791d481..470b89c 100644 --- a/src/application/code/core/Wootook/Core/Mvc/Model/Entity/SubTable.php +++ b/application/code/core/Wootook/Core/Entity/SubTable.php @@ -4,12 +4,13 @@ * * @uses Wootook_Object * @uses Legacies_Empire - * @uses Wootook_Player_Model_Entity + * @uses Wootook_Empire_Model_User */ -abstract class Wootook_Core_Mvc_Model_Entity_SubTable - extends Wootook_Core_Database_Resource +abstract class Wootook_Core_Entity_SubTable + extends Wootook_Core_Model { private $_isLoaded = false; + protected $_tableName = null; protected $_idFieldNames = array(); protected $_eventPrefix = 'entity.sub-table'; @@ -31,7 +32,7 @@ abstract class Wootook_Core_Mvc_Model_Entity_SubTable $idFields = '(' . implode(') AND (', $idFields) . ')'; $fields = implode(', ', $fields); - $database = $this->getWriteConnection(); + $database = Wootook_Database::getSingleton(); $sql =<<getTable(self::getTableName())} SET {$fields} @@ -50,7 +51,7 @@ SQL_EOF; } $tokens = implode(', ', $tokens); - $database = $this->getWriteConnection(); + $database = Wootook_Database::getSingleton(); $sql =<<getTable(self::getTableName())} ($fields) VALUES ({$tokens}) @@ -65,18 +66,20 @@ SQL_EOF; protected function _load() { $idValues = func_get_arg(0); - $database = $this->getReadConnection(); - - $select = $database->select() - ->from(array('main_table' => $database->getTable($this->getTableName()))) - ->limit(1); + $database = Wootook_Database::getSingleton(); $idFields = array(); foreach ($this->_idFieldNames as $field) { - $select->where("{$database->quoteIdentifier($field)}=:{$field}"); + $idFields[] = "{$field}=:{$field}"; } + $idFields = '(' . implode(') AND (', $idFields) . ')'; - $statement = $database->prepare($select); + $sql =<<getTable(self::getTableName())} + WHERE $idFields + LIMIT 1 +SQL_EOF; + $statement = $database->prepare($sql); $statement->execute($idValues); $datas = $statement->fetch(PDO::FETCH_ASSOC); @@ -84,9 +87,7 @@ SQL_EOF; throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id combination could not be found.'); } - $this->_data = array(); - $this->getDataMapper()->decode($this, $datas); - + $this->_data = $datas; $this->_isLoaded = true; return $this; @@ -94,7 +95,7 @@ SQL_EOF; protected function _delete() { - $database = $this->getWriteConnection(); + $database = Wootook_Database::getSingleton(); $idFields = array(); $idValues = array(); @@ -117,4 +118,16 @@ SQL_EOF; return $this; } -} + + public function setTableName($tableName) + { + $this->_tableName = $tableName; + + return $this; + } + + public function getTableName() + { + return $this->_tableName; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/EntityInterface.php b/application/code/core/Wootook/Core/EntityInterface.php new file mode 100644 index 0000000..9843e61 --- /dev/null +++ b/application/code/core/Wootook/Core/EntityInterface.php @@ -0,0 +1,13 @@ +_errors[] = array( + 'time' => explode(' ', microtime()), + 'code' => $errno, + 'message' => $errstr, + 'file' => $errfile, + 'line' => $errline, + 'context' => $errcontext + ); + break; + + case E_USER_WARNING: + case E_WARNING: + $this->_warnings[] = array( + 'time' => explode(' ', microtime()), + 'code' => $errno, + 'message' => $errstr, + 'file' => $errfile, + 'line' => $errline, + 'context' => $errcontext + ); + break; + + case E_USER_NOTICE: + case E_NOTICE: + $this->_notices[] = array( + 'time' => explode(' ', microtime()), + 'code' => $errno, + 'message' => $errstr, + 'file' => $errfile, + 'line' => $errline, + 'context' => $errcontext + ); + break; + + default: + if (!isset($this->_otherErrors[$errno])) { + $this->_otherErrors[$errno] = array(); + } + + $this->_otherErrors[$errno][] = array( + 'time' => explode(' ', microtime()), + 'code' => $errno, + 'message' => $errstr, + 'file' => $errfile, + 'line' => $errline, + 'context' => $errcontext + ); + break; + } + + return true; + } + + public function exceptionManager($exception) + { + if (!self::$_listen) { + return; + } + $this->_exceptions[] = $exception; + } + + protected function _renderError($id, $error) + { + $types = array( + 0x0001 => 'E_ERROR', + 0x0002 => 'E_WARNING', + 0x0004 => 'E_PARSE', + 0x0008 => 'E_NOTICE', + 0x0010 => 'E_CORE_ERROR', + 0x0020 => 'E_CORE_WARNING', + 0x0040 => 'E_COMPILE_ERROR', + 0x0080 => 'E_COMPILE_WARNING', + 0x0100 => 'E_USER_ERROR', + 0x0200 => 'E_USER_WARNING', + 0x0400 => 'E_USER_NOTICE', + 0x0800 => 'E_STRICT', + 0x1000 => 'E_RECOVERABLE_ERROR', + 0x2000 => 'E_DEPRECATED', + 0x4000 => 'E_USER_DEPRECATED', + ); + + if (isset($error['code']) && isset($types[$error['code']])) { + $code = $types[$error['code']]; + } else { + $code = "Unknown ({$error['code']})"; + } + + $date = date('Y-m-d H:i:s', (int) $error['time'][1]); + $microsec = (int) ($error['time'][0] * 1000000); + + return <<'; + echo '

Debug profiler

'; + if (count($this->_errors) <= 0 && count($this->_warnings) <= 0 && + count($this->_notices) <= 0 && count($this->_otherErrors) <= 0 && + count($this->_exceptions) <= 0) { + echo '

Profiler was empty.

'; + } else { + echo '
';
+            foreach ($this->_errors as $error) {
+                echo $this->_renderError(++$index, $error);
+            }
+            foreach ($this->_warnings as $error) {
+                echo $this->_renderError(++$index, $error);
+            }
+            foreach ($this->_notices as $error) {
+                echo $this->_renderError(++$index, $error);
+            }
+            foreach ($this->_otherErrors as $errorList) {
+                foreach ($errorList as $error) {
+                    echo $this->_renderError(++$index, $error);
+                }
+            }
+            foreach ($this->_exceptions as $exception) {
+                $index++;
+                echo "Message #{$index}". PHP_EOL;
+                echo $exception->getMessage() . PHP_EOL;
+                echo $exception->getTraceAsString();
+            }
+            echo '
'; + } + echo ''; + } + + public static function register() + { + set_error_handler(array(self::getSingleton(), 'errorManager')); + set_exception_handler(array(self::getSingleton(), 'exceptionManager')); + + if (self::$_isTraceRegistered === false && defined('DEBUG')) { + self::$_isTraceRegistered = true; + register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); + } + } + + public static function unregister($force = false) + { + restore_error_handler(); + restore_exception_handler(); + + if ((self::$_isTraceRegistered && defined('DEBUG')) || $force) { + self::$_isTraceRegistered = false; + register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); + } + } + + public static function sleep() + { + self::$_listen = false; + } + + public static function wakeup() + { + self::$_listen = true; + } +} diff --git a/application/code/core/Wootook/Core/Event.php b/application/code/core/Wootook/Core/Event.php new file mode 100644 index 0000000..42d5c92 --- /dev/null +++ b/application/code/core/Wootook/Core/Event.php @@ -0,0 +1,6 @@ + - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * Page layout class utility. - * Builds page structures from flexible layout declaration files, written in a - * user-friendly XML format. - * - * @author Greg - * @since 1.5.0 - * @package Wootook - * @subpackage Wootook_Core - * @category layout - */ -class Wootook_Core_Model_Layout - extends Wootook_Core_Mvc_Model_Model +class Wootook_Core_Layout + extends Wootook_Core_Model { const DEFAULT_PACKAGE = 'base'; const DEFAULT_THEME = 'default'; - const DOMAIN_FRONTEND = 'frontend'; - const DOMAIN_BACKEND = 'backend'; - - /** @var array */ protected $_blocks = array(); - /** @var Wootook_Core_Mvc_View_View */ - protected $_messageBlock = null; - - /** @var Wootook_Core_Mvc_View_View */ - protected $_rootView = null; - - /** @var string */ + protected $_view = null; protected $_eventPrefix = 'layout'; - - /** @var string */ protected $_eventObject = 'layout'; - /** @var string */ - protected $_domain = self::DOMAIN_FRONTEND; - - /** @var string */ protected $_package = self::DEFAULT_PACKAGE; - - /** @var string */ protected $_theme = self::DEFAULT_THEME; - /** @var array */ protected $_namespaces = array( 'core' => array( - 'Wootook_Core_Block_' => 'Wootook/Core/Block' + 'Wootook_Core_Block_' => 'Wootook/core/Block' ) ); - /** - * Page layout class utility. - * - * @param string $domain - * @param string $package - * @param string $theme - * @param array $data - */ - public function __construct($domain = null, $package = null, $theme = null, Array $data = array()) - { - if ($domain === null) { - if (Wootook::getDefaultWebsite()->getId() == 0) { - $this->_domain = self::DOMAIN_BACKEND; - } else { - $this->_domain = self::DOMAIN_FRONTEND; - } - } else { - $this->_domain = $domain; - } - if ($package !== null) { - $this->setPackage($package); - } - if ($theme !== null) { - $this->setTheme($theme); - } - - parent::__construct($data); - } - public function _init() { - $modules = Wootook_Core_Helper_Config_Modules::getSingleton(); + $modules = Wootook_Core_Model_Config_Modules::getSingleton(); foreach ($modules['block'] as $module => $moduleNamespaces) { foreach ($moduleNamespaces as $namespace => $path) { @@ -118,74 +31,35 @@ class Wootook_Core_Model_Layout } } - $fileList = Wootook::getGameConfig('layout'); - if ($fileList instanceof Wootook_Core_Config_Node) { - $fileList = $fileList->toArray(); + $config = include ROOT_PATH . 'config.php'; + $fileList = array(); + if (isset($config['global'])) { + if (isset($config['global']['layout'])) { + $fileList = $config['global']['layout']; + } + if (isset($config['global']['package'])) { + $this->setPackage($config['global']['package']); + } + if (isset($config['global']['theme'])) { + $this->setTheme($config['global']['theme']); + } } - if (!is_array($fileList) || empty($fileList)) { - $fileList = array(); - } - $this->_data = array(); - $this->setPackage(Wootook::getWebsiteConfig('package')); - $this->setTheme(Wootook::getGameConfig('theme')); - - $parser = new Wootook_Core_Model_Layout_Parser(); foreach ($fileList as $layoutFile) { - try { - if (preg_match('#\.php$#', $layoutFile)) { - $layoutData = include $this->_getLayoutPath($layoutFile); - } else { - $layoutData = $parser->parse($this->_getLayoutPath($layoutFile), $this->_getLayoutCachePath($layoutFile), 3600); - } - } catch (Wootook_Core_Exception_LayoutException $e) { - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - continue; - } - - if (!is_array($layoutData)) { - continue; - } - - foreach ($layoutData as $layoutId => $layoutConfig) { + foreach (include $this->_getLayoutPath($layoutFile) as $layoutId => $layoutConfig) { if ($this->hasData($layoutId)) { $declared = $this->getData($layoutId); - if (isset($declared['block']) && !isset($layoutConfig['block'])) { - $layoutConfig['block'] = $declared['block']; - } - - if (isset($declared['reference'])) { - if (isset($layoutConfig['reference'])) { - $layoutConfig['reference'] = array_merge($declared['reference'], $layoutConfig['reference']); - } else { - $layoutConfig['reference'] = $declared['reference']; - } - } + $layoutConfig = array_merge($declared, $layoutConfig); } $this->setData($layoutId, $layoutConfig); } } - $this->_messageBlock = $this->createBlock('core/messages', 'messages'); - return $this; } - protected function _getAllParents(&$layoutConfigs, $currentHandle) - { - foreach ($currentHandle as $parent) { - $currentLayout = $this->getData($parent); - $layoutConfigs[] = $currentLayout; - - if (!isset($currentLayout['update'])) { - continue; - } - $this->_getAllParents($layoutConfigs, $currentLayout['update']); - } - } - protected function _load() { $layoutId = func_get_arg(0); @@ -196,15 +70,22 @@ class Wootook_Core_Model_Layout $layoutConfigs = array($this->getData($layoutId)); if (isset($layoutConfigs[0]['update'])) { - $this->_getAllParents($layoutConfigs, $layoutConfigs[0]['update']); + $parent = $layoutConfigs[0]['update']; + + $i = 0; + while (true) { + $layoutConfigs[++$i] = $this->getData($parent); + + if (!isset($layoutConfigs[$i]['update'])) { + break; + } + $parent = $layoutConfigs[$i]['update']; + } } $layoutUpdates = array(); $layoutConfig = array(); foreach (array_reverse($layoutConfigs) as $config) { - if (!is_array($config)) { - continue; - } $layoutConfig = array_merge($layoutConfig, $config); if (isset($layoutConfig['reference'])) { @@ -223,8 +104,8 @@ class Wootook_Core_Model_Layout $type = $layoutConfig['type']; $name = isset($layoutConfig['name']) ? $layoutConfig['name'] : 'root'; - $this->_rootView = $this->_createBlock($type, $name, $layoutConfig); - } else if (!isset($this->_rootView)) { + $this->_view = $this->_createBlock($type, $name, $layoutConfig); + } else if (!isset($this->_view)) { return $this; } @@ -273,12 +154,10 @@ class Wootook_Core_Model_Layout protected function _save() { - throw new Wootook_Core_Exception_LayoutException('Save not permitted for the layout manager.'); } protected function _delete() { - throw new Wootook_Core_Exception_LayoutException('Delete not permitted for the layout manager.'); } protected function _resolveBlockClassType($type) @@ -303,12 +182,12 @@ class Wootook_Core_Model_Layout $className = $namespace . $block; $fileName = $path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $block) . '.php'; - Wootook_Core_ErrorProfiler::getSingleton()->sleep(); + Wootook_Core_ErrorProfiler::sleep(); if (!($fp = @fopen($fileName, 'r', true))) { - Wootook_Core_ErrorProfiler::getSingleton()->wakeup(); + Wootook_Core_ErrorProfiler::wakeup(); continue; } - Wootook_Core_ErrorProfiler::getSingleton()->wakeup(); + Wootook_Core_ErrorProfiler::wakeup(); fclose($fp); if (!class_exists($className, true)) { @@ -319,20 +198,10 @@ class Wootook_Core_Model_Layout } } - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_LayoutException(sprintf('Class type "%s" could not be resolved.', $type))); + trigger_error(Wootook::__('Class type "%s" could not be resolved.', $type), E_USER_NOTICE); return null; } - /** - * Register a new block namespage for use in the layout declaration files - * - * @since 1.5.0 - * @param string $module - * @param string $namespace - * @param string|null $path - * @return Wootook_Core_Model_Layout - */ public function registerBlockNamespace($module, $namespace, $path = null) { if ($path === null) { @@ -346,14 +215,6 @@ class Wootook_Core_Model_Layout return $this; } - /** - * Unregister a previously declared block namespace - * - * @since 1.5.0 - * @param string $module - * @param string $namespace - * @return Wootook_Core_Model_Layout - */ public function unregisterBlockNamespace($module, $namespace) { if (isset($this->_namespaces[$module]) && isset($this->_namespaces[$module][$namespace])) { @@ -363,14 +224,6 @@ class Wootook_Core_Model_Layout return $this; } - /** - * Create a new block instance - * - * @param string $type - * @param string $name - * @param array $config - * @return Wootook_Core_Mvc_View_View - */ public function createBlock($type, $name, $config = array()) { $instance = $this->_createBlock($type, $name, $config); @@ -419,7 +272,7 @@ class Wootook_Core_Model_Layout } if (!isset($config['type'])) { - $instance->$alias = new Wootook_Core_Mvc_View_View($config); + $instance->$alias = new Wootook_Core_View($config); } else { $child = $this->_createBlock($config['type'], $name, $config); if ($child !== null) { @@ -428,8 +281,7 @@ class Wootook_Core_Model_Layout } } } catch (ReflectionException $e) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException($e); + trigger_error($e->getMessage(), E_USER_NOTICE); return null; } @@ -458,7 +310,7 @@ class Wootook_Core_Model_Layout $requiredParameterCount = $reflectionMethod->getNumberOfRequiredParameters(); $callParamaters = array(); foreach ($reflectionMethod->getParameters() as $parameter) { - $paramterName = strtolower(preg_replace('#([A-Z])#', '-\\1', $parameter->getName())); + $paramterName = $parameter->getName(); $paramterPosition = $parameter->getPosition(); if (isset($params[$paramterName])) { @@ -467,55 +319,24 @@ class Wootook_Core_Model_Layout $callParamaters[$paramterPosition] = $parameter->getDefaultValue(); //} else if (!$parameter->isOptionnal()) { } else if ($paramterPosition <= $requiredParameterCount) { - throw new Wootook_Core_Exception_LayoutException(Wootook::__('Method %s requires parameter %d ($%s) to be defined.', + throw new Wootook_Core_Exception_RuntimeException(Wootook::__('Method %s requires parameter %d ($%s) to be defined.', $reflectionMethod->getName(), $paramterPosition + 1, $paramterName)); } } $reflectionMethod->invokeArgs($block, $callParamaters); } catch (ReflectionException $e) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException($e); + trigger_error($e->getMessage(), E_USER_NOTICE); continue; } catch (RuntimeException $e) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException($e); + trigger_error($e->getMessage(), E_USER_WARNING); continue; } } } - /** - * Get the current Layout domain (frontend or backend) - * - * @since 1.5.0 - * @return string - */ - public function getDomain() - { - return $this->_domain; - } - - /** - * Set the current Layout domain (frontend or backend) - * - * @since 1.5.0 - * @param string $domain - * @return Wootook_Core_Model_Layout - */ - public function setDomain($domain) - { - $this->_domain = $domain; - $this->_init(); - - return $this; - } - public function getPackage() { - if ($this->_package === null) { - $this->_package = self::DEFAULT_PACKAGE; - } return $this->_package; } @@ -528,9 +349,6 @@ class Wootook_Core_Model_Layout public function getTheme() { - if ($this->_theme === null) { - $this->_theme = self::DEFAULT_THEME; - } return $this->_theme; } @@ -543,12 +361,7 @@ class Wootook_Core_Model_Layout public function getScriptPath() { - return Wootook::getBasePath('design') . DIRECTORY_SEPARATOR . $this->getDomain(); - } - - public function getAllBlocks() - { - return $this->_blocks; + return APPLICATION_PATH . DIRECTORY_SEPARATOR . 'design'; } public function getBlock($code) @@ -561,10 +374,6 @@ class Wootook_Core_Model_Layout public function render() { - if (!$this->_rootView instanceof Wootook_Core_Mvc_View_View) { - throw new Wootook_Core_Exception_LayoutException(Wootook::__('No root view declared.')); - } - $scriptPath = $this->getScriptPath(); foreach ($this->_blocks as $block) { if ($block instanceof Wootook_Core_Block_Template) { @@ -574,23 +383,7 @@ class Wootook_Core_Model_Layout } unset($block); - return $this->_rootView->render(); - } - - protected function _getLayoutCachePath($file) - { - $package = $this->getPackage(); - $theme = $this->getTheme(); - $pattern = APPLICATION_PATH . "cache/" . __CLASS__ . "--{$this->getDomain()}-%s-%s-{$file}.cache"; - - if (empty($package)) { - $package = self::DEFAULT_PACKAGE; - } - if (empty($theme)) { - $theme = self::DEFAULT_THEME; - } - - return sprintf($pattern, $package, $theme); + return $this->_view->render(); } protected function _getLayoutPath($file) @@ -599,18 +392,14 @@ class Wootook_Core_Model_Layout $theme = $this->getTheme(); $pattern = "{$this->getScriptPath()}/%s/%s/layouts/{$file}"; - if ($package !== null && $theme !== null) { - $path = sprintf($pattern, $package, $theme); - if (Wootook::fileExists($path)) { - return $path; - } + $path = sprintf($pattern, $package, $theme); + if (Wootook::fileExists($path)) { + return $path; } - if ($package !== null) { - $path = sprintf($pattern, $package, self::DEFAULT_THEME); - if (Wootook::fileExists($path)) { - return $path; - } + $path = sprintf($pattern, $package, self::DEFAULT_THEME); + if (Wootook::fileExists($path)) { + return $path; } $path = sprintf($pattern, self::DEFAULT_PACKAGE, self::DEFAULT_THEME); @@ -618,15 +407,8 @@ class Wootook_Core_Model_Layout return $path; } - throw new Wootook_Core_Exception_LayoutException(sprintf("Layout file '%s' does not exist.", $file)); - } + trigger_error(Legacies::__("Layout file '%s' does not exist.", $file), E_USER_NOTICE); - /** - * - * @return Wootook_Core_Block_Messages - */ - public function getMessagesBlock() - { - return $this->_messageBlock; + return null; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Mvc/Model/Model.php b/application/code/core/Wootook/Core/Model.php similarity index 71% rename from src/application/code/core/Wootook/Core/Mvc/Model/Model.php rename to application/code/core/Wootook/Core/Model.php index e91265f..087f511 100644 --- a/src/application/code/core/Wootook/Core/Mvc/Model/Model.php +++ b/application/code/core/Wootook/Core/Model.php @@ -1,40 +1,6 @@ - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * - * Enter description here ... - * @author Greg - * - */ -abstract class Wootook_Core_Mvc_Model_Model +abstract class Wootook_Core_Model extends Wootook_Object { protected $_originalData = array(); @@ -47,27 +13,14 @@ abstract class Wootook_Core_Mvc_Model_Model $this->_data = $data; $this->_init(); - $this->_setOriginalData(); + $this->_setOriginalData($this->_data); } abstract protected function _init(); - protected function _setOriginalData() + protected function _setOriginalData(Array $data) { - $this->_originalData = $this->_data; - } - - public function getChangedDatas() - { - return array_diff_assoc($this->_data, $this->_originalData); - } - - public function hasChangedDatas() - { - if (count($this->getChangedDatas()) > 0) { - return true; - } - return false; + $this->_originalData = $data; } final public function save() @@ -117,7 +70,7 @@ abstract class Wootook_Core_Mvc_Model_Model call_user_func_array(array($this, '_afterLoad'), $params); $this->_setOriginalData($this->_data); } catch (PDOException $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not load data: ' . $e->getMessage(), 0, $e); + throw new Wootook_Core_Exception_DataAccessException('Could not load data: ' . $e->getMessage(), 0); } return $this; } @@ -202,4 +155,4 @@ abstract class Wootook_Core_Mvc_Model_Model { return $this->hasData($key); } -} +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Model/Config.php b/application/code/core/Wootook/Core/Model/Config.php new file mode 100644 index 0000000..26dda47 --- /dev/null +++ b/application/code/core/Wootook/Core/Model/Config.php @@ -0,0 +1,88 @@ +load(); + } + + protected function _load() + { + $database = Wootook_Database::getSingleton(); + + $sql =<<getTable('config')} AS config +SQL_EOF; + + $attributeName = null; + $attributeValue = null; + + $statement = $database->prepare($sql); + $statement->execute(); + + $statement->bindColumn('attribute', $attributeName, PDO::PARAM_STR); + $statement->bindColumn('value', $attributeValue, PDO::PARAM_STR); + + while ($statement->fetch(PDO::FETCH_BOUND)) { + $this->setData($attributeName, $attributeValue); + } + return $this; + } + + protected function _save() + { + $database = Wootook_Database::getSingleton(); + $fields = array(); + + $sql =<<prepare($sql); + + foreach ($this->getAllDatas() as $attributeName => $attributeValue) { + $statement->execute(array( + 'name' => $attributeName, + 'value' => $attributeValue + )); + } + + return $this; + } + + protected function _delete() + { + // NOP + return $this; + } + + public function isEnabled() + { + return (bool) $this->getData('game_disable'); + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Helper/Config/ConfigHandler.php b/application/code/core/Wootook/Core/Model/Config/Abstract.php similarity index 69% rename from src/application/code/core/Wootook/Core/Helper/Config/ConfigHandler.php rename to application/code/core/Wootook/Core/Model/Config/Abstract.php index 7421bad..ebebf65 100644 --- a/src/application/code/core/Wootook/Core/Helper/Config/ConfigHandler.php +++ b/application/code/core/Wootook/Core/Model/Config/Abstract.php @@ -1,21 +1,12 @@ 'default', - 'episode' => 'default' - ); - } else { - $config = $config->toArray(); - } + $config = Wootook::getConfig('global/storyline'); $path = 'gamedata' . DIRECTORY_SEPARATOR . $config['universe'] . DIRECTORY_SEPARATOR . $config['episode'] . DIRECTORY_SEPARATOR . $filename . '.php'; @@ -56,4 +47,4 @@ abstract class Wootook_Core_Helper_Config_ConfigHandler { reset($this->_data); } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Helper/Config/Events.php b/application/code/core/Wootook/Core/Model/Config/Events.php similarity index 91% rename from src/application/code/core/Wootook/Core/Helper/Config/Events.php rename to application/code/core/Wootook/Core/Model/Config/Events.php index 30b0528..1ab794b 100644 --- a/src/application/code/core/Wootook/Core/Helper/Config/Events.php +++ b/application/code/core/Wootook/Core/Model/Config/Events.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Core_Helper_Config_Events - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Core_Model_Config_Events + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Core/Helper/Config/Modules.php b/application/code/core/Wootook/Core/Model/Config/Modules.php similarity index 88% rename from src/application/code/core/Wootook/Core/Helper/Config/Modules.php rename to application/code/core/Wootook/Core/Model/Config/Modules.php index 17d1a46..8ad43f6 100644 --- a/src/application/code/core/Wootook/Core/Helper/Config/Modules.php +++ b/application/code/core/Wootook/Core/Model/Config/Modules.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Core_Helper_Config_Modules - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Core_Model_Config_Modules + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Core/Model/Image/Png.php b/application/code/core/Wootook/Core/Model/Image/Png.php similarity index 100% rename from src/application/code/core/Wootook/Core/Model/Image/Png.php rename to application/code/core/Wootook/Core/Model/Image/Png.php diff --git a/application/code/core/Wootook/Core/Model/Session.php b/application/code/core/Wootook/Core/Model/Session.php new file mode 100644 index 0000000..5199542 --- /dev/null +++ b/application/code/core/Wootook/Core/Model/Session.php @@ -0,0 +1,145 @@ +getConstants()); + } + + self::$_instances[$namespace] = new self($namespace); + } + return self::$_instances[$namespace]; + } + + public static function destroy() + { + session_destroy(); + } + + public function __construct($namespace) + { + if (session_id() == '') { + session_start(); + } + + if (!isset($_SESSION[$namespace])) { + $_SESSION[$namespace] = array(); + } + + $this->_data = &$_SESSION[$namespace]; + $this->_data['messages'] = array(); + } + + public function getMessages($clear = true) + { + $messages = $this->_data['messages']; + if ($clear == true) { + $this->_data['messages'] = array(); + } + return $messages; + } + + public function addMessage($message, $type = self::DEBUG) + { + if (!isset(self::$_levels[$type])) { + $type = self::DEBUG; + } + + if (!isset($this->_data['messages'])) { + $this->_data['messages'] = array(); + } + if (!isset($this->_data['messages'][self::$_levels[$type]])) { + $this->_data['messages'][self::$_levels[$type]] = array(); + } + $this->_data['messages'][self::$_levels[$type]][] = $message; + + return $this; + } + + public function addCritical($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::CRIT); + } + + public function addError($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::ERROR); + } + + public function addWarning($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::WARN); + } + + public function addSuccess($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::SUCCESS); + } + + public function addInfo($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::INFO); + } + + public function addDebug($message, $_ = null) + { + $args = func_get_args(); + array_shift($args); + + return $this->addMessage(vsprintf($message, $args), self::DEBUG); + } + + public function getFormKey($reset = false) + { + if (!$this->getData('form_key')) { + $this->setData('form_key', uniqid()); + return $this->getData('form_key'); + } + + $key = $this->getData('form_key'); + if ($reset == true) { + $this->setData('form_key', uniqid()); + } + + return $key; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Model/Translator.php b/application/code/core/Wootook/Core/Model/Translator.php similarity index 100% rename from src/application/code/core/Wootook/Core/Model/Translator.php rename to application/code/core/Wootook/Core/Model/Translator.php diff --git a/src/application/code/core/Wootook/Core/PluginLoader/PluginLoader.php b/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php similarity index 64% rename from src/application/code/core/Wootook/Core/PluginLoader/PluginLoader.php rename to application/code/core/Wootook/Core/Plugin/LoaderAbstract.php index eaaff7a..211f572 100644 --- a/src/application/code/core/Wootook/Core/PluginLoader/PluginLoader.php +++ b/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php @@ -1,25 +1,21 @@ _pluginInstances[$pluginName])) { return $this->_pluginInstances[$pluginName]; } - $pluginName = str_replace(' ', '_', ucwords(str_replace('.', ' ', $pluginName))); - $pluginName = str_replace(' ', '', ucwords(str_replace('-', ' ', $pluginName))); - foreach ($this->_namespaces as $namespace => $path) { - $className = $namespace . $pluginName; - $fileName = $path . DIRECTORY_SEPARATOR . - str_replace('_', DIRECTORY_SEPARATOR, $pluginName) . '.php'; + $className = $namespace . ucfirst($pluginName); + $fileName = $path . DIRECTORY_SEPARATOR . ucfirst($pluginName) . '.php'; - if (!Wootook::fileExists($fileName)) { + if (!file_exists($fileName)) { continue; } @@ -27,10 +23,10 @@ abstract class Wootook_Core_PluginLoader_PluginLoader continue; } - return $this->_load($className, $useSingleton, $constructorParams); + return $this->_load($className, $useSingleton); } - return null; + return $this; } public function registerNamespace($namespace, $path = null) @@ -52,7 +48,7 @@ abstract class Wootook_Core_PluginLoader_PluginLoader return $this; } - abstract protected function _load($className, $useSingleton, Array $constructorParams = array()); + abstract protected function _load($className); public function getPlugin($pluginName) { diff --git a/src/application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php b/application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php similarity index 89% rename from src/application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php rename to application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php index e0ce1d5..ff6e309 100644 --- a/src/application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php +++ b/application/code/core/Wootook/Core/Setup/Updater/ScriptQueue.php @@ -1,6 +1,6 @@ install|upgrade|uninstall|downgrade)-(?[0-9]+\.[0-9]+\.[0-9]+)(?:\.(?[a-z]+)(?[0-9]+))?(?:-(?[0-9]+\.[0-9]+\.[0-9]+)(?:\.(?[a-z]+)(?[0-9]+))?)?$%'; @@ -36,35 +36,27 @@ class Wootook_Core_Setup_Updater_ScriptQueue } if ($fromVersion === null) { - $fromVersion = array( - 'version' => self::VERSION_NULL, - 'stage' => self::STAGE_STABLE, - 'level' => 0, - ); - } else { - preg_match(self::PCRE_VERSION_PATTERN, $fromVersion, $matches); - $fromVersion = array( - 'version' => isset($matches['version']) ? $matches['version'] : self::VERSION_NULL, - 'stage' => isset($matches['stage']) && !empty($matches['stage']) ? $matches['stage'] : self::STAGE_STABLE, - 'level' => isset($matches['level']) && !empty($matches['level']) ? (int) $matches['level'] : 0, - ); + $fromVersion = '0.0.0'; } if ($toVersion === null) { - $toVersion = array( - 'version' => self::VERSION_NULL, - 'stage' => self::STAGE_STABLE, - 'level' => 0, - ); - } else { - preg_match(self::PCRE_VERSION_PATTERN, $toVersion, $matches); - $toVersion = array( - 'version' => isset($matches['version']) ? $matches['version'] : self::VERSION_NULL, - 'stage' => isset($matches['stage']) && !empty($matches['stage']) ? $matches['stage'] : self::STAGE_STABLE, - 'level' => isset($matches['level']) && !empty($matches['level']) ? (int) $matches['level'] : 0, - ); + $toVersion = '0.0.0'; } + preg_match(self::PCRE_VERSION_PATTERN, $fromVersion, $matches); + $fromVersion = array( + 'version' => isset($matches['version']) ? $matches['version'] : self::VERSION_NULL, + 'stage' => isset($matches['stage']) && !empty($matches['stage']) ? $matches['stage'] : self::STAGE_STABLE, + 'level' => isset($matches['level']) && !empty($matches['level']) ? (int) $matches['level'] : 0, + ); + + preg_match(self::PCRE_VERSION_PATTERN, $toVersion, $matches); + $toVersion = array( + 'version' => isset($matches['version']) ? $matches['version'] : self::VERSION_NULL, + 'stage' => isset($matches['stage']) && !empty($matches['stage']) ? $matches['stage'] : self::STAGE_STABLE, + 'level' => isset($matches['level']) && !empty($matches['level']) ? (int) $matches['level'] : 0, + ); + switch (version_compare($toVersion['version'], $fromVersion['version'])) { case 1: $this->_upgradeToVersion($fromVersion, $toVersion); @@ -118,7 +110,7 @@ class Wootook_Core_Setup_Updater_ScriptQueue $this->_upgradeToVersion($fromVersion, $toVersion); } } else { - throw new Wootook_Core_Setup_Exception_VersionStageError("Invalid version stage."); + throw new Wootook_Core_Exception_RuntimeException("Invalid version stage."); } break; } @@ -131,13 +123,6 @@ class Wootook_Core_Setup_Updater_ScriptQueue return $this->_finalVersion; } - public function getCurrentVersion() - { - $current = $this->current(); - - return $current['version']; - } - protected function _installHighestInstaller($currentVersion, $toVersion) { $highestVersion = self::VERSION_NULL; @@ -158,16 +143,14 @@ class Wootook_Core_Setup_Updater_ScriptQueue return $version; } - if (isset($this->_installVersions[$highestVersion][self::STAGE_STABLE])) { - $stage = self::STAGE_STABLE; - } else if (isset($this->_installVersions[$highestVersion][self::STAGE_RC])) { + if (isset($this->_installVersions[$highestVersion][self::STAGE_RC])) { $stage = self::STAGE_RC; } else if (isset($this->_installVersions[$highestVersion][self::STAGE_BETA])) { $stage = self::STAGE_BETA; } else if (isset($this->_installVersions[$highestVersion][self::STAGE_ALPHA])) { $stage = self::STAGE_ALPHA; } else { - throw new Wootook_Core_Setup_Exception_VersionStageError("Invalid version stage."); + throw new Wootook_Core_Exception_RuntimeException("Invalid version stage."); } $levelList = array_keys($this->_installVersions[$highestVersion][$stage]); @@ -249,7 +232,7 @@ class Wootook_Core_Setup_Updater_ScriptQueue $level = max(array_keys($versionPointer[$highestVersion][$stage])); } else { - throw new Wootook_Core_Setup_Exception_VersionValueError("Invalid version value."); + throw new Wootook_Core_Exception_RuntimeException("Invalid version value."); } $currentVersion = array( diff --git a/application/code/core/Wootook/Core/Singleton.php b/application/code/core/Wootook/Core/Singleton.php new file mode 100644 index 0000000..be1d3dc --- /dev/null +++ b/application/code/core/Wootook/Core/Singleton.php @@ -0,0 +1,6 @@ + - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * - * Enter description here ... - * @author Greg - * - */ -class Wootook_Core_Mvc_View_View +class Wootook_Core_View extends Wootook_Object { protected $_template = null; @@ -90,27 +56,11 @@ class Wootook_Core_Mvc_View_View } } - public function renderDateTime($dateTime, $format = null) - { - if ($format === null) { - $format = 'H:i:s'; - } - if (!$dateTime instanceof Wootook_Core_DateTime) { - $dateTime = new Wootook_Core_DateTime($dateTime); - } - return $dateTime->toString($format); - } - - public function escape($unescaped) + protected function escape($unescaped) { return htmlspecialchars($unescaped, ENT_QUOTES, 'UTF-8'); } - public function escapeJs($unescaped) - { - return addslashes($unescaped); - } - public function __($message, $_ = null) { $args = func_get_args(); @@ -143,14 +93,6 @@ class Wootook_Core_Mvc_View_View return ''; } - public function renderPartial($blockName) - { - if (($block = $this->getPartial($blockName)) !== null) { - return $block->render(); - } - return null; - } - protected function _getTemplatePath($file) { return $this->getScriptPath() . DIRECTORY_SEPARATOR . $file; @@ -182,58 +124,25 @@ class Wootook_Core_Mvc_View_View return Wootook::getUrl($uri, $params); } - public function getStaticUrl($uri, Array $params = array()) + public function getSkinUrl($uri, Array $params = array()) { - return Wootook::getStaticUrl($uri, $params); - } - - public function getSkinUrl($uri, Array $params = array(), $theme = null, $package = null) - { - if (Wootook::$isInstalled) { - $player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - if ($player !== null && $player->getId()) { - $theme = $player->getSkinPath(); - } + $package = $this->getLayout()->getPackage(); + if (empty($package)) { + $package = Wootook_Core_Layout::DEFAULT_PACKAGE; } - if ($theme === null || empty($theme)) { + + $user = Wootook_Empire_Model_User::getSingleton(); + if ($user !== null && $user->getId()) { + $theme = $user->getSkinPath(); + } + if (empty($theme)) { $theme = $this->getLayout()->getTheme(); } - if ($theme === null || empty($theme)) { - $theme = Wootook_Core_Model_Layout::DEFAULT_THEME; + if (empty($theme)) { + $theme = Wootook_Core_Layout::DEFAULT_THEME; } - if ($package === null || empty($package)) { - $package = $this->getLayout()->getPackage(); - } - if ($package === null || empty($package)) { - $package = Wootook_Core_Model_Layout::DEFAULT_PACKAGE; - } - $domain = $this->getLayout()->getDomain(); - - $baseUrl = Wootook::getBaseUrl('skin'); - $basePath = Wootook::getBasePath('skin'); - $pathPattern = $basePath . "{$domain}/%s/%s/{$uri}"; - $urlPattern = $baseUrl . "{$domain}/%s/%s/{$uri}"; - - if (count($params) > 0) { - $serializedParams = array(); - foreach ($params as $paramKey => $paramValue) { - if ($paramValue) { - $serializedParams[] = "{$paramKey}={$paramValue}"; - } - } - - $urlPattern .= '?' . implode('&', $serializedParams); - } - - if (Wootook::fileExists(sprintf($pathPattern, $package, $theme))) { - return sprintf($urlPattern, $package, $theme); - } - if (Wootook::fileExists(sprintf($pathPattern, $package, Wootook_Core_Model_Layout::DEFAULT_THEME))) { - return sprintf($urlPattern, $package, Wootook_Core_Model_Layout::DEFAULT_THEME); - } - - return sprintf($urlPattern, Wootook_Core_Model_Layout::DEFAULT_PACKAGE, Wootook_Core_Model_Layout::DEFAULT_THEME); + return Wootook::getSkinUrl($package, $theme, $uri, $params); } public function setPartial($name, $content) @@ -249,9 +158,6 @@ class Wootook_Core_Mvc_View_View public function getPartial($name) { - if (!$this->hasPartial($name)) { - return null; - } return $this->_partials[$name]; } @@ -305,7 +211,7 @@ class Wootook_Core_Mvc_View_View /** * - * @return Wootook_Core_Model_Layout + * @return Wootook_Core_Layout */ public function getLayout() { @@ -343,4 +249,4 @@ class Wootook_Core_Mvc_View_View { return $this->_scriptPath; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php b/application/code/core/Wootook/Core/install/mysql5/install-2011.1.0.php similarity index 63% rename from src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php rename to application/code/core/Wootook/Core/install/mysql5/install-2011.1.0.php index ba30531..51a956e 100644 --- a/src/application/code/core/Legacies/Empire/install/mysql5/install-1.5.0.php +++ b/application/code/core/Wootook/Core/install/mysql5/install-2011.1.0.php @@ -2,36 +2,48 @@ /** * This file is part of Wootook * - * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @license Modified BSD + * @see https://github.com/gplanchat/one.platform * - * Copyright (c) 2011-Present, Grégory PLANCHAT + * Copyright (c) 2009-2010, Grégory PLANCHAT * All rights reserved. * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of Grégory PLANCHAT nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * --> NOTICE <-- * This file is part of the core development branch, changing its contents will * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. + * documentation for further information about customizing One.Platform. * */ -$this->setSetupConnection('core_setup'); +$this->setSetupConnection('legacies_setup'); $sql = <<getTableName('aks')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/aks')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NULL, `teilnehmer` TEXT NULL, @@ -47,8 +59,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/aks', 'legacies_read', array('SELECT')) + ->grant('legacies/aks', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/aks', 'legacies_setup') +; + $sql = <<getTableName('alliance')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/alliance')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `ally_name` VARCHAR(32) NOT NULL, `ally_tag` VARCHAR(8) NOT NULL, @@ -70,8 +88,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/alliance', 'legacies_read', array('SELECT')) + ->grant('legacies/alliance', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/alliance', 'legacies_setup') +; + $sql = <<getTableName('annonce')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/annonce')} ( `id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, `user` TEXT NOT NULL, `galaxie` TINYINT UNSIGNED NOT NULL, @@ -88,8 +112,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/annonce', 'legacies_read', array('SELECT')) + ->grant('legacies/annonce', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/annonce', 'legacies_setup') +; + $sql = <<getTableName('banned')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/banned')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `who` BIGINT UNSIGNED NOT NULL, `theme` TEXT NOT NULL, @@ -104,8 +134,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/banned', 'legacies_read', array('SELECT')) + ->grant('legacies/banned', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/banned', 'legacies_setup') +; + $sql = <<getTableName('buddy')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/buddy')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `sender` BIGINT UNSIGNED NOT NULL, `owner` BIGINT UNSIGNED NOT NULL, @@ -117,8 +153,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/buddy', 'legacies_read', array('SELECT')) + ->grant('legacies/buddy', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/buddy', 'legacies_setup') +; + $sql = <<getTableName('chat')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/chat')} ( `messageid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `user` VARCHAR(255) NOT NULL, `message` TEXT NOT NULL, @@ -129,8 +171,83 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/chat', 'legacies_read', array('SELECT')) + ->grant('legacies/chat', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/chat', 'legacies_setup') +; + $sql = <<getTableName('declared')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/config')} ( + `config_name` VARCHAR(64) NOT NULL, + `config_value` TEXT NOT NULL, + UNIQUE KEY (`config_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SQL_EOF; + +$this->query($sql); + +$this + ->grant('legacies/config', 'legacies_read', array('SELECT')) + ->grant('legacies/config', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/config', 'legacies_setup') +; + +$sql = <<getTableName('legacies/config')} (`config_name`, `config_value`) VALUES + ('game_speed', '2500'), + ('fleet_speed', '2500'), + ('resource_multiplier', '1000'), + ('Fleet_Cdr', '30'), + ('Defs_Cdr', '30'), + ('initial_fields', '5000'), + ('COOKIE_NAME', 'xnova-legacies'), + ('game_name', 'Wootook:Legacies'), + ('game_disable', '1'), + ('close_reason', 'Le jeu est clos pour le moment!'), + ('metal_basic_income', '20'), + ('crystal_basic_income', '10'), + ('deuterium_basic_income', '0'), + ('energy_basic_income', '0'), + ('BuildLabWhileRun', '0'), + ('LastSettedGalaxyPos', '1'), + ('LastSettedSystemPos', '1'), + ('LastSettedPlanetPos', '1'), + ('urlaubs_modus_erz', '1'), + ('noobprotection', '1'), + ('noobprotectiontime', '5000'), + ('noobprotectionmulti', '5'), + ('forum_url', 'http://board.xnova-ng.org/'), + ('OverviewNewsFrame', '1'), + ('OverviewNewsTEXT', 'Bienvenue sur le nouveau serveur Wootook Legacies'), + ('OverviewExternChat', '0'), + ('OverviewExternChatCmd', ''), + ('OverviewBanner', '0'), + ('OverviewClickBanner', ''), + ('ExtCopyFrame', '0'), + ('ExtCopyOwner', ''), + ('ExtCopyFunct', ''), + ('ForumBannerFrame', '0'), + ('stat_settings', '1000'), + ('link_enable', '0'), + ('link_name', ''), + ('link_url', ''), + ('enable_announces', '1'), + ('enable_marchand', '1'), + ('enable_notes', '1'), + ('bot_name', 'XNoviana Reali'), + ('bot_adress', 'xnova@xnova.fr'), + ('banner_source_post', '../images/bann.png'), + ('ban_duration', '30'), + ('enable_bot', '0'), + ('enable_bbcode', '1'), + ('debug', '0'); +SQL_EOF; + +$this->query($sql); + +$sql = <<getTableName('legacies/declared')} ( `declarator` TEXT NOT NULL, `declared_1` TEXT NOT NULL, `declared_2` TEXT NOT NULL, @@ -142,8 +259,33 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/declared', 'legacies_read', array('SELECT')) + ->grant('legacies/declared', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/declared', 'legacies_setup') +; + $sql = <<getTableName('fleets')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/errors')} ( + `error_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `error_sender` VARCHAR(32) NOT NULL, + `error_time` TIMESTAMP NOT NULL, + `error_type` VARCHAR(32) NOT NULL DEFAULT 'unknown', + `error_text` TEXT, + PRIMARY KEY (`error_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SQL_EOF; + +$this->query($sql); + +$this + ->grant('legacies/errors', 'legacies_read', array('SELECT')) + ->grant('legacies/errors', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/errors', 'legacies_setup') +; + +$sql = <<getTableName('legacies/fleets')} ( `fleet_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `fleet_owner` BIGINT UNSIGNED NOT NULL, `fleet_mission` TINYINT UNSIGNED NOT NULL, @@ -160,22 +302,29 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('fleets')} ( `fleet_end_system` SMALLINT UNSIGNED NOT NULL, `fleet_end_planet` TINYINT UNSIGNED NOT NULL, `fleet_end_type` TINYINT UNSIGNED NOT NULL, - `fleet_target_owner` BIGINT UNSIGNED NOT NULL, + `fleet_taget_owner` BIGINT UNSIGNED NOT NULL, `fleet_resource_metal` DECIMAL(65,0) NOT NULL DEFAULT 0, `fleet_resource_crystal` DECIMAL(65,0) NOT NULL DEFAULT 0, `fleet_resource_deuterium` DECIMAL(65,0) NOT NULL DEFAULT 0, + `fleet_target_owner` BIGINT UNSIGNED NOT NULL, `fleet_group` BIGINT UNSIGNED NOT NULL, `fleet_mess` BIGINT UNSIGNED NOT NULL, - `start_time` TIMESTAMP NOT NULL, + `start_time` INT, PRIMARY KEY (`fleet_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; SQL_EOF; $this->query($sql); +$this + ->grant('legacies/fleets', 'legacies_read', array('SELECT')) + ->grant('legacies/fleets', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/fleets', 'legacies_setup') +; + $sql = <<getTableName('galaxy')} ( - `galaxy` SMALLINT UNSIGNED NOT NULL, +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/galaxy')} ( + `galaxy` TINYINT UNSIGNED NOT NULL, `system` SMALLINT UNSIGNED NOT NULL, `planet` TINYINT UNSIGNED NOT NULL, `id_planet` BIGINT UNSIGNED NOT NULL, @@ -192,8 +341,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/galaxy', 'legacies_read', array('SELECT')) + ->grant('legacies/galaxy', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/galaxy', 'legacies_setup') +; + $sql = <<getTableName('iraks')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/iraks')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `zeit` TIMESTAMP NOT NULL, `galaxy` TINYINT UNSIGNED NOT NULL, @@ -212,8 +367,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/iraks', 'legacies_read', array('SELECT')) + ->grant('legacies/iraks', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/iraks', 'legacies_setup') +; + $sql = <<getTableName('lunas')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/lunas')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id_luna` BIGINT UNSIGNED NOT NULL, `name` VARCHAR(100) NOT NULL DEFAULT 'Lune', @@ -232,8 +393,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/lunas', 'legacies_read', array('SELECT')) + ->grant('legacies/lunas', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/lunas', 'legacies_setup') +; + $sql = <<getTableName('messages')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/messages')} ( `message_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `message_owner` BIGINT UNSIGNED NOT NULL, `message_sender` BIGINT UNSIGNED NOT NULL, @@ -248,8 +415,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/messages', 'legacies_read', array('SELECT')) + ->grant('legacies/messages', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/messages', 'legacies_setup') +; + $sql = <<getTableName('multi')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/multi')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `player` BIGINT UNSIGNED NOT NULL, `sharer` BIGINT UNSIGNED NOT NULL, @@ -260,8 +433,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/multi', 'legacies_read', array('SELECT')) + ->grant('legacies/multi', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/multi', 'legacies_setup') +; + $sql = <<getTableName('notes')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/notes')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `owner` BIGINT UNSIGNED NOT NULL, `time` TIMESTAMP NOT NULL, @@ -274,8 +453,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/notes', 'legacies_read', array('SELECT')) + ->grant('legacies/notes', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/notes', 'legacies_setup') +; + $sql = <<getTableName('planets')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/planets')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(100) NOT NULL, `id_owner` BIGINT UNSIGNED NOT NULL, @@ -283,36 +468,37 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('planets')} ( `galaxy` TINYINT UNSIGNED NOT NULL, `system` SMALLINT UNSIGNED NOT NULL, `planet` TINYINT UNSIGNED NOT NULL, - `last_update` DATETIME NOT NULL, + `last_update` TIMESTAMP NOT NULL, `planet_type` TINYINT UNSIGNED NOT NULL, - `destruyed` INT UNSIGNED NOT NULL DEFAULT FALSE, - `b_building` DATETIME NOT NULL, + `destruyed` BOOL NOT NULL DEFAULT FALSE, + `b_building` SMALLINT UNSIGNED NOT NULL, `b_building_id` TEXT NOT NULL, - `b_tech` DATETIME NOT NULL, - `b_tech_id` TEXT NOT NULL, - `b_hangar` DATETIME NOT NULL, + `b_tech` SMALLINT UNSIGNED NOT NULL, + `b_tech_id` SMALLINT UNSIGNED NOT NULL, + `b_hangar` SMALLINT UNSIGNED NOT NULL, `b_hangar_id` TEXT NOT NULL, + `b_hangar_plus` SMALLINT UNSIGNED NOT NULL, `image` VARCHAR(50) NOT NULL DEFAULT 'normaltempplanet01', `diameter` INT UNSIGNED NOT NULL DEFAULT 12800, `points` DECIMAL(65,0) NOT NULL DEFAULT 0, `ranks` BIGINT UNSIGNED NOT NULL, - `field_current` SMALLINT UNSIGNED NOT NULL DEFAULT 0, - `field_max` SMALLINT UNSIGNED NOT NULL DEFAULT 163, - `temp_min` SMALLINT NOT NULL DEFAULT 0, - `temp_max` SMALLINT NOT NULL DEFAULT 0, + `field_current` INT UNSIGNED NOT NULL DEFAULT 163, + `field_max` INT UNSIGNED NOT NULL DEFAULT 163, + `temp_min` INT NOT NULL DEFAULT 0, + `temp_max` INT NOT NULL DEFAULT 0, `metal` DECIMAL(65,0) NOT NULL DEFAULT 0, `metal_perhour` DECIMAL(65,0) NOT NULL DEFAULT 0, `metal_max` DECIMAL(65,0) NOT NULL DEFAULT 0, - `cristal` DECIMAL(65,0) NOT NULL DEFAULT 0, - `cristal_perhour` DECIMAL(65,0) NOT NULL DEFAULT 0, - `cristal_max` DECIMAL(65,0) NOT NULL DEFAULT 0, + `crystal` DECIMAL(65,0) NOT NULL DEFAULT 0, + `crystal_perhour` DECIMAL(65,0) NOT NULL DEFAULT 0, + `crystal_max` DECIMAL(65,0) NOT NULL DEFAULT 0, `deuterium` DECIMAL(65,0) NOT NULL DEFAULT 0, `deuterium_perhour` DECIMAL(65,0) NOT NULL DEFAULT 0, `deuterium_max` DECIMAL(65,0) NOT NULL DEFAULT 0, `energy_used` DECIMAL(65,0) NOT NULL DEFAULT 0, `energy_max` DECIMAL(65,0) NOT NULL DEFAULT 0, `metal_mine` SMALLINT UNSIGNED NOT NULL DEFAULT 0, - `cristal_mine` SMALLINT UNSIGNED NOT NULL DEFAULT 0, + `crystal_mine` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `deuterium_sintetizer` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `solar_plant` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `fusion_plant` SMALLINT UNSIGNED NOT NULL DEFAULT 0, @@ -320,7 +506,7 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('planets')} ( `nano_factory` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `hangar` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `metal_store` SMALLINT UNSIGNED NOT NULL DEFAULT 0, - `cristal_store` SMALLINT UNSIGNED NOT NULL DEFAULT 0, + `crystal_store` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `deuterium_store` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `laboratory` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `terraformer` SMALLINT UNSIGNED NOT NULL DEFAULT 0, @@ -343,20 +529,18 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('planets')} ( `destructor` DECIMAL(65,0) NOT NULL DEFAULT 0, `dearth_star` DECIMAL(65,0) NOT NULL DEFAULT 0, `battleship` DECIMAL(65,0) NOT NULL DEFAULT 0, - `supernova` DECIMAL(65,0) NOT NULL DEFAULT 0, - `ore_miner` DECIMAL(65,0) NOT NULL DEFAULT 0, `misil_launcher` DECIMAL(65,0) NOT NULL DEFAULT 0, `small_laser` DECIMAL(65,0) NOT NULL DEFAULT 0, `big_laser` DECIMAL(65,0) NOT NULL DEFAULT 0, `gauss_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, `ionic_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, `buster_canyon` DECIMAL(65,0) NOT NULL DEFAULT 0, - `small_protection_shield` ENUM('0','1') NOT NULL DEFAULT '0', - `big_protection_shield` ENUM('0','1') NOT NULL DEFAULT '0', + `small_protection_shield` ENUM('0','1') NOT NULL DEFAULT 0, + `big_protection_shield` ENUM('0','1') NOT NULL DEFAULT 0, `interceptor_misil` SMALLINT NOT NULL DEFAULT 0, `interplanetary_misil` SMALLINT NOT NULL DEFAULT 0, `metal_mine_porcent` TINYINT NOT NULL DEFAULT 10, - `cristal_mine_porcent` TINYINT NOT NULL DEFAULT 10, + `crystal_mine_porcent` TINYINT NOT NULL DEFAULT 10, `deuterium_sintetizer_porcent` TINYINT NOT NULL DEFAULT 10, `solar_plant_porcent` TINYINT NOT NULL DEFAULT 10, `fusion_plant_porcent` TINYINT NOT NULL DEFAULT 10, @@ -368,8 +552,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/planets', 'legacies_read', array('SELECT')) + ->grant('legacies/planets', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/planets', 'legacies_setup') +; + $sql = <<getTableName('rw')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/rw')} ( `id_owner1` BIGINT UNSIGNED NOT NULL, `id_owner2` BIGINT UNSIGNED NOT NULL, `rid` VARCHAR(72) NOT NULL, @@ -384,8 +574,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/rw', 'legacies_read', array('SELECT')) + ->grant('legacies/rw', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/rw', 'legacies_setup') +; + $sql = <<getTableName('statpoints')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/statpoints')} ( `id_owner` BIGINT UNSIGNED NOT NULL, `id_ally` BIGINT UNSIGNED NOT NULL, `stat_type` TINYINT UNSIGNED NOT NULL, @@ -421,8 +617,14 @@ SQL_EOF; $this->query($sql); +$this + ->grant('legacies/statpoints', 'legacies_read', array('SELECT')) + ->grant('legacies/statpoints', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/statpoints', 'legacies_setup') +; + $sql = <<getTableName('users')} ( +CREATE TABLE IF NOT EXISTS {$this->getTableName('legacies/users')} ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `username` VARCHAR(100) NOT NULL, -- FIXME `password` VARCHAR(64) NOT NULL, -- FIXME @@ -480,7 +682,6 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('users')} ( `intergalactic_tech` TINYINT UNSIGNED NOT NULL, -- FIXME `expedition_tech` TINYINT UNSIGNED NOT NULL, -- FIXME `graviton_tech` TINYINT UNSIGNED NOT NULL, -- FIXME - `ore_mining_tech` TINYINT UNSIGNED NOT NULL, -- FIXME `ally_id` BIGINT UNSIGNED NOT NULL, `ally_name` VARCHAR(32) NULL, -- FIXME `ally_request` BOOL NOT NULL DEFAULT FALSE, -- FIXME @@ -488,9 +689,25 @@ CREATE TABLE IF NOT EXISTS {$this->getTableName('users')} ( `ally_register_time` TIMESTAMP NOT NULL, -- FIXME `ally_rank_id` BIGINT UNSIGNED NOT NULL, -- FIXME `current_luna` INT NOT NULL, -- FIXME - `kolorminus` VARCHAR(11) NOT NULL DEFAULT 'red', - `kolorplus` VARCHAR(11) NOT NULL DEFAULT '#00FF00', - `kolorpoziom` VARCHAR(11) NOT NULL DEFAULT 'yellow', + `kolorminus` VARCHAR(11) NOT NULL DEFAULT 'red', + `kolorplus` VARCHAR(11) NOT NULL DEFAULT '#00FF00', + `kolorpoziom` VARCHAR(11) NOT NULL DEFAULT 'yellow', + `rpg_geologue` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_amiral` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_ingenieur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_technocrate` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_espion` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_constructeur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_scientifique` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_commandant` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_points` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_stockeur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_defenseur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_destructeur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_general` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_bunker` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_raideur` TINYINT UNSIGNED NOT NULL, -- FIXME + `rpg_empereur` TINYINT UNSIGNED NOT NULL, -- FIXME `lvl_minier` BIGINT UNSIGNED NOT NULL, -- FIXME `lvl_raid` BIGINT UNSIGNED NOT NULL, -- FIXME `xpraid` BIGINT UNSIGNED NOT NULL, -- FIXME @@ -519,320 +736,57 @@ SQL_EOF; $this->query($sql); -/* - * Galaxy positions generation - */ -$galaxyCount = Wootook::getConfig('engine/universe/galaxies'); -$systemCount = Wootook::getConfig('engine/universe/systems'); +$this + ->grant('legacies/users', 'legacies_read', array('SELECT')) + ->grant('legacies/users', 'legacies_write', array('SELECT', 'CREATE', 'UPDATE', 'DELETE')) + ->grant('legacies/users', 'legacies_setup') +; $sql = <<getTableName('galaxy')} - (`galaxy`, `system`, `planet`, `id_planet`, `metal`, `crystal`, `id_luna`, `luna`) - SELECT - _increment.galaxy AS `galaxy`, - _increment.system AS `system`, - 0 AS `planet`, - 0 AS `id_planet`, - 0 AS `metal`, - 0 AS `crystal`, - 0 AS `id_luna`, - 0 AS `luna` - FROM ( - SELECT - (1 + _galaxy_10e0.galaxy + _galaxy_10e1.galaxy + _galaxy_10e2.galaxy + _galaxy_10e3.galaxy + _galaxy_10e4.galaxy) AS galaxy, - (1 + _system_10e0.system + _system_10e1.system + _system_10e2.system + _system_10e3.system + _system_10e4.system) AS system - FROM ( - SELECT 0 AS system - UNION ALL - SELECT 1 AS system - UNION ALL - SELECT 2 AS system - UNION ALL - SELECT 3 AS system - UNION ALL - SELECT 4 AS system - UNION ALL - SELECT 5 AS system - UNION ALL - SELECT 6 AS system - UNION ALL - SELECT 7 AS system - UNION ALL - SELECT 8 AS system - UNION ALL - SELECT 9 AS system - ) AS _system_10e0 -SQL_EOF; - -if ($systemCount > 10) { - $sql .= << 100) { -$sql .= << 1000) { - $sql .= << 10000) { - $sql .= << 10) { - $sql .= << 100) { - $sql .= << 1000) { - $sql .= << 10000) { -$sql .= <<getTableName('legacies/alliance')} ( + `id`, `ally_name`, `ally_tag`, `ally_owner`, `ally_register_time`, `ally_description`, + `ally_web`, `ally_text`, `ally_image`, `ally_request`, `ally_request_waiting`, + `ally_request_notallow`, `ally_owner_range`, `ally_ranks`, `ally_members` + ) + VALUES + ('1', 'Admin', 'Admin', 1, NOW(), 'Administrator alliance', 'http://www.xnova-ng.org/', + '', '', '', '', '', '', '', '') +SQL_EOF; + +$this->query($sql); + +$sql = <<getTableName('legacies/users')} ( + `id`, `username`, `password`, `email`, `email_2`, `lang`, `authlevel`, `sex`, + `avatar`, `sign`, `id_planet`, `galaxy`, `system`, `planet`, `current_planet`, + `user_lastip`, `ip_at_reg`, `user_agent`, `current_page`, `register_time`, + `onlinetime`, `dpath`, `design`, `noipcheck`, `planet_sort`, `planet_sort_order`, + `spio_anz`, `settings_tooltiptime`, `settings_fleetactions`, `settings_allylogo`, + `settings_esp`, `settings_wri`, `settings_bud`, `settings_mis`, `settings_rep`, + `urlaubs_modus`, `urlaubs_until`, `db_deaktjava`, `new_message`, `fleet_shortcut`, + `b_tech_planet`, `spy_tech`, `computer_tech`, `military_tech`, `defence_tech`, + `shield_tech`, `energy_tech`, `hyperspace_tech`, `combustion_tech`, + `impulse_motor_tech`, `hyperspace_motor_tech`, `laser_tech`, `ionic_tech`, + `buster_tech`, `intergalactic_tech`, `expedition_tech`, `graviton_tech`, + `ally_id`, `ally_name`, `ally_request`, `ally_request_text`, `ally_register_time`, + `ally_rank_id`, `current_luna`, `kolorminus`, `kolorplus`, `kolorpoziom`, + `rpg_geologue`, `rpg_amiral`, `rpg_ingenieur`, `rpg_technocrate`, `rpg_espion`, + `rpg_constructeur`, `rpg_scientifique`, `rpg_commandant`, `rpg_points`, `rpg_stockeur`, + `rpg_defenseur`, `rpg_destructeur`, `rpg_general`, `rpg_bunker`, `rpg_raideur`, + `rpg_empereur`, `lvl_minier`, `lvl_raid`, `xpraid`, `xpminier`, `raids`, + `p_infligees`, `mnl_alliance`, `mnl_joueur`, `mnl_attaque`, `mnl_spy`, + `mnl_exploit`, `mnl_transport`, `mnl_expedition`, `mnl_general`, `mnl_buildlist`, + `bana`, `multi_validated`, `banaday`, `raids1`, `raidswin`, `raidsloose` + ) + VALUES + ('1', 'Admin', '', '', '', 'fr', '3', NULL, '', '', '1', '1', '1', '1', + '1', '127.0.0.1', '', '', '', '1254743313', '1269391977', '', '1', '1', '0', + '0', '1', '5', '0', '0', '1', '1', '1', '1', '0', '0', '0', '0', '0', '', '0', + '16', '20', '11', '11', '11', '12', '10', '14', '10', '9', '0', '0', '0', '0', + '0', '1', 1, 'Admin', '0', '', NOW(), '0', '0', 'red', '#00FF00', 'yellow', '20', + '20', '10', '10', '0', '3', '3', '0', '27', '2', '2', '0', '0', '0', '0', '0', + '98', '1', '0', '1133583738', '0', '0', '0', '0', '0', '0', '0', '0', '0', + '0', '0', '0', '0', '0', '0', '0', '0') SQL_EOF; $this->query($sql); diff --git a/src/application/code/core/Legacies/Empire/install/mysql5/uninstall-1.5.0.php b/application/code/core/Wootook/Core/install/mysql5/uninstall-2011.1.0.php similarity index 70% rename from src/application/code/core/Legacies/Empire/install/mysql5/uninstall-1.5.0.php rename to application/code/core/Wootook/Core/install/mysql5/uninstall-2011.1.0.php index 040f676..74ec834 100644 --- a/src/application/code/core/Legacies/Empire/install/mysql5/uninstall-1.5.0.php +++ b/application/code/core/Wootook/Core/install/mysql5/uninstall-2011.1.0.php @@ -40,112 +40,124 @@ * */ -$this->setSetupConnection('core_setup'); +$this->setSetupConnection('legacies_setup'); $sql = <<getTableName('aks')}; +DROP TABLE {$this->getTableName('legacies/aks')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('alliance')}; +DROP TABLE {$this->getTableName('legacies/alliance')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('annonce')}; +DROP TABLE {$this->getTableName('legacies/annonce')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('banned')}; +DROP TABLE {$this->getTableName('legacies/banned')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('buddy')}; +DROP TABLE {$this->getTableName('legacies/buddy')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('chat')}; +DROP TABLE {$this->getTableName('legacies/chat')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('declared')}; +DROP TABLE {$this->getTableName('legacies/config')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('fleets')}; +DROP TABLE {$this->getTableName('legacies/declared')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('galaxy')}; +DROP TABLE {$this->getTableName('legacies/errors')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('iraks')}; +DROP TABLE {$this->getTableName('legacies/fleets')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('lunas')}; +DROP TABLE {$this->getTableName('legacies/galaxy')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('messages')}; +DROP TABLE {$this->getTableName('legacies/iraks')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('multi')}; +DROP TABLE {$this->getTableName('legacies/lunas')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('notes')}; +DROP TABLE {$this->getTableName('legacies/messages')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('planets')}; +DROP TABLE {$this->getTableName('legacies/multi')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('rw')}; +DROP TABLE {$this->getTableName('legacies/notes')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('statpoints')}; +DROP TABLE {$this->getTableName('legacies/planets')}; SQL_EOF; $this->query($sql); $sql = <<getTableName('users')}; +DROP TABLE {$this->getTableName('legacies/rw')}; +SQL_EOF; + +$this->query($sql); + +$sql = <<getTableName('legacies/statpoints')}; +SQL_EOF; + +$this->query($sql); + +$sql = <<getTableName('legacies/users')}; SQL_EOF; $this->query($sql); diff --git a/application/code/core/Wootook/Database.php b/application/code/core/Wootook/Database.php new file mode 100644 index 0000000..3ff35f0 --- /dev/null +++ b/application/code/core/Wootook/Database.php @@ -0,0 +1,51 @@ + PDO::ERRMODE_EXCEPTION + ); + + public static function getSingleton() + { + if (self::$_singleton === null) { + $config = include ROOT_PATH . 'config.php'; + $hostname = $config['global']['database']['options']['hostname']; + $username = $config['global']['database']['options']['username']; + $password = $config['global']['database']['options']['password']; + $database = $config['global']['database']['options']['database']; + $port = 3306; + + if (isset($config['global']['database']['options']['port'])) { + $port = $config['global']['database']['options']['port']; + } + + $event = Wootook::dispatchEvent('database.prepare-options', array( + 'options' => self::$options + )); + + self::$options = $event->getData('options'); + + self::$_singleton = new self("mysql:dbname={$database};host={$hostname};port={$port}", $username, $password, self::$options); + + Wootook::dispatchEvent('database.init', array( + 'handler' => self::$_singleton + )); + } + return self::$_singleton; + } + + public function getTable($name) + { + if (self::$_prefix === null) { + $config = include ROOT_PATH . 'config.php'; + self::$_prefix = $config['global']['database']['table_prefix']; + } + return self::$_prefix . $name; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Block/Overview.php b/application/code/core/Wootook/Empire/Block/Overview.php similarity index 58% rename from src/application/code/core/Wootook/Player/Block/Overview.php rename to application/code/core/Wootook/Empire/Block/Overview.php index bf689f0..c09ec87 100644 --- a/src/application/code/core/Wootook/Player/Block/Overview.php +++ b/application/code/core/Wootook/Empire/Block/Overview.php @@ -1,6 +1,6 @@ _labels = Wootook_Empire_Helper_Config_Labels::getSingleton(); - } - - public function setPlayer(Wootook_Player_Model_Entity $player) - { - $this->_player = $player; + $this->_user = $user; return $this; } - public function getPlayer() + public function getUser() { - if ($this->_player === null) { - $this->_player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); + if ($this->_user === null) { + $this->_user = Wootook_Empire_Model_User::getSingleton(); } - return $this->_player; + return $this->_user; } public function setPlanet(Wootook_Empire_Model_Planet $planet) @@ -40,7 +33,7 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract public function getPlanet() { if ($this->_planet === null) { - $this->_planet = $this->getPlayer()->getCurrentPlanet(); + $this->_planet = $this->getUser()->getCurrentPlanet(); } return $this->_planet; @@ -60,27 +53,41 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract public function getItemInfoUrl() { - return $this->getStaticUrl('infos.php', array('gid' => $this->getItemId())); - } - - public function getLabel($type) - { - return $this->_labels[$this->getItemId()][$type]; + return $this->getUrl('infos.php', array('gid' => $this->getItemId())); } public function getItemImageUrl() { - return $this->getStaticUrl($this->getLabel('image')); + // TODO : Upgrade theme + return $this->getSkinUrl('graphics/gebaeude/' . $this->getItemId() . '.gif'); } public function getName() { - return $this->getLabel('name'); + static $lang = null; + if ($lang === null) { + // FIXME: implement a cleaner way to get names + $lang = includeLang('tech'); + } + + if (isset($lang['tech']) && isset($lang['tech'][$this->getItemId()])) { + return $this->__($lang['tech'][$this->getItemId()]); + } + return ''; } public function getDescription() { - return $this->getLabel('description'); + static $lang = null; + if ($lang === null) { + // FIXME: implement a cleaner way to get names + $lang = includeLang('tech'); + } + + if (isset($lang['res']) && isset($lang['res']['descriptions']) && isset($lang['res']['descriptions'][$this->getItemId()])) { + return $this->__($lang['res']['descriptions'][$this->getItemId()]); + } + return ''; } public function getResourceName($resourceId) @@ -91,7 +98,7 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract $lang = includeLang('imperium'); } if ($resourceId == 'cristal') { - $resourceId = 'crystal'; // FIXME: backward compatibility + $resourceId = 'crystal'; } if (isset($lang[$resourceId])) { @@ -108,4 +115,4 @@ abstract class Wootook_Empire_Block_Planet_Builder_ItemAbstract abstract public function getResourcesNeeded($level); abstract public function getBuildingTime($level); -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Builder/Queue/ItemAbstract.php b/application/code/core/Wootook/Empire/Block/Planet/Builder/Queue/ItemAbstract.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Block/Planet/Builder/Queue/ItemAbstract.php rename to application/code/core/Wootook/Empire/Block/Planet/Builder/Queue/ItemAbstract.php diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php b/application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php similarity index 82% rename from src/application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php rename to application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php index baf9c71..d6122d3 100644 --- a/src/application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php +++ b/application/code/core/Wootook/Empire/Block/Planet/Builder/QueueAbstract.php @@ -3,25 +3,25 @@ abstract class Wootook_Empire_Block_Planet_Builder_QueueAbstract extends Wootook_Core_Block_Template { - protected $_player = null; + protected $_user = null; protected $_planet = null; protected $_itemTemplate = null; protected $_itemBlock = null; - public function setPlayer(Wootook_Player_Model_Entity $player) + public function setUser(Wootook_Empire_Model_User $user) { - $this->_player = $player; + $this->_user = $user; return $this; } - public function getPlayer() + public function getUser() { - if ($this->_player === null) { - $this->_player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); + if ($this->_user === null) { + $this->_user = Wootook_Empire_Model_User::getSingleton(); } - return $this->_player; + return $this->_user; } public function setPlanet(Wootook_Empire_Model_Planet $planet) @@ -34,7 +34,7 @@ abstract class Wootook_Empire_Block_Planet_Builder_QueueAbstract public function getPlanet() { if ($this->_planet === null) { - $this->_planet = $this->getPlayer()->getCurrentPlanet(); + $this->_planet = $this->getUser()->getCurrentPlanet(); } return $this->_planet; diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/BuilderAbstract.php b/application/code/core/Wootook/Empire/Block/Planet/BuilderAbstract.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Block/Planet/BuilderAbstract.php rename to application/code/core/Wootook/Empire/Block/Planet/BuilderAbstract.php diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings.php b/application/code/core/Wootook/Empire/Block/Planet/Buildings.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Block/Planet/Buildings.php rename to application/code/core/Wootook/Empire/Block/Planet/Buildings.php index 77d4a86..e777cdd 100644 --- a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings.php +++ b/application/code/core/Wootook/Empire/Block/Planet/Buildings.php @@ -15,7 +15,7 @@ class Wootook_Empire_Block_Planet_Buildings public function getPlanet() { if ($this->_planet === null) { - $this->_planet = Wootook_Player_Model_Session::getSingleton()->getPlayer() + $this->_planet = Wootook_Empire_Model_User::getSingleton() ->getCurrentPlanet() ; } @@ -24,7 +24,7 @@ class Wootook_Empire_Block_Planet_Buildings public function _initChildBlocks() { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); $type = Legacies_Empire::TYPE_BUILDING_PLANET; if ($this->getPlanet()->isMoon()) { $type = Legacies_Empire::TYPE_BUILDING_MOON; diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php b/application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php similarity index 78% rename from src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php rename to application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php index 1c4a970..b24a819 100644 --- a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php +++ b/application/code/core/Wootook/Empire/Block/Planet/Buildings/Item.php @@ -13,22 +13,6 @@ class Wootook_Empire_Block_Planet_Buildings_Item return $this->getPlanet()->getResourcesNeeded($this->getItemId(), $level); } - public function isBuildable($level = null) - { - if ($level === null) { - $level = $this->getNextLevel(); - } - $resources = $this->getResourcesNeeded($level); - - foreach ($resources as $resourceId => $resourceValue) { - $amount = $this->getPlanet()->getResourceAmount($resourceId); - if (Math::comp($amount, $resourceValue) < 0) { - return false; - } - } - return true; - } - public function getQueuedLevel() { return $this->getPlanet()->getBuildingLevelQueued($this->getItemId()); diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue.php b/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue.php rename to application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue.php diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php b/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php similarity index 55% rename from src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php rename to application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php index 6941b62..e3721e3 100644 --- a/src/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php +++ b/application/code/core/Wootook/Empire/Block/Planet/Buildings/Queue/Item.php @@ -1,39 +1,5 @@ - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * - * Enter description here ... - * @author Greg - * - */ class Wootook_Empire_Block_Planet_Buildings_Queue_Item extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract { @@ -64,14 +30,6 @@ class Wootook_Empire_Block_Planet_Buildings_Queue_Item return $this->getPlanet()->getBuildingTime($this->getItemId(), $level); } - public function getBuildingRemainingTime() - { - $totalTime = $this->getPlanet()->getBuildingTime($this->getItemId(), $this->getItemQueuedLevel()); - $item = $this->getItem(); - - return $item->getData('created_at') - $item->getData('updated_at') + $totalTime; - } - public function getResourcesConfigForLevel($level) { $resources = $this->getResourcesNeeded($level); diff --git a/src/application/code/core/Wootook/Empire/Block/PlanetList.php b/application/code/core/Wootook/Empire/Block/PlanetList.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Block/PlanetList.php rename to application/code/core/Wootook/Empire/Block/PlanetList.php diff --git a/src/application/code/core/Wootook/Empire/Block/Topnav.php b/application/code/core/Wootook/Empire/Block/Topnav.php similarity index 51% rename from src/application/code/core/Wootook/Empire/Block/Topnav.php rename to application/code/core/Wootook/Empire/Block/Topnav.php index 72a6d5b..152e242 100644 --- a/src/application/code/core/Wootook/Empire/Block/Topnav.php +++ b/application/code/core/Wootook/Empire/Block/Topnav.php @@ -5,11 +5,11 @@ class Wootook_Empire_Block_Topnav { /** * - * @return Wootook_Player_Model_Entity + * @return Wootook_Empire_Model_User */ - public function getCurrentPlayer() + public function getCurrentUser() { - return Wootook_Player_Model_Session::getSingleton()->getPlayer(); + return Wootook_Empire_Model_User::getSingleton(); } /** @@ -18,17 +18,16 @@ class Wootook_Empire_Block_Topnav */ public function getCurrentPlanet() { - return $this->getCurrentPlayer()->getCurrentPlanet(); + return $this->getCurrentUser()->getCurrentPlanet(); } /** * - * @return Wootook_Empire_Resource_Planet_Collection + * @return Wootook_Core_Collection */ public function getPlanetCollection() { - return $this->getCurrentPlayer() - ->getPlanetCollection(array(Wootook_Empire_Model_Planet::TYPE_PLANET)) - ->load(); + return $this->getCurrentUser() + ->getPlanetCollection(array(Wootook_Empire_Model_Planet::TYPE_PLANET)); } } \ No newline at end of file diff --git a/application/code/core/Wootook/Empire/Exception.php b/application/code/core/Wootook/Empire/Exception.php new file mode 100644 index 0000000..73de227 --- /dev/null +++ b/application/code/core/Wootook/Empire/Exception.php @@ -0,0 +1,3 @@ +_currentPlanet = $currentPlanet; - $this->_currentPlayer = $currentPlayer; + $this->_currentUser = $currentUser; $this->init(); } @@ -46,10 +46,6 @@ abstract class Wootook_Empire_Model_BuilderAbstract public function enqueue($params, $index = null) { - if ($this->_currentPlayer->isVacation()) { - return $this; - } - $item = $this->_initItem($params); if ($item === null) { return $this; @@ -98,10 +94,7 @@ abstract class Wootook_Empire_Model_BuilderAbstract { $this->clearQueue(); - $unserialized = false; - if (!empty($serialized)) { - $unserialized = @unserialize($serialized); - } + $unserialized = @unserialize($serialized); if ($unserialized === false) { $this->_queue = array(); return $this; @@ -129,8 +122,8 @@ abstract class Wootook_Empire_Model_BuilderAbstract $this->_queue = array(); } - abstract public function updateQueue(Wootook_Core_DateTime $time); - abstract public function appendQueue($typeId, $qty, Wootook_Core_DateTime $time); + abstract public function updateQueue($time); + abstract public function appendQueue($typeId, $qty, $time); /** * Check if an item type is actually buildable on the current @@ -141,8 +134,8 @@ abstract class Wootook_Empire_Model_BuilderAbstract */ public function checkAvailability($typeId) { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); - $requirements = Wootook_Empire_Helper_Config_Requirements::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + $requirements = Wootook_Empire_Model_Game_Requirements::getSingleton(); if (!isset($requirements[$typeId]) || empty($requirements[$typeId])) { return true; @@ -151,7 +144,7 @@ abstract class Wootook_Empire_Model_BuilderAbstract foreach ($requirements[$typeId] as $requirement => $level) { if ($types->is($requirement, Legacies_Empire::TYPE_BUILDING) && $this->_currentPlanet->hasElement($requirement, $level)) { continue; - } else if ($types->is($requirement, Legacies_Empire::TYPE_RESEARCH) && $this->_currentPlayer->hasElement($requirement, $level)) { + } else if ($types->is($requirement, Legacies_Empire::TYPE_RESEARCH) && $this->_currentUser->hasElement($requirement, $level)) { continue; } else if ($types->is($requirement, Legacies_Empire::TYPE_DEFENSE) && $this->_currentPlanet->hasElement($requirement, $level)) { continue; @@ -212,9 +205,9 @@ abstract class Wootook_Empire_Model_BuilderAbstract return $this->_currentPlanet; } - public function getCurrentPlayer() + public function getCurrentUser() { - return $this->_currentPlayer; + return $this->_currentUser; } public function setCurrentPlanet(Wootook_Empire_Model_Planet $planet) @@ -224,9 +217,9 @@ abstract class Wootook_Empire_Model_BuilderAbstract return $this; } - public function setCurrentPlayer(Wootook_Player_Model_Entity $player) + public function setCurrentUser(Wootook_Empire_Model_User $user) { - $this->_currentPlayer = $player; + $this->_currentUser = $user; return $this; } @@ -251,4 +244,4 @@ abstract class Wootook_Empire_Model_BuilderAbstract } return $resourceAmounts; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Model/Fleet.php b/application/code/core/Wootook/Empire/Model/Fleet.php similarity index 56% rename from src/application/code/core/Wootook/Empire/Model/Fleet.php rename to application/code/core/Wootook/Empire/Model/Fleet.php index e622226..1ce2b7d 100644 --- a/src/application/code/core/Wootook/Empire/Model/Fleet.php +++ b/application/code/core/Wootook/Empire/Model/Fleet.php @@ -7,7 +7,7 @@ * @uses Legacies_Empire */ class Wootook_Empire_Model_Fleet - extends Wootook_Core_Mvc_Model_Entity + extends Wootook_Core_Entity { protected static $_instances = array(); @@ -34,36 +34,24 @@ class Wootook_Empire_Model_Fleet { $this->setIdFieldName('fleet_id'); $this->setTableName('fleets'); - - $this->getDataMapper() - ->addRule('fleet_start_time', 'date-time') - ->addRule('fleet_end_time', 'date-time') - ->addRule('fleet_end_stay', 'date-time') - ; } public static function planetListener($eventData) { } - public function isOwnedBy(Wootook_Player_Model_Entity $player) + public function isOwnedBy(Wootook_Empire_Model_User $user) { - if ($this->getData('fleet_owner') == $player->getId()) { + if ($this->getData('fleet_owner') == $user->getId()) { return true; } return false; } - /** - * @return null|Wootook_Player_Resource_Entity_Collection - */ - public function getOwnerCollection() + public function getOwner() { if ($id = $this->getData('fleet_owner')) { - $ownerCollection = new Wootook_Player_Resource_Entity_Collection($this->getReadConnection()); - $ownerCollection->addFieldToFilter('id', $id); - - return $ownerCollection; + return Wootook_Empire_Model_User::factory($id); } return null; } @@ -76,10 +64,10 @@ class Wootook_Empire_Model_Fleet return false; } - public function getRowClass(Wootook_Player_Model_Entity $player = null) + public function getRowClass(Wootook_Empire_Model_User $user = null) { if ($this->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $this->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK)) { - if ($player !== null && $this->isOwnedBy($player)) { + if ($user !== null && $this->isOwnedBy($user)) { return 'attack'; } else { return 'ownattack'; @@ -98,8 +86,6 @@ class Wootook_Empire_Model_Fleet return 'missiles'; } else if ($this->isMission(Legacies_Empire::ID_MISSION_EXPEDITION)) { return 'expedition'; - } else if ($this->isMission(Legacies_Empire::ID_MISSION_ORE_MINING)) { - return 'ore-mining'; } } @@ -121,34 +107,25 @@ class Wootook_Empire_Model_Fleet return Wootook::__('Missiles Launch'); } else if ($this->isMission(Legacies_Empire::ID_MISSION_EXPEDITION)) { return Wootook::__('Expedition'); - } else if ($this->isMission(Legacies_Empire::ID_MISSION_ORE_MINING)) { - return Wootook::__('Ore mining'); } return Legacies::__('Unknown'); } - /** - * @return Wootook_Core_DateTime - */ public function getStartTime() { return $this->getData('fleet_start_time'); } - /** - * @return Wootook_Core_DateTime - */ - public function getActionTime() { return $this->getData('fleet_end_stay'); } - /** - * @return Wootook_Core_DateTime - */ public function getArrivalTime() { + if ($this->isMission(Legacies_Empire::ID_MISSION_STATION) || $this->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)) { + return $this->getActionTime(); + } return $this->getData('fleet_end_time'); } @@ -164,85 +141,15 @@ class Wootook_Empire_Model_Fleet return Wootook_Empire_Model_Planet::factoryFromCoords($coords, $type); } - public function getOriginPlanetName() - { - if (!($planet = $this->getOriginPlanet()->getId())) { - return ''; - } - return $planet->getName(); - } - - public function getOriginPlanetCoords() - { - if (!($planet = $this->getOriginPlanet()->getId())) { - return sprintf('%s:%s:%s', $this->getData('fleet_start_galaxy'), $this->getData('fleet_start_system'), $this->getData('fleet_start_planet')); - } - return $planet->getCoords(); - } - public function getDestinationPlanet() { $coords = array( 'galaxy' => $this->getData('fleet_end_galaxy'), 'system' => $this->getData('fleet_end_system'), 'position' => $this->getData('fleet_end_planet') - ); + ); $type = $this->getData('fleet_end_type'); return Wootook_Empire_Model_Planet::factoryFromCoords($coords, $type); } - - public function getDestinationPlanetName() - { - if (!($planet = $this->getDestinationPlanet()->getId())) { - return ''; - } - return $planet->getName(); - } - - public function getDestinationPlanetCoords() - { - if (!($planet = $this->getDestinationPlanet()->getId())) { - return sprintf('%s:%s:%s', $this->getData('fleet_end_galaxy'), $this->getData('fleet_end_system'), $this->getData('fleet_end_planet')); - } - return $planet->getCoords(); - } - - public function goBack() - { - $this->setData('fleet_mess', 1)->save(); - - return $this; - } - - /** - * @param Wootook_Empire_Model_Planet $planet - * @return Wootook_Empire_Model_Fleet - */ - public function dock(Wootook_Empire_Model_Planet $planet) - { - // Backward-compatible way to unserialize fleet ships listing - $serializedFleetArray = $this->getData('fleet_array'); - foreach (explode(';', $serializedFleetArray) as $fleetShipData) { - if (empty($fleetShipData)) { - continue; - } - $fleetShipData = explode(',', $fleetShipData); - if (count($fleetShipData) != 2) { - continue; - } - $planet->setElement($fleetShipData[0], Math::add($planet->getElement($fleetShipData[0]), $fleetShipData[1])); - } - - $planet - ->setData('metal', Math::add($planet->getData('metal'), $this->getData('fleet_resource_metal'))) - ->setData('cristal', Math::add($planet->getData('cristal'), $this->getData('fleet_resource_crystal'))) - ->setData('deuterium', Math::add($planet->getData('deuterium'), $this->getData('fleet_resource_deuterium'))) - ->save(); - ; - - $this->delete(); - - return $this; - } -} +} \ No newline at end of file diff --git a/application/code/core/Wootook/Empire/Model/Galaxy/Position.php b/application/code/core/Wootook/Empire/Model/Galaxy/Position.php new file mode 100644 index 0000000..2989b1a --- /dev/null +++ b/application/code/core/Wootook/Empire/Model/Galaxy/Position.php @@ -0,0 +1,32 @@ +_tableName = 'galaxy'; + $this->_idFieldNames = array('id_planet'); + } + + static function initPlanetListerner($eventData) + { + if (!isset($eventData['planet'])) { + return; + } + + $planet = $eventData['planet']; + if (!$planet->isPlanet()) { + return; + } + + $galaxy = new self(); + $galaxy + ->setData('galaxy', $planet->getGalaxy()) + ->setData('system', $planet->getSystem()) + ->setData('planet', $planet->getPosition()) + ->setData('id_planet', $planet->getId()) + ->save() + ; + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Combat.php b/application/code/core/Wootook/Empire/Model/Game/Combat.php similarity index 88% rename from src/application/code/core/Wootook/Empire/Helper/Config/Combat.php rename to application/code/core/Wootook/Empire/Model/Game/Combat.php index 26a1bc8..48a9e1b 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Combat.php +++ b/application/code/core/Wootook/Empire/Model/Game/Combat.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Combat - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Combat + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/FieldsAlias.php b/application/code/core/Wootook/Empire/Model/Game/FieldsAlias.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Helper/Config/FieldsAlias.php rename to application/code/core/Wootook/Empire/Model/Game/FieldsAlias.php index 101bc5f..9a4ab2b 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/FieldsAlias.php +++ b/application/code/core/Wootook/Empire/Model/Game/FieldsAlias.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_FieldsAlias - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_FieldsAlias + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Prices.php b/application/code/core/Wootook/Empire/Model/Game/Prices.php similarity index 88% rename from src/application/code/core/Wootook/Empire/Helper/Config/Prices.php rename to application/code/core/Wootook/Empire/Model/Game/Prices.php index 1a328de..9133d34 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Prices.php +++ b/application/code/core/Wootook/Empire/Model/Game/Prices.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Prices - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Prices + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Production.php b/application/code/core/Wootook/Empire/Model/Game/Production.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Helper/Config/Production.php rename to application/code/core/Wootook/Empire/Model/Game/Production.php index d4539fc..60ab21c 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Production.php +++ b/application/code/core/Wootook/Empire/Model/Game/Production.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Production - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Production + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Requirements.php b/application/code/core/Wootook/Empire/Model/Game/Requirements.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Helper/Config/Requirements.php rename to application/code/core/Wootook/Empire/Model/Game/Requirements.php index 04ea042..9f09689 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Requirements.php +++ b/application/code/core/Wootook/Empire/Model/Game/Requirements.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Requirements - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Requirements + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Resources.php b/application/code/core/Wootook/Empire/Model/Game/Resources.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Helper/Config/Resources.php rename to application/code/core/Wootook/Empire/Model/Game/Resources.php index 8ce2483..c825f74 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Resources.php +++ b/application/code/core/Wootook/Empire/Model/Game/Resources.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Resources - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Resources + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Types.php b/application/code/core/Wootook/Empire/Model/Game/Types.php similarity index 90% rename from src/application/code/core/Wootook/Empire/Helper/Config/Types.php rename to application/code/core/Wootook/Empire/Model/Game/Types.php index 9ef029d..291c964 100644 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Types.php +++ b/application/code/core/Wootook/Empire/Model/Game/Types.php @@ -7,8 +7,8 @@ * @uses Wootook_Object * @uses Legacies_Empire */ -class Wootook_Empire_Helper_Config_Types - extends Wootook_Core_Helper_Config_ConfigHandler +class Wootook_Empire_Model_Game_Types + extends Wootook_Core_Model_Config_Abstract implements Wootook_Core_Singleton { private static $_singleton = null; diff --git a/src/application/code/core/Wootook/Empire/Model/Planet.php b/application/code/core/Wootook/Empire/Model/Planet.php similarity index 63% rename from src/application/code/core/Wootook/Empire/Model/Planet.php rename to application/code/core/Wootook/Empire/Model/Planet.php index 980524f..c013667 100644 --- a/src/application/code/core/Wootook/Empire/Model/Planet.php +++ b/application/code/core/Wootook/Empire/Model/Planet.php @@ -4,10 +4,10 @@ * * @uses Wootook_Object * @uses Legacies_Empire - * @uses Wootook_Player_Model_Entity + * @uses Legacies_Empire_User */ class Wootook_Empire_Model_Planet - extends Wootook_Core_Mvc_Model_Entity + extends Wootook_Core_Entity { const TYPE_PLANET = 1; const TYPE_DEBRIS = 2; @@ -17,9 +17,9 @@ class Wootook_Empire_Model_Planet protected $_eventObject = 'planet'; /** - * @var Wootook_Player_Model_Entity + * @var Wootook_Empire_Model_User */ - protected $_player = null; + protected $_user = null; /** * @var Wootook_Empire_Model_Planet @@ -27,12 +27,7 @@ class Wootook_Empire_Model_Planet protected $_moon = null; /** - * @var Wootook_Empire_Model_Planet - */ - protected $_planet = null; - - /** - * @var Wootook_Empire_Model_Planet_Builder_Builder + * @var Wootook_Empire_Model_Planet_Builder */ protected $_builder = null; @@ -53,7 +48,6 @@ class Wootook_Empire_Model_Planet protected static $_productionInstances = array(); - /** @var Wootook_Empire_Model_Planet_PluginLoader */ protected $_pluginLoader = null; public static function factory($id) @@ -101,40 +95,31 @@ class Wootook_Empire_Model_Planet $coords['type'] = $type; } - $adapter = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection('core_read'); - $collection = new Wootook_Empire_Resource_Planet_Collection($adapter); - $collection->addCoordsToFilter($coords['galaxy'], $coords['system'], $coords['position'], $coords['type']) - ->setPage(1, 1) - ->load(); + $database = Wootook_Database::getSingleton(); + $collection = new Wootook_Core_Collection('planets'); + $collection + ->column('id') + ->where('galaxy=:galaxy') + ->where('system=:system') + ->where('planet=:position') + ->where('planet_type=:type') + ->limit(1) + ->load($coords) + ; - $planet = $collection->getFirstItem(); - if ($planet !== null) { - return $planet; + $planetData = $collection->getFirstItem(); + + if ($planetData === null || !$planetData->getData('id')) { + return new self(); } - return new self; - } - - public function __construct(Array $data = array(), Wootook_Player_Model_Entity $player = null) - { - parent::__construct($data); - - if ($player !== null) { - $this->setPlayer($player); - } + return self::factory($planetData->getData('id')); } public function _init() { $this->_tableName = 'planets'; $this->_idFieldName = 'id'; - - $this->getDataMapper() - ->addRule('last_update', 'date-time') - ->addRule('b_building', 'date-time') - ->addRule('b_tech', 'date-time') - ->addRule('b_hangar', 'date-time'); } public function __call($method, $params) @@ -143,33 +128,31 @@ class Wootook_Empire_Model_Planet $plugin = substr($method, 3); if ($this->_pluginLoader === null) { - $this->_pluginLoader = new Wootook_Empire_Model_Planet_PluginLoader($this, $this->getPlayer()); + $this->_pluginLoader = new Wootook_Empire_Model_Planet_PluginLoader($this, $this->getUser()); } switch ($prefix) { case 'get': - return $this->_pluginLoader->getPlugin($plugin); + $this->_pluginLoader->getPlugin($plugin); break; case 'set': - return $this->_pluginLoader->setPlugin($plugin, $params[0]); + $this->_pluginLoader->setPlugin($plugin, $params[0]); break; case 'uns': - return $this->_pluginLoader->unsetPlugin($plugin); + $this->_pluginLoader->unsetPlugin($plugin); break; case 'has': - return $this->_pluginLoader->hasPlugin($plugin); + $this->_pluginLoader->hasPlugin($plugin); + break; break; } - throw new Wootook_Core_Exception_RuntimeException(Wootook::__('Undefined method %s::%s.', get_class($this), $method)); + throw new InvalidMethodCall(Wootook::__('Undefined method %s::%s.', get_class($this), $method)); } - /** - * @return Wootook_Core_DateTime - */ public function getLastUpdate() { return $this->getData('last_update'); @@ -192,22 +175,18 @@ class Wootook_Empire_Model_Planet public function getGalaxyData() { - if ($this->isPlanet()) { - $entity = new Wootook_Empire_Model_Galaxy_Position(); - $entity->load(array('id_planet' => $this->getId())); + $entity = new Wootook_Empire_Model_Galaxy_Position(); + $entity->load(array('id_planet' => $this->getId())); - return $entity; - } - - return $this->getPlanet()->getGalaxyData(); + return $entity; } - public function updateStorages() + public function updateStorages($time = null) { Math::setPrecision(50); - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); foreach ($resources->getAllDatas() as $resource => $resourceData) { - if (!isset($resourceData['storage']) || $resourceData['storage'] === null) { + if (!isset($resourceData['storage_field']) || $resourceData['storage_field'] === null) { continue; } @@ -238,7 +217,7 @@ class Wootook_Empire_Model_Planet public function updateBuildingFields() { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); if ($this->isPlanet()) { $filter = Legacies_Empire::TYPE_BUILDING_PLANET; @@ -258,21 +237,17 @@ class Wootook_Empire_Model_Planet return $this; } - public function updateResourceProduction() + public function updateResourceProduction($time = null) { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); - $production = Wootook_Empire_Helper_Config_Production::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); + $production = Wootook_Empire_Model_Game_Production::getSingleton(); - if (!$this->isPlanet() || !$this->getPlayer()) { - return $this; + if ($time === null) { + $time = Wootook::now(); } - if ($this->getPlayer()->isVacation()) { - $resourceConfig = Wootook::getGameConfig('resource/base-income'); - foreach ($resources->getAllDatas() as $resource => $resourceData) { - $this->setData($resourceData['production_field'], $resourceConfig[$resource]); - } + if (!$this->isPlanet()) { return $this; } @@ -295,7 +270,7 @@ class Wootook_Empire_Model_Planet $ratio = $this->getData($ratioField); $element = self::getProductionElementInstance($productionUnit); - $productionRatios[$productionUnit] = $element->getProductionRatios($level, $ratio, $this, $this->getPlayer()); + $productionRatios[$productionUnit] = $element->getProductionRatios($level, $ratio, $this, $this->getUser()); foreach ($productionRatios[$productionUnit] as $resourceId => $resourceProduction) { $comp = Math::comp($resourceProduction, 0); if ($comp < 0) { @@ -364,7 +339,7 @@ class Wootook_Empire_Model_Planet // Dispatch 'planet.update-production.before' event Wootook::dispatchEvent($this->_eventPrefix . '.update-production.before', array( $this->_eventObject => $this, - 'player' => $this->getPlayer(), + 'user' => $this->getUser(), 'productions' => $actualProduction )); @@ -380,28 +355,27 @@ class Wootook_Empire_Model_Planet // Dispatch 'planet.update-production.after' event Wootook::dispatchEvent($this->_eventPrefix . '.update-production.after', array( $this->_eventObject => $this, - 'player' => $this->getPlayer() + 'user' => $this->getUser() )); return $this; } - public function updateResources(Wootook_Core_DateTime $time = null) + public function updateResources($time = null) { - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } - $timeDiff = $time->diff($this->getLastUpdate()); - + $timeDiff = ($time - $this->getLastUpdate()) / 3600; foreach ($resources->getAllDatas() as $resourceId => $resourceConfig) { if (!$resourceConfig['storage_field']) { continue; } - $production = Math::mul($this->getData($resourceConfig['production_field']), $timeDiff / 3600); + $production = Math::mul($this->getData($resourceConfig['production_field']), $timeDiff); $resourceValue = Math::add($this->getData($resourceConfig['field']), $production); $this->setData($resourceConfig['field'], Math::min($resourceValue, $this->getData($resourceConfig['storage_field']))); } @@ -412,13 +386,13 @@ class Wootook_Empire_Model_Planet public static function getProductionElementInstance($buildingId) { - $production = Wootook_Empire_Helper_Config_Production::getSingleton(); + $production = Wootook_Empire_Model_Game_Production::getSingleton(); if (!isset(self::$_productionInstances[$buildingId])) { if (!isset($production[$buildingId])) { return null; } - $class = $production[$buildingId]; + $class = $production[$buildingId][Legacies_Empire::RESOURCE_CLASS]; $reflection = new ReflectionClass($class); self::$_productionInstances[$buildingId] = $reflection->newInstance(); } @@ -428,30 +402,93 @@ class Wootook_Empire_Model_Planet public function getFleetCollection($time = null) { - $collection = new Wootook_Empire_Resource_Fleet_Collection($this->getReadConnection()); - $collection->addPlanetToFilter($this, $time); + $firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $firstCollection + ->column('*') + ->where('fleet.fleet_start_galaxy = :galaxy') + ->where('fleet.fleet_start_system = :system') + ->where('fleet.fleet_start_planet = :position') + ->where('fleet.fleet_start_type = :planet_type') + ; + $backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $backCollection + ->column('*') + ->where('fleet.fleet_end_galaxy = :galaxy') + ->where('fleet.fleet_end_system = :system') + ->where('fleet.fleet_end_planet = :position') + ->where('fleet.fleet_end_type = :planet_type') + ; + + $options = array( + 'galaxy' => $this->getSystem(), + 'system' => $this->getSystem(), + 'position' => $this->getPosition(), + 'planet_type' => $this->getType() + ); + + if ($time !== null) { + $options['now'] = $time; + $firstCollection->where('fleet_start_time <= :now'); + $backCollection->where('fleet_end_time <= :now'); + } + + $collection = new Wootook_Core_Collection(); + $collection + ->setEntityClassName('Wootook_Empire_Model_Fleet') + ->union($firstCollection) + ->union($backCollection) + ->load($options) + ; return $collection; } - public function getPlayerId() + public function getUserId() { return (int) $this->getData('id_owner'); } - public function getPlayer() + public function getUser() { - if ($this->_player === null && $this->getPlayerId()) { - $this->_player = new Wootook_Player_Model_Entity(); - $this->_player->load($this->getPlayerId()); + if ($this->_user === null && $this->getUserId()) { + $this->_user = Wootook_Empire_Model_User::factory($this->getUserId()); } - return $this->_player; + return $this->_user; } - public function setPlayer(Wootook_Player_Model_Entity $player) + public function setUser(Wootook_Empire_Model_User $user) { - $this->_player = $player; - $this->setData('id_owner', $player->getId()); + $this->_user = $user; + + return $this; + } + + public function getShipyard() + { + if ($this->_shipyard === null) { + $this->_shipyard = new Legacies_Empire_Model_Planet_Building_Shipyard($this, $this->getUser()); + } + return $this->_shipyard; + } + + public function setShipyard(Legacies_Empire_Model_Planet_Building_Shipyard $shipyard) + { + $this->_shipyard = $shipyard; + + return $this; + } + + public function getResearchLab() + { + if ($this->_laboratory === null) { + $this->_laboratory = new Legacies_Empire_Model_Planet_Building_ResearchLab($this, $this->getUser()); + } + return $this->_laboratory; + } + + public function setResearchLab(Legacies_Empire_Model_Planet_Building_ResearchLab $laboratory) + { + $this->_laboratory = $laboratory; return $this; } @@ -473,60 +510,31 @@ class Wootook_Empire_Model_Planet public function getMoon() { + static $statement = null; + if ($this->isMoon()) { return null; } if ($this->_moon === null) { - $collection = new Wootook_Empire_Resource_Planet_Collection($this->getReadConnection()); - $collection->addFieldToFilter('galaxy', $this->getGalaxy()) - ->addFieldToFilter('system', $this->getGalaxy()) - ->addFieldToFilter('planet', $this->getPosition()) - ->addFieldToFilter('planet_type', self::TYPE_MOON) - ->load() - ; - - $this->_moon = $collection->getFirstItem(); - - if ($this->_moon !== null && $this->_moon instanceof self) { - $this->_moon->setPlanet($this); + if ($statement === null) { + $statement = new Wootook_Core_Collection(array('planet' => 'planets'), get_class($this)); + $statement + ->where('galaxy=:galaxy') + ->where('system=:system') + ->where('planet=:position') + ->where('planet_type=' . strval(self::TYPE_MOON)) + ; } - } - return $this->_moon; - } - - public function setMoon(Wootook_Empire_Model_Planet $moon) - { - $this->_moon = $moon; - - return $this; - } - - public function getPlanet() - { - if ($this->isPlanet()) { - return null; - } - - if ($this->_planet === null) { - $this->_planet = Wootook_Empire_Model_Planet::factoryFromCoords(array( + $statement->load(array( 'galaxy' => $this->getGalaxy(), 'system' => $this->getSystem(), 'position' => $this->getPosition() )); - if ($this->_planet !== null && $this->_planet instanceof self) { - $this->_planet->setMoon($this); - } + $this->_moon = $statement->current(); } - return $this->_planet; - } - - public function setPlanet(Wootook_Empire_Model_Planet $planet) - { - $this->_planet = $planet; - - return $this; + return $this->_moon; } public function setGalaxy($galaxy) @@ -606,7 +614,7 @@ class Wootook_Empire_Model_Planet public function isDestroyed() { - return (bool) ($this->getData('destruyed') > 0); + return (bool) $this->getData('destruyed'); } public function destroy() @@ -616,23 +624,23 @@ class Wootook_Empire_Model_Planet } if ($this->isDestroyed()) { - throw new Wootook_Empire_Exception_Planet(Wootook::__('Planet is already destroyed.')); + throw new Wootook_Empire_Model_Planet_Exception(Wootook::__('Planet is already destroyed.')); } if ($this->getFleetCollection()->count() > 0) { - throw new Wootook_Empire_Exception_Planet(Wootook::__("Could not delete planet until fleets aten't retuned.")); + throw new Wootook_Empire_Model_Planet_Exception(Wootook::__("Could not delete planet until fleets aten't retuned.")); } - $player = $this->getPlayer(); - if ($player->getHomePlanet()->getId() == $this->getId()) { - throw new Wootook_Empire_Exception_Planet(Wootook::__("You can't destroy your home planet.")); + $user = $this->getUser(); + if ($user->getHomePlanet()->getId() == $this->getId()) { + throw new Wootook_Empire_Model_Planet_Exception(Wootook::__("You can't destroy your home planet.")); } - if ($player->getCurrentPlanet()->getId() == $this->getId()) { - $homePlanet = $player->getHomePlanet(); + if ($user->getCurrentPlanet()->getId() == $this->getId()) { + $homePlanet = $user->getHomePlanet(); if ($homePlanet !== null) { - $player->updateCurrentPlanet($homePlanet); + $user->updateCurrentPlanet($homePlanet); } } @@ -641,49 +649,41 @@ class Wootook_Empire_Model_Planet } $this - ->setData('destruyed', time() + 172800) + ->setData('destruyed', true) ->setData('id_owner', 0) ->save(); return $this; } - public function isErasable() - { - if ($this->isDestroyed() && $this->getData('destruyed') >= time()) { - return true; - } - return false; - } - public function getElement($elementId) { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); return $this->getData($fields[$elementId]); } public function setElement($elementId, $level) { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); return $this->setData($fields[$elementId], $level); } public function hasElement($elementId, $levelRequired = 0) { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); return $this->hasData($fields[$elementId]) && Math::comp($this->getElement($elementId), $levelRequired) > 0; } - public function appendBuildingQueue($buildingId, $destroy = false, Wootook_Core_DateTime $time = null) + public function appendBuildingQueue($buildingId, $destroy = false, $time = null) { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } if (!$types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) { @@ -699,7 +699,7 @@ class Wootook_Empire_Model_Planet 'bulding_id' => $buildingId, 'level' => $this->getElement($buildingId), $this->_eventObject => $this, - 'player' => $this->getPlayer(), + 'user' => $this->getUser(), 'destroy' => $destroy )); @@ -716,24 +716,24 @@ class Wootook_Empire_Model_Planet 'bulding_id' => $buildingId, 'level' => $this->getElement($buildingId), $this->_eventObject => $this, - 'player' => $this->getPlayer(), + 'user' => $this->getUser(), 'destroy' => $destroy )); return $this; } - public function updateBuildingQueue(Wootook_Core_DateTime $time = null) + public function updateBuildingQueue($time = null) { if ($time === null) { - $time = new Wootook_Core_DateTime(); + $time = Wootook::now(); } // Dispatch event Wootook::dispatchEvent($this->_eventPrefix . '.update-queue.before', array( 'time' => &$time, - $this->_eventObject => $this, - 'player' => $this->getPlayer() + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); $this->getBuildingQueue()->updateQueue($time); @@ -741,8 +741,9 @@ class Wootook_Empire_Model_Planet // Dispatch event Wootook::dispatchEvent($this->_eventPrefix . '.update-queue.after', array( 'time' => $time, - $this->_eventObject => $this, - 'player' => $this->getPlayer() + 'shipyard' => $this, + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); return $this; @@ -763,12 +764,12 @@ class Wootook_Empire_Model_Planet /** * - * @return Wootook_Empire_Model_Planet_Builder_Builder + * @return Wootook_Empire_Model_Planet_Builder */ public function getBuildingQueue() { - if ($this->_builder === null && $this->getPlayer()) { - $this->_builder = new Wootook_Empire_Model_Planet_Builder_Builder($this, $this->getPlayer()); + if ($this->_builder === null) { + $this->_builder = new Wootook_Empire_Model_Planet_Builder($this, $this->getUser()); } return $this->_builder; } @@ -783,7 +784,7 @@ class Wootook_Empire_Model_Planet $this->getBuildingQueue()->rewind(); $item = $this->getBuildingQueue()->current(); - $this->getBuildingQueue()->dequeueFirstItem(new Wootook_Core_DateTime()); + $this->getBuildingQueue()->dequeueFirstItem(Wootook::now()); return $this; } @@ -809,17 +810,15 @@ class Wootook_Empire_Model_Planet */ public function checkAvailability($buildingId) { - if (!$this->getBuildingQueue()->checkAvailability($buildingId)) { - return false; - } + $this->getBuildingQueue()->checkAvailability($buildingId); try { // Dispatch event. Throw an exception to break the avaliability. Wootook::dispatchEvent($this->_eventPrefix . '.check-availability', array( 'ship_id' => $buildingId, 'shipyard' => $this, - $this->_eventObject => $this, - 'player' => $this->getPlayer() + $this->_eventObject => $this->_currentPlanet, + 'user' => $this->_currentUser )); } catch (Exception $e) { return false; @@ -850,53 +849,129 @@ class Wootook_Empire_Model_Planet return $this->getBuildingQueue()->getBuildingTime($buildingId, $level); } + public static function registrationListener($eventData) + { + if (isset($eventData['user'])) { + $user = $eventData['user']; + + if ($user === null || !$user instanceof Wootook_Empire_Model_User || !$user->getId()) { + return; + } + + $collection = self::searchMostFreeSystems(); + $collection->limit(1)->load(); + + if ($collection->count() == 0) { + throw new Exception('No more planet to colonize!'); // Oops, no more free place + } + + $systemInfo = $collection->current(); + if ($systemInfo->getData('count') >= MAX_PLANET_IN_SYSTEM) { + throw new Exception('No more planet to colonize!'); // Oops, no more free place + } + + $collection = new Wootook_Core_Collection(array('planet' => 'planets')); + $collection + ->column(array('position' => 'planet.planet')) + ->where('planet.planet_type=1') + ->where('planet.galaxy=:galaxy') + ->where('planet.system=:system') + ->load(array( + 'galaxy' => $systemInfo->getData('galaxy'), + 'system' => $systemInfo->getData('system'), + )) + ; + $positions = range(1, MAX_PLANET_IN_SYSTEM); + foreach ($collection as $planet) { + $key = array_search($planet->getData('position'), $positions); + if ($key !== false) { + unset($positions[$key]); + } + } + $key = array_rand($positions, 1); + $finalPosition = $positions[$key]; + + $config = Wootook_Core_Model_Config::getSingleton(); + $planet = new self(); + $planet + ->setData('id_owner', $user->getId()) + ->setData('name', Wootook::getRequest()->getParam('planet')) + ->setData('galaxy', $systemInfo->getData('galaxy')) + ->setData('system', $systemInfo->getData('system')) + ->setData('planet', $finalPosition) + ->setData('planet_type', 1) + ->setData('field_max', $config->getData('initial_fields')) + ->setData('field_current', 0) + ->setData('metal', 500) // TODO: use config + ->setData('cristal', 500) // TODO: use config + ; + + $planet->save(); + + $user + ->setData('id_planet', $planet->getId()) + ->setData('current_planet', $planet->getId()) + ->setData('galaxy', $planet->getGalaxy()) + ->setData('system', $planet->getSystem()) + ->setData('planet', $planet->getPosition()) + ; + + Wootook::dispatchEvent('planet.init', array( + 'planet' => $planet, + 'user' => $user + )); + + $planet->save(); + } + } + public static function searchMostFreeSystems($galaxyList = null, $systemList = null) { - $adapter = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection('core_read'); - $select = $adapter->select(array('galaxy' => $adapter->getTable('galaxy'))); - $select + $collection = new Wootook_Core_Collection(array('galaxy' => 'galaxy')); + $collection ->column(array( - 'galaxy' => 'galaxy', - 'system' => 'system', - 'count' => new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)') + 'galaxy' => 'galaxy.galaxy', + 'system' => 'galaxy.system', + 'count' => 'COUNT(*)' )) ->group('galaxy.galaxy') ->group('galaxy.system') ; - if ($galaxyList === null && Wootook::getGameConfig('user/registration/galaxy_list')) { - $galaxyList = explode(',', Wootook::getGameConfig('user/registration/galaxy_list')); + $config = Wootook_Core_Model_Config::getSingleton(); + + if ($galaxyList === null && $config->hasData('user/registration/galaxy_list')) { + $galaxyList = explode(',', $config->getData('user/registration/galaxy_list')); } if ($galaxyList !== null) { array_walk($galaxyList, array(__CLASS__, '_cleanItemRanges')); - $select->where('galaxy', array(array(Wootook_Core_Database_Sql_Select::OPERATOR_IN => $galaxyList))); + $collection->where('galaxy.galaxy IN(' . implode(', ', $galaxyList) . ')'); } - if ($systemList === null && Wootook::getGameConfig('user/registration/system_list')) { - $systemList = explode(',', Wootook::getGameConfig('user/registration/system_list')); + if ($systemList === null && $config->hasData('user/registration/system_list')) { + $systemList = explode(',', $config->getData('user/registration/system_list')); } if ($systemList !== null) { array_walk($systemList, array(__CLASS__, '_cleanItemRanges')); - $select->where('system', array(array(Wootook_Core_Database_Sql_Select::OPERATOR_IN => $systemList))); + $collection->where('galaxy.system IN(' . implode(', ', $systemList) . ')'); } $orders = array( - "COUNT(*) / {$adapter->quote(Wootook::getGameConfig('engine/universe/positions'))}", - "1 + ABS(galaxy.galaxy - CEIL({$adapter->quote(Wootook::getGameConfig('engine/universe/galaxies'))} / 2))", - "1 + 2 * ABS(galaxy.system - CEIL({$adapter->quote(Wootook::getGameConfig('engine/universe/systems'))} / 2))", + "COUNT(*) / {$collection->quote(MAX_PLANET_IN_SYSTEM)}", + "1 + ABS(galaxy.galaxy - CEIL({$collection->quote(MAX_GALAXY_IN_WORLD)} / 2))", + "1 + 2 * ABS(galaxy.system - CEIL({$collection->quote(MAX_SYSTEM_IN_GALAXY)} / 2))", "RAND() / 1000", ); - $select - ->order(new Wootook_Core_Database_Sql_Placeholder_Expression('((' . implode(') * (', $orders) . '))'), 'ASC') - //->order("ABS(galaxy.system - CEIL({$collection->quote(Wootook::getGameConfig('engine/universe/systems'))} / 2))", 'ASC') - //->order("ABS(galaxy.galaxy - CEIL({$collection->quote(Wootook::getGameConfig('engine/universe/galaxies'))} / 2))", 'ASC') + $collection + ->order('((' . implode(') * (', $orders) . '))', 'ASC') + //->order("ABS(galaxy.system - CEIL({$collection->quote(MAX_SYSTEM_IN_GALAXY)} / 2))", 'ASC') + //->order("ABS(galaxy.galaxy - CEIL({$collection->quote(MAX_GALAXY_IN_WORLD)} / 2))", 'ASC') //->order("1.5 / COUNT(*)", 'ASC') ->order('RAND()', 'ASC'); - return $select; + return $collection; } private static function _cleanItemRanges(&$value, $index, $userdata = null) @@ -904,32 +979,6 @@ class Wootook_Empire_Model_Planet return intval($value); } - public static function planetChangeListener($eventData) - { - if (!isset($eventData['request']) || !$eventData['request'] instanceof Wootook_Core_Mvc_Controller_Request_Http) { - return; - } - - /** @var Wootook_Core_Mvc_Controller_Request_Http $request */ - $request = $eventData['request']; - if (!($planetId = $request->getQuery('___planet'))) { - return; - } - - $session = Wootook_Player_Model_Session::getSingleton(); - if (!$session->isLoggedIn()) { - return; - } - $planet = new Wootook_Empire_Model_Planet(); - $planet->load($planetId); - if (!$planet->getId()) { - return; - } - - $player = $session->getPlayer(); - $player->setCurrentPlanet($planet); - } - public static function planetUpdateListener($eventData) { if (isset($eventData['planet'])) { @@ -938,10 +987,7 @@ class Wootook_Empire_Model_Planet if (isset($eventData['time'])) { $time = $eventData['time']; } else { - $time = new Wootook_Core_DateTime(); - } - if (!$time instanceof Wootook_Core_DateTime) { - $time = new Wootook_Core_DateTime($time); + $time = time(); } if ($planet === null || !$planet instanceof Wootook_Empire_Model_Planet) { @@ -950,17 +996,14 @@ class Wootook_Empire_Model_Planet $planet->updateBuildingQueue($time); $planet->updateResources($time); - $planet->getShipyard()->updateQueue($time); // FIXME : update all plugin queues - $planet->getResearchLab()->updateQueue($time); // FIXME : update all plugin queues + $planet->getShipyard()->updateQueue($time); $planet->setLastUpdate($time); - - $planet->getPlayer()->save(); } } public function getResourceAmount($resourceType) { - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); $resourceConfig = $resources->getData($resourceType); if ($resourceConfig === null) { @@ -971,7 +1014,7 @@ class Wootook_Empire_Model_Planet public function getResourceCap($resourceType) { - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); $resourceConfig = $resources->getData($resourceType); if ($resourceConfig === null) { @@ -991,4 +1034,4 @@ class Wootook_Empire_Model_Planet } return false; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php b/application/code/core/Wootook/Empire/Model/Planet/Builder.php similarity index 59% rename from src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php rename to application/code/core/Wootook/Empire/Model/Planet/Builder.php index eddf545..d696c8c 100644 --- a/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Builder.php +++ b/application/code/core/Wootook/Empire/Model/Planet/Builder.php @@ -1,59 +1,11 @@ - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * - * Enter description here ... - * @author Greg - * - */ -class Wootook_Empire_Model_Planet_Builder_Builder +class Wootook_Empire_Model_Planet_Builder extends Wootook_Empire_Model_BuilderAbstract { - const FIELD_SERIALIZED = 'b_building_id'; - - /** - * @var int - */ - protected $_maxLength = 0; - - /** - * @var float - */ - protected $_speedEnhancement = null; - public function init() { - $this->_unserializeQueue($this->_currentPlanet->getData(self::FIELD_SERIALIZED)); - - $this->_maxLength = Wootook::getGameConfig('engine/core/buildings_queue_size'); + $this->_unserializeQueue($this->_currentPlanet->getData('b_building_id')); } /** @@ -69,7 +21,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder $level = $params['level']; if (!isset($params['created_at'])) { - $createdAt = new Wootook_Core_DateTime(); + $createdAt = time(); } else { $createdAt = $params['created_at']; } @@ -95,60 +47,36 @@ class Wootook_Empire_Model_Planet_Builder_Builder )); } - public function getSpeedEnhancement() - { - if ($this->_speedEnhancement === null) { - $event = Wootook::dispatchEvent('planet.building.speed-enhancement', array( - 'player' => $this->_currentPlanet, - 'planet' => $this->_currentPlanet, - 'enhancement' => 1 - )); - - $this->_speedEnhancement = $event->getData('enhancement'); - } - - return $this->_speedEnhancement; - } - /** * Check if a building is actually buildable on the current planet, * depending on the technology and buildings requirements. * - * @param int|string $buildingId + * @param int $buildingId * @return bool */ public function checkAvailability($buildingId) { - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); - if (!$types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) { - return false; + if ($types->is($buildingId, Legacies_Empire::TYPE_BUILDING)) { + return true; } - return parent::checkAvailability($buildingId); + return false; } - /** - * Returns the time needed to build $level of $buildingId - * - * @param int|string $buildingId - * @param int $level - */ public function getBuildingTime($buildingId, $level) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $gameConfig = Wootook_Core_Model_Config::getSingleton(); Math::setPrecision(50); $firstLevelTime = $prices[$buildingId][Legacies_Empire::BASE_BUILDING_TIME]; $partialLevelTime = Math::mul($firstLevelTime, Math::pow($prices[$buildingId][Legacies_Empire::RESOURCE_MULTIPLIER], $level)); $levelTime = Math::sub($partialLevelTime, $firstLevelTime); - $speedFactor = Wootook::getGameConfig('game/speed/general'); - - if ($speedFactor == null) { - $speedFactor = 1; - } - $baseTime = Math::div($levelTime, 3600 / ($speedFactor * $this->getSpeedEnhancement())); + $speedFactor = $gameConfig->getData('game_speed'); + $baseTime = $levelTime / $speedFactor * 3600; Math::setPrecision(); @@ -156,7 +84,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder 'time' => $baseTime, 'base_time' => $baseTime, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer, + 'user' => $this->_currentUser, 'building_id' => $buildingId, 'level' => $level )); @@ -164,14 +92,10 @@ class Wootook_Empire_Model_Planet_Builder_Builder return $event->getData('time'); } - /** - * (non-PHPdoc) - * @see Legacies_Empire_Model_BuilderAbstract::getResourcesNeeded() - */ public function getResourcesNeeded($buildingId, $level) { - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); - $resources = Wootook_Empire_Helper_Config_Resources::getSingleton(); + $prices = Wootook_Empire_Model_Game_Prices::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); if (!isset($prices[$buildingId])) { return array(); @@ -193,56 +117,54 @@ class Wootook_Empire_Model_Planet_Builder_Builder /** * Update the contruction queue. * - * @return Wootook_Empire_Model_Planet_Builder_Builder + * @return Wootook_Empire_Model_Planet_Building_Shipyard */ - public function updateQueue(Wootook_Core_DateTime $time) + public function updateQueue($time) { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); - $startingTime = clone $this->_currentPlanet->getData('b_building'); + $startingTime = $this->_currentPlanet->getData('b_building'); foreach ($this->getQueue() as $element) { $elementTime = $element->getData('started_at'); if ($elementTime === null) { - $element->setData('started_at', $startingTime->getTimestamp()); - $elementTime = $startingTime->getTimestamp(); + $element->setData('started_at', $startingTime); + $elementTime = $startingTime; } $level = $element->getData('level'); $buildingId = $element->getData('building_id'); $buildTime = $this->getBuildingTime($buildingId, $level); - $elapsedTime = $time->getTimestamp() - $elementTime; + $elapsedTime = $time - $elementTime; if ($elapsedTime >= $buildTime) { - $this->dequeue($element); - - $currentTime = clone $startingTime; - $currentTime->add($elapsedTime); - - $this->_currentPlanet->updateResources($currentTime); + $this->_currentPlanet->updateResources($time - $elapsedTime); $this->_currentPlanet->setElement($buildingId, $level); - $this->_currentPlanet->updateStorages($currentTime); - $this->_currentPlanet->updateResourceProduction($currentTime); + $this->_currentPlanet->updateResourceProduction($time - $elapsedTime); + $this->_currentPlanet->updateStorages($time - $elapsedTime); $this->_currentPlanet->updateBuildingFields(); + $this->dequeue($element); + Wootook::dispatchEvent('planet.building.level-update', array( - 'time' => $currentTime, + 'time' => $time - $elapsedTime, 'planet' => $this->_currentPlanet, - 'player' => $this->_currentPlayer, + 'user' => $this->_currentUser, 'building_id' => $buildingId, 'level' => $level )); - $startingTime->set($elementTime + $buildTime); + $startingTime = $elementTime + $buildTime; continue; } + $element->setData('updated_at', $time); break; } $this->_currentPlanet->setData('b_building_id', $this->serialize()); - $this->_currentPlanet->setData('b_building', $startingTime->now()); + $this->_currentPlanet->setData('b_building', $startingTime); return $this; } @@ -250,17 +172,14 @@ class Wootook_Empire_Model_Planet_Builder_Builder /** * Append items to build to the construction list * - * @param int|string $buildingId - * @param int $level - * @return Wootook_Empire_Model_Planet_Builder_Builder + * @param int $buildingId + * @param int|string $level + * @return Wootook_Empire_Model_Planet_Building_Shipyard */ - public function appendQueue($buildingId, $level, Wootook_Core_DateTime $time) + public function appendQueue($buildingId, $level, $time) { - if ($this->_maxLength > 0 && $this->count() >= $this->_maxLength) { - return $this; - } - - $types = Wootook_Empire_Helper_Config_Types::getSingleton(); + $types = Wootook_Empire_Model_Game_Types::getSingleton(); + $resources = Wootook_Empire_Model_Game_Resources::getSingleton(); if (!Math::isPositive($level)) { return $this; @@ -287,7 +206,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder $this->enqueue(array( 'building_id' => $buildingId, 'level' => $level, - 'created_at' => $time->getTimestamp() + 'created_at' => $time )); $this->_currentPlanet->setData('b_building_id', $this->serialize()); @@ -302,7 +221,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder * Dequeues the first item to build to the construction list and removes all * its successors of the same type. * - * @return Wootook_Empire_Model_Planet_Builder_Builder + * @return Wootook_Empire_Model_Planet_Builder */ public function dequeueFirstItem() { @@ -317,7 +236,7 @@ class Wootook_Empire_Model_Planet_Builder_Builder * successors of the same type. * * @param string $itemId - * @return Wootook_Empire_Model_Planet_Builder_Builder + * @return Wootook_Empire_Model_Planet_Builder */ public function dequeueItem($itemId) { @@ -350,4 +269,4 @@ class Wootook_Empire_Model_Planet_Builder_Builder return $this; } -} +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/Builder/Item.php b/application/code/core/Wootook/Empire/Model/Planet/Builder/Item.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Model/Planet/Builder/Item.php rename to application/code/core/Wootook/Empire/Model/Planet/Builder/Item.php diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/BuildingInterface.php b/application/code/core/Wootook/Empire/Model/Planet/BuildingInterface.php similarity index 100% rename from src/application/code/core/Wootook/Empire/Model/Planet/BuildingInterface.php rename to application/code/core/Wootook/Empire/Model/Planet/BuildingInterface.php diff --git a/application/code/core/Wootook/Empire/Model/Planet/Exception.php b/application/code/core/Wootook/Empire/Model/Planet/Exception.php new file mode 100644 index 0000000..206a600 --- /dev/null +++ b/application/code/core/Wootook/Empire/Model/Planet/Exception.php @@ -0,0 +1,3 @@ +_currentUser = $currentUser; + $this->_currentPlanet = $currentPlanet; + } + + protected function _load($className, $useSingleton) + { + $reflection = new ClassReflection($className); + if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) { + $method = $reflection->getMethod('getSingleton'); + $method->invoke(); + } + + try { + return $reflection->invoke($this->_currentPlanet, $this->_currentUser); + } catch (ReflectionException $e) { + return null; + } + } +} diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php b/application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php similarity index 87% rename from src/application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php rename to application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php index 9556195..371fb09 100644 --- a/src/application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php +++ b/application/code/core/Wootook/Empire/Model/Planet/ResourceProductionInterface.php @@ -2,5 +2,5 @@ interface Wootook_Empire_Model_Planet_ResourceProductionInterface { - public function getProductionRatios($level, $produtionRatio, $planet, $player); + public function getProductionRatios($level, $produtionRatio, $planet, $user); } \ No newline at end of file diff --git a/application/code/core/Wootook/Empire/Model/Planet/ShipAbstract.php b/application/code/core/Wootook/Empire/Model/Planet/ShipAbstract.php new file mode 100644 index 0000000..6b74645 --- /dev/null +++ b/application/code/core/Wootook/Empire/Model/Planet/ShipAbstract.php @@ -0,0 +1,27 @@ +getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); + } + + public function getActualSpeed(Wootook_Empire_Model_User $user) + { + return $this->getBaseSpeed($user) * $this->getSpeedMultiplier($user); + } + + public function getActualConsumption(Wootook_Empire_Model_User $user, $speed) + { + return $this->getBaseConsumption($user) * ($speed / 100) * $this->getSpeedMultiplier($user); + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php b/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php new file mode 100644 index 0000000..81c54cc --- /dev/null +++ b/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php @@ -0,0 +1,11 @@ +getData('username'); + } + + public static function getSingleton() + { + if (self::$_singleton === null) { + $session = Wootook::getSession(self::SESSION_KEY); + if ($session->hasData('user_id')) { + $id = intval($session->getData('user_id')); + } else if (Wootook::getRequest() !== null && ($cookieData = Wootook::getRequest()->getCookie(self::$_cookieName)) !== null) { + //$cookieData = unserialize(stripslashes($cookie)); + if (is_array($cookieData)) { + $collection = new Wootook_Core_Collection(array('user' => 'users')); + $cookieData = array( + 'id' => (isset($cookieData['id']) ? intval($cookieData['id']) : 0), + 'key' => (isset($cookieData['key']) ? $collection->quote($cookieData['key']) : null) + ); + + $collection + ->column('id') + ->where('user.id=:id') + ->where(':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))') + ->load($cookieData) + ; + + if ($collection->count() > 0) { + $session->setData(self::SESSION_KEY, $cookieData['id']); + } else { + $session->addError('Your session has expired, please login.'); + return null; + } + } + } else { + $session->addError('Your session has expired, please login.'); + return null; + } + + try { + self::$_singleton = self::factory($id); + } catch (Wootook_Core_Exception_DataAccessException $e) { + $session->addError('Session error.'); + return null; + } + self::$_singleton->_updateActivity(); + } + return self::$_singleton; + } + + public static function hash($password, $salt = null) + { + if ($salt === null) { + return call_user_func(self::$hashCallback, ($password)); + } + + return call_user_func(self::$hashCallback, ($password . $salt)); + } + + protected function _init() + { + $this->setIdFieldName('id'); + $this->setTableName('users'); + } + + protected function _updateActivity() + { + $this + ->setData('current_page', $_SERVER['REQUEST_URI']) + ->setData('user_lastip', $_SERVER['REMOTE_ADDR']) + ->setData('user_agent', $_SERVER['HTTP_USER_AGENT']) + ->setData('onlinetime', time()) + ->save() + ; + return $this; + } + + public function logout() + { + Wootook::getResponse()->unsetCookie(self::$_cookieName); + Wootook_Core_Model_Session::destroy(); + } + + public static function login($username, $password, $remember = false) + { + $session = Wootook::getSession(self::SESSION_KEY); + + try { + $collection = new Wootook_Core_Collection(array('user' => 'users')); + + $passwordHash = md5($password); + $collection + ->column('user.id') + ->column('user.username') + ->column('user.password') + ->column('user.banaday') + ->column('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt))) AS login_rememberme') + ->column('(CASE WHEN user.password="' . $passwordHash . '" THEN 1 ELSE 0 END) AS login_success') + ->where('user.username=:username') + ->load(array( + 'username' => $username + )) + ; + } catch (Wootook_Core_Exception_DataAccessException $e) { + Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); + $session->addError('No such user.'); + return null; + } + + if ($collection->count() <= 0) { + $session->addError('No such user.'); + return null; + } + $login = $collection->current(); + + if (intval($login['login_success']) == 1) { + if ($login['banaday'] != 0) { + if($login['banaday'] <= time()) { + $user->setData('banaday', 0) + ->setData('bana', 0) + ->setData('urlaubs_modus', 0) + ->save() + ; + } else { + $session->addError('You were banned, please contact admin for more information.'); + return null; + } + } + + if (isset($_POST["rememberme"]) && Wootook::getResponse() !== null) { + Wootook::getResponse()->setCookie(self::$_cookieName, array('id' => $login['id'], 'key' => $login['login_rememberme']), self::COOKIE_LIFETIME); + } + + self::$_singleton = self::factory($login['id']); + self::$_singleton->_updateActivity(); + + $session->setData('user_id', intval($login['id'])); + + return self::$_singleton; + } + + $session->addError('Your username or credential is invalid, please check your input.'); + return null; + } + + public static function register($username, $email, $password) + { + try { + $request = Wootook::getRequest(); + $user = new self(array( + 'username' => $username, + 'password' => md5($password), + 'email' => $email, + 'email_2' => $email, + + 'register_time' => Wootook::now(), + 'onlinetime' => Wootook::now(), + 'ip_at_reg' => $request->getServer('REMOTE_ADDR'), + 'user_lastip' => $request->getServer('REMOTE_ADDR'), + 'user_agent' => $request->getServer('HTTP_USER_AGENT') + )); + + $user->save(); + + Wootook::dispatchEvent('user.init', array( + 'user' => $user + )); + + $user->save(); + } catch (Wootook_Core_Exception_DataAccessException $e) { + $session = Wootook_Core_Model_Session::factory(Wootook_Empire_Model_User::SESSION_KEY); + + trigger_error($e->getMessage(), E_USER_ERROR); + $session->addError($e->getMessage()); + return null; + } + + return $user; + } + + /** + * + * Enter description here ... + * @param int|Wootook_Empire_Model_Planet $planet + */ + public function updateCurrentPlanet($planet) + { + if (!$planet instanceof Wootook_Empire_Model_Planet) { + $planetCollection = $this->_preparePlanetCollection()->where('id=:id'); + + $planetCollection->load(array( + 'id' => $planet, + 'user' => $this->getId() + )); + + if ($planetCollection->count() !== 1) { + return $this; + } + + $planet = $planetCollection->current(); + } + + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return $this; + } + + $this->setData('current_planet', $planet->getId())->save(); + + return $this; + } + + /** + * + * Enter description here ... + * @param Wootook_Empire_Model_Planet $planet + */ + public function setHomePlanet(Wootook_Empire_Model_Planet $planet) + { + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return $this; + } + + $this->setData('id_planet', $planet->getId()); + $this->_homePlanet = $planet; + + return $this; + } + + /** + * + * Enter description here ... + * @param Wootook_Empire_Model_Planet $planet + */ + public function setCurrentPlanet(Wootook_Empire_Model_Planet $planet) + { + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return $this; + } + + $this->setData('current_planet', $planet->getId()); + $this->_currentPlanet = $planet; + + return $this; + } + + /** + * + * Enter description here ... + * @return Wootook_Empire_Model_Planet + */ + public function getHomePlanet() + { + if ($this->_homePlanet === null) { + $planetId = $this->getData('id_planet'); + if (!$planetId) { + return null; + } + + $planet = Wootook_Empire_Model_Planet::factory($planetId); + + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + return null; + } + + $this->_homePlanet = $planet; + } + + return $planet; + } + + /** + * + * Enter description here ... + * @return Wootook_Empire_Model_Planet + */ + public function getCurrentPlanet() + { + if ($this->_currentPlanet === null) { + $planetId = $this->getData('current_planet'); + + if (!$planetId) { + $this->_currentPlanet = $this->getHomePlanet(); + $this->setData('current_planet', $this->_currentPlanet->getId())->save(); + + return $this->_currentPlanet; + } + + $planet = Wootook_Empire_Model_Planet::factory($planetId); + + if ($planet->getUserId() != $this->getId() || $planet->isDestroyed()) { + $this->_currentPlanet = $this->getHomePlanet(); + $this->setData('current_planet', $this->_currentPlanet->getId())->save(); + + return $this->_currentPlanet; + } + + $this->_currentPlanet = $planet; + } + + return $this->_currentPlanet; + } + + protected function _preparePlanetCollection() + { + $planetCollection = new Wootook_Core_Collection(array('planet' => 'planets'), 'Wootook_Empire_Model_Planet'); + $planetCollection->where('id_owner=:user'); + + $order = ($this->getData('planet_sort_order') == 1) ? 'DESC' : 'ASC'; + + switch ($this->getData('planet_sort')) { + case self::PLANET_SORT_POSITION: + $planetCollection + ->order('planet.galaxy', $order) + ->order('planet.system', $order) + ->order('planet.planet', $order) + ->order('planet.planet_type', $order) + ; + break; + + case self::PLANET_SORT_NAME: + $planetCollection->order('planet.name', $order); + break; + + case self::PLANET_SORT_DATE: + default: + $planetCollection->order('planet.id', $order); + break; + } + return $planetCollection; + } + + public function getPlanetCollection(Array $typeFilter = array()) + { + $planetCollection = $this->_preparePlanetCollection(); + + if (!empty($typeFilter)) { + $planetCollection->where('planet.planet_type IN(' . implode(',', $typeFilter) . ')'); + } + + $planetCollection->load(array( + 'user' => $this->getId() + )); + + return $planetCollection; + } + + protected function _prepareFleetCollection() + { + $collection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $collection + ->setEntityClassName('Wootook_Empire_Model_Fleet') + ->where('fleet_owner <= :user_id') + ; + return $collection; + } + + public function getFleets() + { + return $this->_prepareFleetCollection()->load(array('user_id' => $this->getId())); + } + + public function getFleetCount() + { + return $this->_prepareFleetCollection()->getSize(array('user_id' => $this->getId())); + } + + public function getVisibleFleets() + { + + $user = Wootook_Empire_Model_User::getSingleton(); + $firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $firstCollection +// ->column('*') + ->column('fleet.fleet_start_galaxy', 'galaxy') + ->column('fleet.fleet_start_system', 'system') + ->column('fleet.fleet_start_planet', 'planet') + ->column('fleet.fleet_start_type', 'planet_type') + ->where('fleet_end_time <= :now') + ; + $backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $backCollection +// ->column('*') + ->column('fleet.fleet_end_galaxy', 'galaxy') + ->column('fleet.fleet_end_system', 'system') + ->column('fleet.fleet_end_planet', 'planet') + ->column('fleet.fleet_end_type', 'planet_type') + ->where('fleet_end_time <= :now') + ; + $collection = new Wootook_Core_Collection(); + $collection + ->setEntityClassName('Wootook_Empire_Model_Fleet') + ->union($firstCollection) + ->union($backCollection) + ->load(array('now' => time())); + + return $collection; + } + + public function getElement($elementId) + { + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); + + return $this->getData($fields[$elementId]); + } + + public function setElement($elementId, $level) + { + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); + + return $this->setData($fields[$elementId], $level); + } + + public function hasElement($elementId, $levelRequired = 0) + { + $fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton(); + + return $this->hasData($fields[$elementId]) && Math::comp($this->getElement($elementId), $levelRequired) > 0; + } + + public function getSkinPath($default = null) + { + if ($path = $this->getData('dpath')) { + return $path; + } + return $default; + } + + public function setSkinPath($path) + { + $this->setData('dpath', $path); + + return $this; + } + + public function checkPassword($password) + { + if (self::hash($password) == $this->getData('password')) { + return true; + } + return false; + } + + public function getFleetCollection($time = null) + { + $firstCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $firstCollection + ->column('*') + ->where('fleet.fleet_owner = :user') + ; + $backCollection = new Wootook_Core_Collection(array('fleet' => 'fleets')); + $backCollection + ->column('*') + ->where('fleet.fleet_target_owner = :user') + ; + + $options = array( + 'user' => $this->getId() + ); + + if ($time !== null) { + $options['now'] = $time; + $firstCollection->where('fleet_start_time <= :now'); + $backCollection->where('fleet_end_time <= :now'); + } + + $collection = new Wootook_Core_Collection(); + $collection + ->setEntityClassName('Wootook_Empire_Model_Fleet') + ->union($firstCollection) + ->union($backCollection) + ->load($options) + ; + + return $collection; + } + + public function getNewMessagesCount() + { + $messageCollection = new Wootook_Core_Collection('messages'); + $messageCollection->where('message_owner=:user'); + $messageCollection->where('message_read_at<=0'); + + $newMessages = null; + if (($count = $messageCollection->getSize(array('user' => $this->getId()))) > 0) { + return $count; + } + return null; + } + + public static function layoutPrepareAfterListener($eventData) + { + $player = self::getSingleton(); + if ($player === null || !$player->getId() || !in_array($player->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { + return; + } + + if (!isset($eventData['layout']) || !$eventData['layout'] instanceof Wootook_Core_Layout) { + return; + } + $layout = $eventData['layout']; + $navigation = $layout->getBlock('navigation'); + + $navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/index.php', array(), array('admin')); + } +} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Model/Message.php b/application/code/core/Wootook/Empire/Model/User/Message.php similarity index 59% rename from src/application/code/core/Wootook/Player/Model/Message.php rename to application/code/core/Wootook/Empire/Model/User/Message.php index 0002d94..80241ef 100644 --- a/src/application/code/core/Wootook/Player/Model/Message.php +++ b/application/code/core/Wootook/Empire/Model/User/Message.php @@ -1,14 +1,14 @@ _tableName = 'messages'; $this->_idFieldNames = array('message_id', 'message_owner'); } -} +} \ No newline at end of file diff --git a/application/code/core/Wootook/Exception.php b/application/code/core/Wootook/Exception.php new file mode 100644 index 0000000..b20ebf1 --- /dev/null +++ b/application/code/core/Wootook/Exception.php @@ -0,0 +1,3 @@ + - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ -/** - * - * Enter description here ... - * @author Greg - * - */ class Wootook_Object implements ArrayAccess { @@ -113,4 +79,4 @@ class Wootook_Object { return $this->unsetData($offset); } -} +} \ No newline at end of file diff --git a/src/application/code/libraries/Math.php b/application/code/libraries/Math.php similarity index 99% rename from src/application/code/libraries/Math.php rename to application/code/libraries/Math.php index f429008..7ea2d08 100644 --- a/src/application/code/libraries/Math.php +++ b/application/code/libraries/Math.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/libraries/Math/Bcmath.php b/application/code/libraries/Math/Bcmath.php similarity index 99% rename from src/application/code/libraries/Math/Bcmath.php rename to application/code/libraries/Math/Bcmath.php index e5368c6..bbf9b45 100644 --- a/src/application/code/libraries/Math/Bcmath.php +++ b/application/code/libraries/Math/Bcmath.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/libraries/Math/Native.php b/application/code/libraries/Math/Native.php similarity index 98% rename from src/application/code/libraries/Math/Native.php rename to application/code/libraries/Math/Native.php index 0958113..300d8e7 100644 --- a/src/application/code/libraries/Math/Native.php +++ b/application/code/libraries/Math/Native.php @@ -3,7 +3,7 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/agpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * * Copyright (c) 2011-Present, Grégory PLANCHAT * All rights reserved. diff --git a/src/application/code/community/.placeholder b/application/code/local/.placeholder similarity index 100% rename from src/application/code/community/.placeholder rename to application/code/local/.placeholder diff --git a/application/code/local/ga.js b/application/code/local/ga.js new file mode 100644 index 0000000..9b28dfa --- /dev/null +++ b/application/code/local/ga.js @@ -0,0 +1,27 @@ +var _gaq = _gaq || []; + +(function()){ + var trackErrorThroughEvent = function(exception, f) { + _gaq.push(['_trackEvent', + 'JS ERROR: '+ (f || 'native') + ' (nav:'+ navigator.userAgent +') Exception: '+ (exception.name || 'Error'), + exception.message || exception, + ' url: '+document.location.href+' referer: '+ document.referrer + ]); + }; + + var outLink = function(link){ + var _gA = link.href.split('/'); + var _gS = link.href.split('#'); + + var _gT = '/out-link/' + _gA[2] + '/?d=' + _gS[0]; + _gaq.push(['_trackPageview',_gT]); + _gaq.push(function() { + try { + setTimeout('window.open(_gat._getTrackerByName()._getLinkerUrl(\'' + lien.href + '\',false),\'_blank\')', 100); + } catch(err) { + window.open(lien.href, '_blank'); /* préserve le fonctionnement du lien href en cas de pb */ + trackErrorThroughEvent(err,'lienSortant : '+lien.href ); + } + }); + } +})(); \ No newline at end of file diff --git a/src/application/code/test/Legacies/Core/LayoutTest.php b/application/code/test/Legacies/Core/LayoutTest.php similarity index 100% rename from src/application/code/test/Legacies/Core/LayoutTest.php rename to application/code/test/Legacies/Core/LayoutTest.php diff --git a/src/application/code/test/Legacies/Empire/Model/BuilderTest.php b/application/code/test/Legacies/Empire/Model/BuilderTest.php similarity index 100% rename from src/application/code/test/Legacies/Empire/Model/BuilderTest.php rename to application/code/test/Legacies/Empire/Model/BuilderTest.php diff --git a/src/application/code/test/Legacies/ObjectTest.php b/application/code/test/Legacies/ObjectTest.php similarity index 100% rename from src/application/code/test/Legacies/ObjectTest.php rename to application/code/test/Legacies/ObjectTest.php diff --git a/src/application/code/test/WootookTest.php b/application/code/test/LegaciesTest.php similarity index 99% rename from src/application/code/test/WootookTest.php rename to application/code/test/LegaciesTest.php index 8962684..d230e54 100644 --- a/src/application/code/test/WootookTest.php +++ b/application/code/test/LegaciesTest.php @@ -1,6 +1,6 @@ array( + 'update' => '1column', + 'reference' => array( + 'navigation' => array( + 'actions' => array( + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'development', + 'title' => 'Development' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/overview', + 'label' => 'Overview', + 'title' => 'Overview', + 'uri' => 'overview.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/buildings', + 'label' => 'Buildings', + 'title' => 'Buildings', + 'uri' => 'buildings.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/research-lab', + 'label' => 'Research Lab', + 'title' => 'Research Lab', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'research' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/shipyard', + 'label' => 'Shipyard', + 'title' => 'Shipyard', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'fleet' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/defenses', + 'label' => 'Defenses', + 'title' => 'Defenses', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'defense' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/officers', + 'label' => 'Officers', + 'title' => 'Officers', + 'uri' => 'officers.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'navigation', + 'title' => 'Navigation' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/alliance', + 'label' => 'Alliance', + 'title' => 'Alliance', + 'uri' => 'alliance.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/fleet', + 'label' => 'Fleet', + 'title' => 'Fleet', + 'uri' => 'fleet.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/galaxy', + 'label' => 'Galaxy', + 'title' => 'Galaxy', + 'uri' => 'galaxy.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/empire', + 'label' => 'Empire', + 'title' => 'Empire', + 'uri' => 'imperium.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/resources', + 'label' => 'Resources Production', + 'title' => 'Resources Production', + 'uri' => 'resources.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/retailer', + 'label' => 'Retailer', + 'title' => 'Retailer', + 'uri' => 'marchand.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/tech-tree', + 'label' => 'Technology Tree', + 'title' => 'Technology Tree', + 'uri' => 'techtree.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'tools', + 'title' => 'Tools' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/messages', + 'label' => 'Messages', + 'title' => 'Messages', + 'uri' => 'messages.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/records', + 'label' => 'Records', + 'title' => 'Records', + 'uri' => 'records.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/statistics', + 'label' => 'Stats', + 'title' => 'Stats', + 'uri' => 'stat.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/banned', + 'label' => 'Banned Players', + 'title' => 'Banned Players', + 'uri' => 'banned.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/announcement', + 'label' => 'Announcements', + 'title' => 'Announcements', + 'uri' => 'annonce.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/notes', + 'label' => 'Note Pad', + 'title' => 'Note Pad', + 'uri' => 'notes.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/options', + 'label' => 'Account Options', + 'title' => 'Account Options', + 'uri' => 'options.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/logout', + 'label' => 'Log Out', + 'title' => 'Log Out', + 'uri' => 'logout.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'community', + 'title' => 'Community' + ) + ), + array( + 'method' => 'addExternalLink', + 'params' => array( + 'name' => 'community/board', + 'label' => 'Forum board', + 'title' => 'Forum board', + 'url' => 'http://www.wootook.org/' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/search-player', + 'label' => 'Search Player', + 'title' => 'Search Player', + 'uri' => 'search.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/chat', + 'label' => 'Chat', + 'title' => 'Chat', + 'uri' => 'chat.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/multi', + 'label' => 'Declare Multi-account', + 'title' => 'Declare Multi-account', + 'uri' => 'delclare_multi.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/rules', + 'label' => 'Rules', + 'title' => 'Rules', + 'uri' => 'rules.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/contact', + 'label' => 'Contact Admin', + 'title' => 'Contact Admin', + 'uri' => 'contact.php' + ) + ) + ) + ) + ) + ), + + 'overview' => array( + 'update' => 'empire', + 'reference' => array( + 'content' => array( + 'children' => array( + 'overview.forms' => array( + 'type' => 'core/concat' + ), + 'overview' => array( + 'type' => 'empire/overview', + 'template' => 'empire/overview.phtml' + ), + ) + ), + 'left' => array( + ) + ) + ), + + 'overview.rename-planet' => array( + 'update' => 'overview', + 'reference' => array( + 'overview.forms' => array( + 'children' => array( + 'rename-planet' => array( + 'type' => 'empire/overview.rename-planet', + 'template' => 'empire/overview/form/rename-planet.phtml' + ), + ) + ) + ) + ), + + 'overview.destroy-planet' => array( + 'update' => 'overview', + 'reference' => array( + 'overview.forms' => array( + 'children' => array( + 'destroy-planet' => array( + 'type' => 'empire/overview.destroy-planet', + 'template' => 'empire/overview/form/destroy-planet.phtml' + ), + ) + ) + ) + ), + + 'planet.buildings' => array( + 'update' => 'empire', + 'reference' => array( + 'content' => array( + 'children' => array( + 'topnav' => array( + 'type' => 'empire/topnav', + 'template' => 'empire/topnav.phtml', + ), + 'queue' => array( + 'type' => 'empire/planet.buildings.queue', + 'template' => 'empire/planet/buildings/queue.phtml', + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/buildings/queue/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'empire/planet.buildings.queue.item' + ) + ) + ) + ), + 'item-list' => array( + 'type' => 'empire/planet.buildings', + 'template' => 'empire/planet/buildings.phtml', + 'children' => array( + 'item-list.items' => array( + 'type' => 'core/concat' + ), + ), + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/buildings/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'empire/planet.buildings.item' + ) + ) + ) + ), + ) + ) + ) + ), + + 'planet.shipyard' => array( + 'update' => 'empire', + 'reference' => array( + 'content' => array( + 'children' => array( + 'topnav' => array( + 'type' => 'empire/topnav', + 'template' => 'empire/topnav.phtml', + ), + 'item-list' => array( + 'type' => 'legacies_empire/planet.shipyard', + 'template' => 'empire/planet/shipyard.phtml', + 'children' => array( + 'item-list.items' => array( + 'type' => 'core/concat' + ), + ), + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/shipyard/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'legacies_empire/planet.shipyard.item' + ) + ), + ) + ), + 'queue' => array( + 'type' => 'legacies_empire/planet.shipyard.queue', + 'template' => 'empire/planet/shipyard/queue.phtml', + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/shipyard/queue/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'legacies_empire/planet.shipyard.queue.item' + ) + ) + ) + ), + ) + ) + ) + ), + + 'planet.defense' => array( + 'update' => 'planet.shipyard', + 'reference' => array( + 'item-list' => array( + 'actions' => array( + array( + 'method' => 'setType', + 'params' => array( + 'type' => Legacies_Empire::TYPE_DEFENSE + ) + ) + ) + ) + ) + ), + + 'planet.research-lab' => array( + 'update' => 'empire', + 'reference' => array( + 'content' => array( + 'children' => array( + 'topnav' => array( + 'type' => 'empire/topnav', + 'template' => 'empire/topnav.phtml', + ), + 'item-list' => array( + 'type' => 'legacies_empire/planet.research-lab', + 'template' => 'empire/planet/research-lab.phtml', + 'children' => array( + 'item-list.items' => array( + 'type' => 'core/concat' + ), + ), + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/research-lab/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'legacies_empire/planet.research-lab.item' + ) + ), + ) + ), + 'queue' => array( + 'type' => 'legacies_empire/planet.research-lab.queue', + 'template' => 'empire/planet/research-lab/queue.phtml', + 'actions' => array( + array( + 'method' => 'setItemTemplate', + 'params' => array( + 'template' => 'empire/planet/research-lab/queue/item.phtml' + ) + ), + array( + 'method' => 'setItemBlockType', + 'params' => array( + 'blockType' => 'legacies_empire/planet.research-lab.queue.item' + ) + ) + ) + ) + ) + ) + ) + ) + ); diff --git a/application/design/base/default/layouts/page.php b/application/design/base/default/layouts/page.php new file mode 100644 index 0000000..32b0013 --- /dev/null +++ b/application/design/base/default/layouts/page.php @@ -0,0 +1,222 @@ + array( + 'update' => 'default', + 'reference' => array( + 'content' => array( + 'children' => array( + 'navigation' => array( + 'type' => 'core/html.navigation', + 'template' => 'page/html/navigation.phtml' + ) + ) + ) + ) + ), + + '2columns-left' => array( + 'update' => 'default', + 'template' => 'page/2columns-left.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'left' => array( + 'type' => 'core/concat', + 'children' => array( + 'navigation' => array( + 'type' => 'core/html.navigation', + 'template' => 'page/html/navigation.phtml' + ) + ) + ) + ) + ) + ) + ), + + '2columns-right' => array( + 'update' => 'default', + 'template' => 'page/2columns-right.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'right' => array( + 'type' => 'core/concat' + ), + ) + ) + ) + ), + + '3columns' => array( + 'update' => 'default', + 'template' => 'page/3columns.phtml', + 'reference' => array( + 'root' => array( + 'children' => array( + 'left' => array( + 'type' => 'core/concat' + ), + 'right' => array( + 'type' => 'core/concat' + ), + ) + ) + ) + ), + + 'default' => array( + 'type' => 'core/html.page', + 'template' => 'page/1column.phtml', + 'children' => array( + 'head' => array( + 'type' => 'core/html.head', + 'template' => 'page/html/head.phtml', + 'actions' => array( + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/default.css' + ) + ), + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/formate.css' + ) + ), + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/legacies.css' + ) + ), + array( + 'method' => 'addJs', + 'params' => array( + 'script' => 'scripts/jquery/jquery-1.6.4.js' + ) + ) + ) + ), + 'header' => array( + 'type' => 'core/template', + 'template' => 'page/html/header.phtml', + 'children' => array( + 'menu' => array( + 'type' => 'core/html.navigation', + 'template' => 'page/html/navigation.phtml', + ), + 'planet-list' => array( + 'type' => 'empire/planet-list', + 'template' => 'empire/planet-list.phtml', + ) + ) + ), + 'footer' => array( + 'type' => 'core/template', + 'template' => 'page/html/footer.phtml' + ), + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + + 'ajax' => array( + 'type' => 'core/html.page', + 'template' => 'page/empty.phtml', + 'children' => array( + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + + 'empty' => array( + 'type' => 'core/html.page', + 'template' => 'page/empty.phtml', + 'children' => array( + 'head' => array( + 'type' => 'core/html.head', + 'template' => 'page/html/head.phtml' + ), + 'content' => array( + 'type' => 'core/concat' + ) + ) + ), + + 'message' => array( + 'update' => 'default', + 'reference' => array( + 'content' => array( + 'children' => array( + 'message' => array( + 'type' => 'core/template', + 'template' => 'page/html/message.phtml' + ), + ) + ) + ) + ), + + 'login' => array( + 'update' => '1column', + 'reference' => array( + 'content' => array( + 'children' => array( + 'login' => array( + 'type' => 'core/template', + 'template' => 'user/login.phtml' + ), + ) + ), + 'head' => array( + 'actions' => array( + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/styles.css' + ) + ), + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/about.css' + ) + ) + ) + ) + ) + ), + + 'registration' => array( + 'update' => '1column', + 'reference' => array( + 'content' => array( + 'children' => array( + 'registration' => array( + 'type' => 'core/template', + 'template' => 'user/registration.phtml' + ), + ) + ), + 'head' => array( + 'actions' => array( + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/styles.css' + ) + ), + array( + 'method' => 'addCss', + 'params' => array( + 'stylesheet' => 'css/deprecated/about.css' + ) + ) + ) + ) + ) + ) + ); diff --git a/src/application/design/frontend/base/default/scripts/deprecated/add_declare.tpl b/application/design/base/default/scripts/deprecated/add_declare.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/add_declare.tpl rename to application/design/base/default/scripts/deprecated/add_declare.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/activeplanet_body.tpl b/application/design/base/default/scripts/deprecated/admin/activeplanet_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/activeplanet_body.tpl rename to application/design/base/default/scripts/deprecated/admin/activeplanet_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/add_money.tpl b/application/design/base/default/scripts/deprecated/admin/add_money.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/add_money.tpl rename to application/design/base/default/scripts/deprecated/admin/add_money.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/add_moon.tpl b/application/design/base/default/scripts/deprecated/admin/add_moon.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/add_moon.tpl rename to application/design/base/default/scripts/deprecated/admin/add_moon.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_asw1.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_asw1.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_asw1.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_asw1.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_asw2.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_asw2.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_asw2.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_asw2.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm1.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_frm1.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm1.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_frm1.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm2.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_frm2.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm2.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_frm2.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm3.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_frm3.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm3.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_frm3.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm4.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_frm4.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_frm4.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_frm4.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_main.tpl b/application/design/base/default/scripts/deprecated/admin/admin_panel_main.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/admin_panel_main.tpl rename to application/design/base/default/scripts/deprecated/admin/admin_panel_main.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/banadni.tpl b/application/design/base/default/scripts/deprecated/admin/banadni.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/banadni.tpl rename to application/design/base/default/scripts/deprecated/admin/banadni.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/banned.tpl b/application/design/base/default/scripts/deprecated/admin/banned.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/banned.tpl rename to application/design/base/default/scripts/deprecated/admin/banned.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/changepass.tpl b/application/design/base/default/scripts/deprecated/admin/changepass.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/changepass.tpl rename to application/design/base/default/scripts/deprecated/admin/changepass.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/chat_body.tpl b/application/design/base/default/scripts/deprecated/admin/chat_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/chat_body.tpl rename to application/design/base/default/scripts/deprecated/admin/chat_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/credit_body.tpl b/application/design/base/default/scripts/deprecated/admin/credit_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/credit_body.tpl rename to application/design/base/default/scripts/deprecated/admin/credit_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/declarelist_body.tpl b/application/design/base/default/scripts/deprecated/admin/declarelist_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/declarelist_body.tpl rename to application/design/base/default/scripts/deprecated/admin/declarelist_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/declarelist_rows.tpl b/application/design/base/default/scripts/deprecated/admin/declarelist_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/declarelist_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/declarelist_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/deletuser.tpl b/application/design/base/default/scripts/deprecated/admin/deletuser.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/deletuser.tpl rename to application/design/base/default/scripts/deprecated/admin/deletuser.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/errors_body.tpl b/application/design/base/default/scripts/deprecated/admin/errors_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/errors_body.tpl rename to application/design/base/default/scripts/deprecated/admin/errors_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/exec_query.tpl b/application/design/base/default/scripts/deprecated/admin/exec_query.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/exec_query.tpl rename to application/design/base/default/scripts/deprecated/admin/exec_query.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/fleet_body.tpl b/application/design/base/default/scripts/deprecated/admin/fleet_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/fleet_body.tpl rename to application/design/base/default/scripts/deprecated/admin/fleet_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/fleet_rows.tpl b/application/design/base/default/scripts/deprecated/admin/fleet_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/fleet_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/fleet_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/left_menu.tpl b/application/design/base/default/scripts/deprecated/admin/left_menu.tpl similarity index 97% rename from src/application/design/backend/base/default/scripts/deprecated/admin/left_menu.tpl rename to application/design/base/default/scripts/deprecated/admin/left_menu.tpl index 9cc9100..6955190 100644 --- a/src/application/design/backend/base/default/scripts/deprecated/admin/left_menu.tpl +++ b/application/design/base/default/scripts/deprecated/admin/left_menu.tpl @@ -78,7 +78,7 @@ parent.frames['Hauptframe'].location.replace("overview.php"); - + diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/md5enc.tpl b/application/design/base/default/scripts/deprecated/admin/md5enc.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/md5enc.tpl rename to application/design/base/default/scripts/deprecated/admin/md5enc.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/message_body.tpl b/application/design/base/default/scripts/deprecated/admin/message_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/message_body.tpl rename to application/design/base/default/scripts/deprecated/admin/message_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/messagelist_body.tpl b/application/design/base/default/scripts/deprecated/admin/messagelist_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/messagelist_body.tpl rename to application/design/base/default/scripts/deprecated/admin/messagelist_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/messagelist_table_rows.tpl b/application/design/base/default/scripts/deprecated/admin/messagelist_table_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/messagelist_table_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/messagelist_table_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/messall_body.tpl b/application/design/base/default/scripts/deprecated/admin/messall_body.tpl similarity index 51% rename from src/application/design/backend/base/default/scripts/deprecated/admin/messall_body.tpl rename to application/design/base/default/scripts/deprecated/admin/messall_body.tpl index b4b4fb8..cf4b14e 100644 --- a/src/application/design/backend/base/default/scripts/deprecated/admin/messall_body.tpl +++ b/application/design/base/default/scripts/deprecated/admin/messall_body.tpl @@ -3,13 +3,13 @@ - + - - + + diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/moonlist_body.tpl b/application/design/base/default/scripts/deprecated/admin/moonlist_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/moonlist_body.tpl rename to application/design/base/default/scripts/deprecated/admin/moonlist_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/multi_body.tpl b/application/design/base/default/scripts/deprecated/admin/multi_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/multi_body.tpl rename to application/design/base/default/scripts/deprecated/admin/multi_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/multi_rows.tpl b/application/design/base/default/scripts/deprecated/admin/multi_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/multi_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/multi_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/options_body.tpl b/application/design/base/default/scripts/deprecated/admin/options_body.tpl similarity index 89% rename from src/application/design/backend/base/default/scripts/deprecated/admin/options_body.tpl rename to application/design/base/default/scripts/deprecated/admin/options_body.tpl index ecb278a..fb92f13 100644 --- a/src/application/design/backend/base/default/scripts/deprecated/admin/options_body.tpl +++ b/application/design/base/default/scripts/deprecated/admin/options_body.tpl @@ -102,17 +102,24 @@ - - + + - - - + + + + + + + + + + - + diff --git a/application/design/base/default/scripts/deprecated/admin/overview_body.tpl b/application/design/base/default/scripts/deprecated/admin/overview_body.tpl new file mode 100644 index 0000000..bcc3642 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/admin/overview_body.tpl @@ -0,0 +1,35 @@ +

+

getData('adm_ov_title')?>

+
__('General message')?>Message Général
Sujet
__('Content 0 / %1$d chars)', 5000)?>Texte (0 / 5000 Caractère)
__('Enable Google Analytics')?>getData('ga')?> type="checkbox" />getData('adm_opt_game_oth_chat')?>getData('chatframe')?> type="checkbox" />
__('Google Analytics Identifier')?>
getData('adm_opt_game_oth_adds')?>getData('googlead')?> type="checkbox" />
getData('adm_opt_game_debugmod')?>getData('debug')?> type="checkbox" />
getData('banner')?>
<?php echo $this->getData('banner_source_post')?>
+ + + + + + +
getData('adm_ov_infos')?>
getData('adm_ov_yourv')?>: getData('adm_ov_data_yourv')?>getData('adm_ov_lastv')?>: getData('adm_ov_here')?>
+
+ + + + + + + + + + + + + + + + + + + + getData('adm_ov_data_table')?> + + + +
getData('adm_ov_onlin')?>
getData('adm_ul_id')?>getData('adm_ul_name')?>getData('adm_ul_adip')?>getData('adm_ov_ally')?>getData('adm_ov_point')?>getData('adm_ov_activ')?>getData('usr_email')?>getData('xp_raid')?>getData('xp_min')?>getData('lang_vacancy')?>getData('banned_lang')?>getData('usr_current_planet')?>getData('usr_current_page')?>
getData('adm_ov_count')?>: getData('adm_ov_data_count')?>
\ No newline at end of file diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/overview_rows.tpl b/application/design/base/default/scripts/deprecated/admin/overview_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/overview_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/overview_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/planetlist_body.tpl b/application/design/base/default/scripts/deprecated/admin/planetlist_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/planetlist_body.tpl rename to application/design/base/default/scripts/deprecated/admin/planetlist_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/reset_body.tpl b/application/design/base/default/scripts/deprecated/admin/reset_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/reset_body.tpl rename to application/design/base/default/scripts/deprecated/admin/reset_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/simple_header.tpl b/application/design/base/default/scripts/deprecated/admin/simple_header.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/simple_header.tpl rename to application/design/base/default/scripts/deprecated/admin/simple_header.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/unbanned.tpl b/application/design/base/default/scripts/deprecated/admin/unbanned.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/unbanned.tpl rename to application/design/base/default/scripts/deprecated/admin/unbanned.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/userlist_body.tpl b/application/design/base/default/scripts/deprecated/admin/userlist_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/userlist_body.tpl rename to application/design/base/default/scripts/deprecated/admin/userlist_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/userlist_rows.tpl b/application/design/base/default/scripts/deprecated/admin/userlist_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/userlist_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/userlist_rows.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/variables_body.tpl b/application/design/base/default/scripts/deprecated/admin/variables_body.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/variables_body.tpl rename to application/design/base/default/scripts/deprecated/admin/variables_body.tpl diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/variables_rows.tpl b/application/design/base/default/scripts/deprecated/admin/variables_rows.tpl similarity index 100% rename from src/application/design/backend/base/default/scripts/deprecated/admin/variables_rows.tpl rename to application/design/base/default/scripts/deprecated/admin/variables_rows.tpl diff --git a/application/design/base/default/scripts/deprecated/agreement.tpl b/application/design/base/default/scripts/deprecated/agreement.tpl new file mode 100644 index 0000000..44c2012 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/agreement.tpl @@ -0,0 +1 @@ +N/A \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin.tpl b/application/design/base/default/scripts/deprecated/alliance_admin.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin.tpl diff --git a/application/design/base/default/scripts/deprecated/alliance_admin_laws.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_laws.tpl new file mode 100644 index 0000000..2935d69 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/alliance_admin_laws.tpl @@ -0,0 +1,70 @@ +
+ + +getData('list')?> + + +
getData('Configure_laws')?>
+ +
+ +
+ + + + + + + + + + + + +
getData('Range_make')?>
getData('Range_name')?>
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
getData('Law_leyends')?>
getData('Alliance_dissolve')?>
getData('Expel_users')?>
getData('See_the_requests')?>
getData('See_the_list_members')?>
getData('Check_the_requests')?>
getData('Alliance_admin')?>
getData('See_the_online_list_member')?>
getData('Make_a_circular_message')?>
getData('Left_hand_text')?>
getData('Return_to_overview')?>
+ \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_feet.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_laws_feet.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_feet.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_laws_feet.tpl diff --git a/application/design/base/default/scripts/deprecated/alliance_admin_laws_head.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_laws_head.tpl new file mode 100644 index 0000000..131303d --- /dev/null +++ b/application/design/base/default/scripts/deprecated/alliance_admin_laws_head.tpl @@ -0,0 +1,15 @@ +
+
+ + + getData('Range_name')?> + + + + + + + + + + diff --git a/application/design/base/default/scripts/deprecated/alliance_admin_laws_row.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_laws_row.tpl new file mode 100644 index 0000000..014a5c6 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/alliance_admin_laws_row.tpl @@ -0,0 +1,16 @@ +
+ + getData('delete')?> +  getData('r0')?>  + + getData('r1')?> + getData('r2')?> + getData('r3')?> + getData('r4')?> + getData('r5')?> + getData('r6')?> + getData('r7')?> + getData('r8')?> + getData('r9')?> + + \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_function.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_members_function.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_function.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_members_function.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_row.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_members_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_row.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_members_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_row_edit.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_members_row_edit.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_row_edit.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_members_row_edit.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_table.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_members_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_members_table.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_members_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_rename.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_rename.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename1.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_rename1.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename1.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_rename1.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename2.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_rename2.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_rename2.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_rename2.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_form.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_request_form.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_form.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_request_form.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_row.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_request_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_row.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_request_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_table.tpl b/application/design/base/default/scripts/deprecated/alliance_admin_request_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_request_table.tpl rename to application/design/base/default/scripts/deprecated/alliance_admin_request_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_ainfo.tpl b/application/design/base/default/scripts/deprecated/alliance_ainfo.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_ainfo.tpl rename to application/design/base/default/scripts/deprecated/alliance_ainfo.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_apply_waitform.tpl b/application/design/base/default/scripts/deprecated/alliance_apply_waitform.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_apply_waitform.tpl rename to application/design/base/default/scripts/deprecated/alliance_apply_waitform.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_applyform.tpl b/application/design/base/default/scripts/deprecated/alliance_applyform.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_applyform.tpl rename to application/design/base/default/scripts/deprecated/alliance_applyform.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_circular.tpl b/application/design/base/default/scripts/deprecated/alliance_circular.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_circular.tpl rename to application/design/base/default/scripts/deprecated/alliance_circular.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_circular_form.tpl b/application/design/base/default/scripts/deprecated/alliance_circular_form.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_circular_form.tpl rename to application/design/base/default/scripts/deprecated/alliance_circular_form.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_defaultmenu.tpl b/application/design/base/default/scripts/deprecated/alliance_defaultmenu.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_defaultmenu.tpl rename to application/design/base/default/scripts/deprecated/alliance_defaultmenu.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_frontpage.tpl b/application/design/base/default/scripts/deprecated/alliance_frontpage.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_frontpage.tpl rename to application/design/base/default/scripts/deprecated/alliance_frontpage.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_make.tpl b/application/design/base/default/scripts/deprecated/alliance_make.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_make.tpl rename to application/design/base/default/scripts/deprecated/alliance_make.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_makeform.tpl b/application/design/base/default/scripts/deprecated/alliance_makeform.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_makeform.tpl rename to application/design/base/default/scripts/deprecated/alliance_makeform.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_memberslist_row.tpl b/application/design/base/default/scripts/deprecated/alliance_memberslist_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_memberslist_row.tpl rename to application/design/base/default/scripts/deprecated/alliance_memberslist_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_memberslist_table.tpl b/application/design/base/default/scripts/deprecated/alliance_memberslist_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_memberslist_table.tpl rename to application/design/base/default/scripts/deprecated/alliance_memberslist_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_searchform.tpl b/application/design/base/default/scripts/deprecated/alliance_searchform.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_searchform.tpl rename to application/design/base/default/scripts/deprecated/alliance_searchform.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_searchresult_row.tpl b/application/design/base/default/scripts/deprecated/alliance_searchresult_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_searchresult_row.tpl rename to application/design/base/default/scripts/deprecated/alliance_searchresult_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_searchresult_table.tpl b/application/design/base/default/scripts/deprecated/alliance_searchresult_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/alliance_searchresult_table.tpl rename to application/design/base/default/scripts/deprecated/alliance_searchresult_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/banned_body.tpl b/application/design/base/default/scripts/deprecated/banned_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/banned_body.tpl rename to application/design/base/default/scripts/deprecated/banned_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/changelog_body.tpl b/application/design/base/default/scripts/deprecated/changelog_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/changelog_body.tpl rename to application/design/base/default/scripts/deprecated/changelog_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/changelog_table.tpl b/application/design/base/default/scripts/deprecated/changelog_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/changelog_table.tpl rename to application/design/base/default/scripts/deprecated/changelog_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/chat_body.tpl b/application/design/base/default/scripts/deprecated/chat_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/chat_body.tpl rename to application/design/base/default/scripts/deprecated/chat_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/contact_body.tpl b/application/design/base/default/scripts/deprecated/contact_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/contact_body.tpl rename to application/design/base/default/scripts/deprecated/contact_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/contact_body_rows.tpl b/application/design/base/default/scripts/deprecated/contact_body_rows.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/contact_body_rows.tpl rename to application/design/base/default/scripts/deprecated/contact_body_rows.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/credit_body.tpl b/application/design/base/default/scripts/deprecated/credit_body.tpl similarity index 83% rename from src/application/design/frontend/base/default/scripts/deprecated/credit_body.tpl rename to application/design/base/default/scripts/deprecated/credit_body.tpl index 525309d..77c7886 100644 --- a/src/application/design/frontend/base/default/scripts/deprecated/credit_body.tpl +++ b/application/design/base/default/scripts/deprecated/credit_body.tpl @@ -6,7 +6,7 @@ getData('cred_link')?> getData('cred_site')?>:
getData('cred_forum')?>: - www.xnova-ng.org
www.xnova-ng.org/forum + www.xnova-ng.org
www.xnova-ng.org/forum getData('cred_credit')?> @@ -18,4 +18,5 @@ UGamela
Britania getData('cred_based')?>
getData('cred_start')?> +getData('ExtCopyFrame')?> \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_body.tpl b/application/design/base/default/scripts/deprecated/galaxy_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_body.tpl rename to application/design/base/default/scripts/deprecated/galaxy_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row.tpl b/application/design/base/default/scripts/deprecated/galaxy_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_action.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_action.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_action.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_action.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_ally.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_ally.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_ally.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_ally.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_debris.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_debris.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_debris.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_debris.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_luna.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_luna.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_luna.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_luna.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_planet.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_planet.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_planet.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_planet.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_user.tpl b/application/design/base/default/scripts/deprecated/galaxy_row_user.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/galaxy_row_user.tpl rename to application/design/base/default/scripts/deprecated/galaxy_row_user.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/gate_fleet_rows.tpl b/application/design/base/default/scripts/deprecated/gate_fleet_rows.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/gate_fleet_rows.tpl rename to application/design/base/default/scripts/deprecated/gate_fleet_rows.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/gate_fleet_table.tpl b/application/design/base/default/scripts/deprecated/gate_fleet_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/gate_fleet_table.tpl rename to application/design/base/default/scripts/deprecated/gate_fleet_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/imperium_row.tpl b/application/design/base/default/scripts/deprecated/imperium_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/imperium_row.tpl rename to application/design/base/default/scripts/deprecated/imperium_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/imperium_row2.tpl b/application/design/base/default/scripts/deprecated/imperium_row2.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/imperium_row2.tpl rename to application/design/base/default/scripts/deprecated/imperium_row2.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/imperium_table.tpl b/application/design/base/default/scripts/deprecated/imperium_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/imperium_table.tpl rename to application/design/base/default/scripts/deprecated/imperium_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_buildings_defense.tpl b/application/design/base/default/scripts/deprecated/info_buildings_defense.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_buildings_defense.tpl rename to application/design/base/default/scripts/deprecated/info_buildings_defense.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_buildings_destroy.tpl b/application/design/base/default/scripts/deprecated/info_buildings_destroy.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_buildings_destroy.tpl rename to application/design/base/default/scripts/deprecated/info_buildings_destroy.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_buildings_fleet.tpl b/application/design/base/default/scripts/deprecated/info_buildings_fleet.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_buildings_fleet.tpl rename to application/design/base/default/scripts/deprecated/info_buildings_fleet.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_buildings_general.tpl b/application/design/base/default/scripts/deprecated/info_buildings_general.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_buildings_general.tpl rename to application/design/base/default/scripts/deprecated/info_buildings_general.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_buildings_table.tpl b/application/design/base/default/scripts/deprecated/info_buildings_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_buildings_table.tpl rename to application/design/base/default/scripts/deprecated/info_buildings_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/info_officiers_general.tpl b/application/design/base/default/scripts/deprecated/info_officiers_general.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/info_officiers_general.tpl rename to application/design/base/default/scripts/deprecated/info_officiers_general.tpl diff --git a/application/design/base/default/scripts/deprecated/install/ins_acc.tpl b/application/design/base/default/scripts/deprecated/install/ins_acc.tpl new file mode 100644 index 0000000..990f8db --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_acc.tpl @@ -0,0 +1,44 @@ + + +
getData('ins_tx_acc1')?>
+getData('ins_tx_acc2')?>

+ + + + + + + + + + + + + + + + + + + + + +
getData('ins_acc_user')?>:
getData('ins_acc_pass')?>:
getData('ins_acc_email')?>:
getData('ins_acc_planet')?>:
getData('ins_acc_sex')?>:
+
+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_acc_done.tpl b/application/design/base/default/scripts/deprecated/install/ins_acc_done.tpl new file mode 100644 index 0000000..2e14361 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_acc_done.tpl @@ -0,0 +1,9 @@ + + +
getData('ins_tx_done2')?>
+getData('ins_tx_done3')?>

+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_body.tpl b/application/design/base/default/scripts/deprecated/install/ins_body.tpl new file mode 100644 index 0000000..295e294 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_body.tpl @@ -0,0 +1,28 @@ +

+ + + + + + + + +getData('ins_page')?> + +
getData('ins_appname')?>getData('ins_tx_sys')?>
getData('ins_tx_state')?> getData('ins_state')?>
+ + + + + + + + + + + + + + + +
getData('ins_mnu_intro')?>
getData('ins_mnu_inst')?>
getData('ins_mnu_goto')?>
getData('ins_mnu_upgr')?>
getData('ins_mnu_quit')?>
\ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_form.tpl b/application/design/base/default/scripts/deprecated/install/ins_form.tpl new file mode 100644 index 0000000..9b3b364 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_form.tpl @@ -0,0 +1,33 @@ + + +
getData('ins_tx_inst1')?>
+getData('ins_tx_inst2')?>
+getData('ins_tx_inst3')?>

+ + + + + + + + + + + + + + + + + + + + + +
getData('ins_form_server')?>:
getData('ins_form_db')?>:
getData('ins_form_prefix')?>:
getData('ins_form_login')?>:
getData('ins_form_pass')?>:
+
+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_form_done.tpl b/application/design/base/default/scripts/deprecated/install/ins_form_done.tpl new file mode 100644 index 0000000..3d9426d --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_form_done.tpl @@ -0,0 +1,8 @@ + + +

getData('ins_tx_done1')?>

+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_goto_done.tpl b/application/design/base/default/scripts/deprecated/install/ins_goto_done.tpl new file mode 100644 index 0000000..55d1b13 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_goto_done.tpl @@ -0,0 +1,9 @@ + + +
getData('ins_tx_done4')?>
+getData('ins_tx_done3')?>

+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_goto_form.tpl b/application/design/base/default/scripts/deprecated/install/ins_goto_form.tpl new file mode 100644 index 0000000..0539d11 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_goto_form.tpl @@ -0,0 +1,33 @@ + + +
getData('ins_tx_inst1')?>
+getData('ins_tx_goto4')?>
+getData('ins_tx_goto5')?>

+ + + + + + + + + + + + + + + + + + + + + +
getData('ins_form_server')?>:
getData('ins_form_db')?>:
getData('ins_form_prefix')?>:
getData('ins_form_login')?>:
getData('ins_form_pass')?>:
+
+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_goto_intro.tpl b/application/design/base/default/scripts/deprecated/install/ins_goto_intro.tpl new file mode 100644 index 0000000..16c01e9 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_goto_intro.tpl @@ -0,0 +1,10 @@ + + +
getData('ins_tx_goto1')?>
+getData('ins_tx_goto2')?>
+getData('ins_tx_goto3')?>

+ + + + + \ No newline at end of file diff --git a/application/design/base/default/scripts/deprecated/install/ins_intro.tpl b/application/design/base/default/scripts/deprecated/install/ins_intro.tpl new file mode 100644 index 0000000..fe25771 --- /dev/null +++ b/application/design/base/default/scripts/deprecated/install/ins_intro.tpl @@ -0,0 +1,11 @@ + + +
getData('ins_tx_welco')?>
+getData('ins_tx_intr1')?>
+getData('ins_tx_intr2')?>
+getData('ins_tx_intr3')?>

+ + + + + \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/deprecated/lostpassword.tpl b/application/design/base/default/scripts/deprecated/lostpassword.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/lostpassword.tpl rename to application/design/base/default/scripts/deprecated/lostpassword.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/marchand_cristal.tpl b/application/design/base/default/scripts/deprecated/marchand_cristal.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/marchand_cristal.tpl rename to application/design/base/default/scripts/deprecated/marchand_cristal.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/marchand_deuterium.tpl b/application/design/base/default/scripts/deprecated/marchand_deuterium.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/marchand_deuterium.tpl rename to application/design/base/default/scripts/deprecated/marchand_deuterium.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/marchand_main.tpl b/application/design/base/default/scripts/deprecated/marchand_main.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/marchand_main.tpl rename to application/design/base/default/scripts/deprecated/marchand_main.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/marchand_metal.tpl b/application/design/base/default/scripts/deprecated/marchand_metal.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/marchand_metal.tpl rename to application/design/base/default/scripts/deprecated/marchand_metal.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/message_body.tpl b/application/design/base/default/scripts/deprecated/message_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/message_body.tpl rename to application/design/base/default/scripts/deprecated/message_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/messages_pm_form.tpl b/application/design/base/default/scripts/deprecated/messages_pm_form.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/messages_pm_form.tpl rename to application/design/base/default/scripts/deprecated/messages_pm_form.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/messages_pm_form_bb.tpl b/application/design/base/default/scripts/deprecated/messages_pm_form_bb.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/messages_pm_form_bb.tpl rename to application/design/base/default/scripts/deprecated/messages_pm_form_bb.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/multi.tpl b/application/design/base/default/scripts/deprecated/multi.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/multi.tpl rename to application/design/base/default/scripts/deprecated/multi.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/notes_body.tpl b/application/design/base/default/scripts/deprecated/notes_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/notes_body.tpl rename to application/design/base/default/scripts/deprecated/notes_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/notes_body_entry.tpl b/application/design/base/default/scripts/deprecated/notes_body_entry.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/notes_body_entry.tpl rename to application/design/base/default/scripts/deprecated/notes_body_entry.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/notes_form.tpl b/application/design/base/default/scripts/deprecated/notes_form.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/notes_form.tpl rename to application/design/base/default/scripts/deprecated/notes_form.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/officier_body.tpl b/application/design/base/default/scripts/deprecated/officier_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/officier_body.tpl rename to application/design/base/default/scripts/deprecated/officier_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/officier_rows.tpl b/application/design/base/default/scripts/deprecated/officier_rows.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/officier_rows.tpl rename to application/design/base/default/scripts/deprecated/officier_rows.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/options_admadd.tpl b/application/design/base/default/scripts/deprecated/options_admadd.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/options_admadd.tpl rename to application/design/base/default/scripts/deprecated/options_admadd.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/options_body.tpl b/application/design/base/default/scripts/deprecated/options_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/options_body.tpl rename to application/design/base/default/scripts/deprecated/options_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/options_body_vmode.tpl b/application/design/base/default/scripts/deprecated/options_body_vmode.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/options_body_vmode.tpl rename to application/design/base/default/scripts/deprecated/options_body_vmode.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/overall_footer.tpl b/application/design/base/default/scripts/deprecated/overall_footer.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/overall_footer.tpl rename to application/design/base/default/scripts/deprecated/overall_footer.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/overview_body.tpl b/application/design/base/default/scripts/deprecated/overview_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/overview_body.tpl rename to application/design/base/default/scripts/deprecated/overview_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/overview_deleteplanet.tpl b/application/design/base/default/scripts/deprecated/overview_deleteplanet.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/overview_deleteplanet.tpl rename to application/design/base/default/scripts/deprecated/overview_deleteplanet.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/overview_fleet_event.tpl b/application/design/base/default/scripts/deprecated/overview_fleet_event.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/overview_fleet_event.tpl rename to application/design/base/default/scripts/deprecated/overview_fleet_event.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/overview_renameplanet.tpl b/application/design/base/default/scripts/deprecated/overview_renameplanet.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/overview_renameplanet.tpl rename to application/design/base/default/scripts/deprecated/overview_renameplanet.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/phalanx_body.tpl b/application/design/base/default/scripts/deprecated/phalanx_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/phalanx_body.tpl rename to application/design/base/default/scripts/deprecated/phalanx_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/records_body.tpl b/application/design/base/default/scripts/deprecated/records_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/records_body.tpl rename to application/design/base/default/scripts/deprecated/records_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/records_section_header.tpl b/application/design/base/default/scripts/deprecated/records_section_header.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/records_section_header.tpl rename to application/design/base/default/scripts/deprecated/records_section_header.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/records_section_rows.tpl b/application/design/base/default/scripts/deprecated/records_section_rows.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/records_section_rows.tpl rename to application/design/base/default/scripts/deprecated/records_section_rows.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/registry_form.tpl b/application/design/base/default/scripts/deprecated/registry_form.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/registry_form.tpl rename to application/design/base/default/scripts/deprecated/registry_form.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/resources.tpl b/application/design/base/default/scripts/deprecated/resources.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/resources.tpl rename to application/design/base/default/scripts/deprecated/resources.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/resources_row.tpl b/application/design/base/default/scripts/deprecated/resources_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/resources_row.tpl rename to application/design/base/default/scripts/deprecated/resources_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/rules_body.tpl b/application/design/base/default/scripts/deprecated/rules_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/rules_body.tpl rename to application/design/base/default/scripts/deprecated/rules_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/search_ally_row.tpl b/application/design/base/default/scripts/deprecated/search_ally_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/search_ally_row.tpl rename to application/design/base/default/scripts/deprecated/search_ally_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/search_ally_table.tpl b/application/design/base/default/scripts/deprecated/search_ally_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/search_ally_table.tpl rename to application/design/base/default/scripts/deprecated/search_ally_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/search_body.tpl b/application/design/base/default/scripts/deprecated/search_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/search_body.tpl rename to application/design/base/default/scripts/deprecated/search_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/search_user_row.tpl b/application/design/base/default/scripts/deprecated/search_user_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/search_user_row.tpl rename to application/design/base/default/scripts/deprecated/search_user_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/search_user_table.tpl b/application/design/base/default/scripts/deprecated/search_user_table.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/search_user_table.tpl rename to application/design/base/default/scripts/deprecated/search_user_table.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/serv_infos.tpl b/application/design/base/default/scripts/deprecated/serv_infos.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/serv_infos.tpl rename to application/design/base/default/scripts/deprecated/serv_infos.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/simple_footer.tpl b/application/design/base/default/scripts/deprecated/simple_footer.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/simple_footer.tpl rename to application/design/base/default/scripts/deprecated/simple_footer.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/simple_header.tpl b/application/design/base/default/scripts/deprecated/simple_header.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/simple_header.tpl rename to application/design/base/default/scripts/deprecated/simple_header.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/stat_alliancetable.tpl b/application/design/base/default/scripts/deprecated/stat_alliancetable.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/stat_alliancetable.tpl rename to application/design/base/default/scripts/deprecated/stat_alliancetable.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/stat_alliancetable_header.tpl b/application/design/base/default/scripts/deprecated/stat_alliancetable_header.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/stat_alliancetable_header.tpl rename to application/design/base/default/scripts/deprecated/stat_alliancetable_header.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/stat_body.tpl b/application/design/base/default/scripts/deprecated/stat_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/stat_body.tpl rename to application/design/base/default/scripts/deprecated/stat_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/stat_playertable.tpl b/application/design/base/default/scripts/deprecated/stat_playertable.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/stat_playertable.tpl rename to application/design/base/default/scripts/deprecated/stat_playertable.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/stat_playertable_header.tpl b/application/design/base/default/scripts/deprecated/stat_playertable_header.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/stat_playertable_header.tpl rename to application/design/base/default/scripts/deprecated/stat_playertable_header.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/statjoueur.tpl b/application/design/base/default/scripts/deprecated/statjoueur.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/statjoueur.tpl rename to application/design/base/default/scripts/deprecated/statjoueur.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/techtree_body.tpl b/application/design/base/default/scripts/deprecated/techtree_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/techtree_body.tpl rename to application/design/base/default/scripts/deprecated/techtree_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/techtree_details.tpl b/application/design/base/default/scripts/deprecated/techtree_details.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/techtree_details.tpl rename to application/design/base/default/scripts/deprecated/techtree_details.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/techtree_head.tpl b/application/design/base/default/scripts/deprecated/techtree_head.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/techtree_head.tpl rename to application/design/base/default/scripts/deprecated/techtree_head.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/techtree_row.tpl b/application/design/base/default/scripts/deprecated/techtree_row.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/techtree_row.tpl rename to application/design/base/default/scripts/deprecated/techtree_row.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/teleport.tpl b/application/design/base/default/scripts/deprecated/teleport.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/teleport.tpl rename to application/design/base/default/scripts/deprecated/teleport.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/tradingscrapmetal.tpl b/application/design/base/default/scripts/deprecated/tradingscrapmetal.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/tradingscrapmetal.tpl rename to application/design/base/default/scripts/deprecated/tradingscrapmetal.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/tradingscrapmetal_n.tpl b/application/design/base/default/scripts/deprecated/tradingscrapmetal_n.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/tradingscrapmetal_n.tpl rename to application/design/base/default/scripts/deprecated/tradingscrapmetal_n.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/usr_banned.tpl b/application/design/base/default/scripts/deprecated/usr_banned.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/usr_banned.tpl rename to application/design/base/default/scripts/deprecated/usr_banned.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/usuw_body.tpl b/application/design/base/default/scripts/deprecated/usuw_body.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/usuw_body.tpl rename to application/design/base/default/scripts/deprecated/usuw_body.tpl diff --git a/src/application/design/frontend/base/default/scripts/deprecated/zglos.tpl b/application/design/base/default/scripts/deprecated/zglos.tpl similarity index 100% rename from src/application/design/frontend/base/default/scripts/deprecated/zglos.tpl rename to application/design/base/default/scripts/deprecated/zglos.tpl diff --git a/application/design/base/default/scripts/empire/overview/fleet/item.phtml b/application/design/base/default/scripts/empire/overview/fleet/item.phtml new file mode 100644 index 0000000..f01fb8e --- /dev/null +++ b/application/design/base/default/scripts/empire/overview/fleet/item.phtml @@ -0,0 +1,21 @@ +getData('fleet')?> +getData('user')?> + + getData('fleet_javai')?> + +
-
+ getArrivalTime()?> + + + isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_TRANSPORT) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)):?> + __('An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?> + isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_DESTROY) || $fleet->isMission(Legacies_Empire::ID_MISSION_MISSILES) || $fleet->isMission(Legacies_Empire::ID_MISSION_SPY)):?> + __('Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d', $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getUser()->getUsername(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?> + isOwnedBy($user)):?> + __('Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?> + + __('A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?> + + + getData('fleet_javas')?> + \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/player/overview/form/destroy-planet.phtml b/application/design/base/default/scripts/empire/overview/form/destroy-planet.phtml similarity index 100% rename from src/application/design/frontend/base/default/scripts/player/overview/form/destroy-planet.phtml rename to application/design/base/default/scripts/empire/overview/form/destroy-planet.phtml diff --git a/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml b/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml new file mode 100644 index 0000000..45ba7da --- /dev/null +++ b/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml @@ -0,0 +1,10 @@ +
+
+ + + + + + +
+
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/player/overview/messages.phtml b/application/design/base/default/scripts/empire/overview/messages.phtml similarity index 100% rename from src/application/design/frontend/base/default/scripts/player/overview/messages.phtml rename to application/design/base/default/scripts/empire/overview/messages.phtml diff --git a/src/application/design/frontend/base/default/scripts/player/overview/planet/list/item.phtml b/application/design/base/default/scripts/empire/overview/planet/list/item.phtml similarity index 75% rename from src/application/design/frontend/base/default/scripts/player/overview/planet/list/item.phtml rename to application/design/base/default/scripts/empire/overview/planet/list/item.phtml index 44b2fd5..c571391 100644 --- a/src/application/design/frontend/base/default/scripts/player/overview/planet/list/item.phtml +++ b/application/design/base/default/scripts/empire/overview/planet/list/item.phtml @@ -1,6 +1,6 @@

escape($this['planet']->getData('name'))?>

-

+

count() > 0):?> diff --git a/application/design/base/default/scripts/empire/overview/planet/view.phtml b/application/design/base/default/scripts/empire/overview/planet/view.phtml new file mode 100644 index 0000000..8230a16 --- /dev/null +++ b/application/design/base/default/scripts/empire/overview/planet/view.phtml @@ -0,0 +1 @@ +planetList->render() ?> diff --git a/application/design/base/default/scripts/empire/planet/buildings.phtml b/application/design/base/default/scripts/empire/planet/buildings.phtml new file mode 100644 index 0000000..c8e4fd9 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/buildings.phtml @@ -0,0 +1,4 @@ +
+

__('Buildings')?>

+ getPartial('item-list.items')->render()?> +
\ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/buildings/item.phtml b/application/design/base/default/scripts/empire/planet/buildings/item.phtml new file mode 100644 index 0000000..30c6f33 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/buildings/item.phtml @@ -0,0 +1,27 @@ + +
+

escape($this->getName())?> (renderNumber($this->getLevel())?>)

+
+
+ +
+

getDescription()?>

+
    + getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?> +
  • + getResourceName($resourceId)?> + renderNumber($resourceConfig->getData('value'))?> + hasData('requirement')):?> + (renderNumber($resourceConfig->getData('requirement'))?>) + + (renderNumber($resourceConfig->getData('overflow'))?>) + +
  • + +
+

__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), true))?> +

+ +
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue.phtml b/application/design/base/default/scripts/empire/planet/buildings/queue.phtml similarity index 100% rename from src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue.phtml rename to application/design/base/default/scripts/empire/planet/buildings/queue.phtml diff --git a/application/design/base/default/scripts/empire/planet/buildings/queue/item.phtml b/application/design/base/default/scripts/empire/planet/buildings/queue/item.phtml new file mode 100644 index 0000000..0825de3 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/buildings/queue/item.phtml @@ -0,0 +1,8 @@ + +
+ + escape($this->getName())?> (renderNumber($this->getItemQueuedLevel())?>) + +
\ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/research-lab.phtml b/application/design/base/default/scripts/empire/planet/research-lab.phtml new file mode 100644 index 0000000..78be4c0 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/research-lab.phtml @@ -0,0 +1,4 @@ +
+

__('Research Laboratory')?>

+ getPartial('item-list.items')->render()?> +
\ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/research-lab/item.phtml b/application/design/base/default/scripts/empire/planet/research-lab/item.phtml new file mode 100644 index 0000000..9fd2017 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/research-lab/item.phtml @@ -0,0 +1,27 @@ + +
+

escape($this->getName())?> (renderNumber($this->getLevel())?>)

+
+
+ +
+

getDescription()?>

+
    + getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?> +
  • + getResourceName($resourceId)?> + renderNumber($resourceConfig->getData('value'))?> + hasData('requirement')):?> + (renderNumber($resourceConfig->getData('requirement'))?>) + + (renderNumber($resourceConfig->getData('overflow'))?>) + +
  • + +
+

__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?> +

+ +
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml b/application/design/base/default/scripts/empire/planet/research-lab/queue.phtml similarity index 92% rename from src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml rename to application/design/base/default/scripts/empire/planet/research-lab/queue.phtml index c63a203..d11b574 100644 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue.phtml +++ b/application/design/base/default/scripts/empire/planet/research-lab/queue.phtml @@ -3,4 +3,4 @@

__('Work in progress')?>

getPartial('item-list')->render() ?> - + \ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/research-lab/queue/item.phtml b/application/design/base/default/scripts/empire/planet/research-lab/queue/item.phtml new file mode 100644 index 0000000..0825de3 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/research-lab/queue/item.phtml @@ -0,0 +1,8 @@ + +
+ + escape($this->getName())?> (renderNumber($this->getItemQueuedLevel())?>) + +
\ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/shipyard.phtml b/application/design/base/default/scripts/empire/planet/shipyard.phtml new file mode 100644 index 0000000..28a33c0 --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/shipyard.phtml @@ -0,0 +1,20 @@ +
+

__('Shipyard')?>

+
+
+ getPartial('item-list.items')->render()?> +
+ +
+ +
\ No newline at end of file diff --git a/application/design/base/default/scripts/empire/planet/shipyard/item.phtml b/application/design/base/default/scripts/empire/planet/shipyard/item.phtml new file mode 100644 index 0000000..184683e --- /dev/null +++ b/application/design/base/default/scripts/empire/planet/shipyard/item.phtml @@ -0,0 +1,29 @@ + +
+

escape($this->getName())?> (renderNumber($this->getQty())?>)

+
+
+ +
+

getDescription()?>

+
    + getResourcesConfigForQty(1) as $resourceId => $resourceConfig):?> +
  • + getResourceName($resourceId)?> + renderNumber($resourceConfig->getData('value'))?> + hasData('requirement')):?> + (renderNumber($resourceConfig->getData('requirement'))?>) + + (renderNumber($resourceConfig->getData('overflow'))?>) + +
  • + +
+

__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?> +

+ +
\ No newline at end of file diff --git a/src/application/code/core/Wootook/Server/Mvc/Dispatcher.php b/application/design/base/default/scripts/empire/planet/shipyard/queue.phtml similarity index 100% rename from src/application/code/core/Wootook/Server/Mvc/Dispatcher.php rename to application/design/base/default/scripts/empire/planet/shipyard/queue.phtml diff --git a/src/application/design/frontend/base/default/scripts/empire/resources/default.phtml b/application/design/base/default/scripts/empire/resources/default.phtml similarity index 100% rename from src/application/design/frontend/base/default/scripts/empire/resources/default.phtml rename to application/design/base/default/scripts/empire/resources/default.phtml diff --git a/src/application/design/frontend/base/default/scripts/empire/resources/energy.phtml b/application/design/base/default/scripts/empire/resources/energy.phtml similarity index 100% rename from src/application/design/frontend/base/default/scripts/empire/resources/energy.phtml rename to application/design/base/default/scripts/empire/resources/energy.phtml diff --git a/application/design/base/default/scripts/empire/topnav.phtml b/application/design/base/default/scripts/empire/topnav.phtml new file mode 100644 index 0000000..bcac1dc --- /dev/null +++ b/application/design/base/default/scripts/empire/topnav.phtml @@ -0,0 +1,94 @@ +getCurrentPlanet();?> +
+
+
+getPlanetCollection() as $planet):?> + getId() != $currentPlanet->getId()):?> + + +
+

escape($planet->getName())?>

+
+ getMoon()) !== null): ?> + + + + + + + +
+

[escape($planet->getCoords())?>]

+
+ + +
+
+
+
+
+ <?php echo $this->__('Metal')?> +

+ getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> + +

+
+
+ <?php echo $this->__('Cristal')?> +

+ getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> + +

+
+
+ <?php echo $this->__('Deuterium')?> +

+ getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> + +

+
+
+ <?php echo $this->__('Energy')?> +

+ getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?> + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> + + renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> + +

+
+
+ <?php echo $this->__('Messages')?> +

+ getCurrentUser()->getNewMessagesCount()) > 1):?> + __('%1$d messages.', $count)?> + + __('1 message.')?> + + __('No message.')?> + +

+
+
diff --git a/src/application/design/install/base/default/scripts/page/1column.phtml b/application/design/base/default/scripts/page/1column.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/1column.phtml rename to application/design/base/default/scripts/page/1column.phtml diff --git a/src/application/design/install/base/default/scripts/page/2columns-left.phtml b/application/design/base/default/scripts/page/2columns-left.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/2columns-left.phtml rename to application/design/base/default/scripts/page/2columns-left.phtml diff --git a/src/application/design/install/base/default/scripts/page/2columns-right.phtml b/application/design/base/default/scripts/page/2columns-right.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/2columns-right.phtml rename to application/design/base/default/scripts/page/2columns-right.phtml diff --git a/src/application/design/install/base/default/scripts/page/3columns.phtml b/application/design/base/default/scripts/page/3columns.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/3columns.phtml rename to application/design/base/default/scripts/page/3columns.phtml diff --git a/src/application/design/backend/base/default/scripts/page/html/head.phtml b/application/design/base/default/scripts/page/html/head.phtml similarity index 88% rename from src/application/design/backend/base/default/scripts/page/html/head.phtml rename to application/design/base/default/scripts/page/html/head.phtml index b98b464..7301e63 100644 --- a/src/application/design/backend/base/default/scripts/page/html/head.phtml +++ b/application/design/base/default/scripts/page/html/head.phtml @@ -1,5 +1,5 @@ <?php echo $this->escape($this->getTitle())?> - + getCss() as $css):?> @@ -12,7 +12,7 @@ getJs() as $js):?> - + getSkinJs() as $js):?> diff --git a/src/application/design/backend/base/default/scripts/page/html/message.phtml b/application/design/base/default/scripts/page/html/message.phtml similarity index 100% rename from src/application/design/backend/base/default/scripts/page/html/message.phtml rename to application/design/base/default/scripts/page/html/message.phtml diff --git a/src/application/design/install/base/default/scripts/page/html/navigation.phtml b/application/design/base/default/scripts/page/html/navigation.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/html/navigation.phtml rename to application/design/base/default/scripts/page/html/navigation.phtml diff --git a/src/application/design/backend/base/default/scripts/page/html/navigation/link.phtml b/application/design/base/default/scripts/page/html/navigation/link.phtml similarity index 100% rename from src/application/design/backend/base/default/scripts/page/html/navigation/link.phtml rename to application/design/base/default/scripts/page/html/navigation/link.phtml diff --git a/src/application/design/install/base/default/scripts/page/html/navigation/node.phtml b/application/design/base/default/scripts/page/html/navigation/node.phtml similarity index 100% rename from src/application/design/install/base/default/scripts/page/html/navigation/node.phtml rename to application/design/base/default/scripts/page/html/navigation/node.phtml diff --git a/application/design/base/default/scripts/user/login.phtml b/application/design/base/default/scripts/user/login.phtml new file mode 100644 index 0000000..4e51e00 --- /dev/null +++ b/application/design/base/default/scripts/user/login.phtml @@ -0,0 +1,54 @@ +
+
+
+
+ + + + + + + + + + +
+ __('Username')?> + __('Password')?> +
+ __('Remember me')?> + +
+ __('I have lost my password.')?> +
+
+
+
+ +
+
__('Welcome on %s!', $this->escape($this->getData('server_name')))?>
+
+
+
+
__('%1$s make you an emperor. Conquer outer space and master other players on %1$s.', $this->getData('server_name'))?>
+
+
__('Register now!')?>
+
+
+
+ + __('Player count: ')?>getData('user_count')?> - + __('Latest player: ')?>getData('latest_player')?> - + __('Online players: ')?> getData('online_players')?> + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/player/registration.phtml b/application/design/base/default/scripts/user/registration.phtml similarity index 68% rename from src/application/design/frontend/base/default/scripts/player/registration.phtml rename to application/design/base/default/scripts/user/registration.phtml index efdea56..50b9876 100644 --- a/src/application/design/frontend/base/default/scripts/player/registration.phtml +++ b/application/design/base/default/scripts/user/registration.phtml @@ -1,40 +1,37 @@ -getLayout()->getMessagesBlock()->renderGroupedHtml()?> -
-

__('Register')?>

+ +

Wootook!

__('User data:')?> -

+

-

+

-

+

__('Password:')?> -

+

-

+

__('Planet:')?> -

+

-

- -

-
+ + \ No newline at end of file diff --git a/src/application/gamedata/legacies/default/combat.php b/application/gamedata/legacies/default/combat.php similarity index 100% rename from src/application/gamedata/legacies/default/combat.php rename to application/gamedata/legacies/default/combat.php diff --git a/src/application/gamedata/legacies/default/events.php b/application/gamedata/legacies/default/events.php similarity index 58% rename from src/application/gamedata/legacies/default/events.php rename to application/gamedata/legacies/default/events.php index 09af7ec..085569f 100644 --- a/src/application/gamedata/legacies/default/events.php +++ b/application/gamedata/legacies/default/events.php @@ -1,42 +1,38 @@ array(), 'layout.prepare.after' => array( - array('Wootook_Player_Model_Entity', 'layoutPrepareAfterListener') + array('Wootook_Empire_Model_User', 'layoutPrepareAfterListener') ), 'login.failure' => array(), 'login.success' => array(), 'logout.success' => array(), 'register.before' => array(), 'register.failure' => array(), - 'register.success' => array(), - 'user.init' => array(), - 'planet.init' => array( - array('Wootook_Empire_Model_Galaxy_Position', 'initPlanetListerner') + 'register.success' => array( + array('Wootook_Empire_Model_Planet', 'registrationListener') ), 'planet.update' => array( array('Wootook_Empire_Model_Planet', 'planetUpdateListener'), array('Legacies_Empire_Model_Planet_Building_Shipyard', 'planetUpdateListener'), - 'flyingFleetListener' + array('Legacies_Officers_Model_Observer', 'planetUpdateListener') + ), + 'user.init' => array( + array('Wootook_Empire_Model_Planet', 'registrationListener') + ), + 'planet.init' => array( + array('Wootook_Empire_Model_Galaxy_Position', 'initPlanetListerner') ), 'planet.shipyard.check-availability' => array(), 'planet.shipyard.update-queue.before' => array(), 'planet.shipyard.update-queue.after' => array(), 'planet.shipyard.append-queue.before' => array(), 'planet.shipyard.append-queue.after' => array(), - 'planet.building.building-time' => array(), - 'planet.shipyard.building-time' => array(), - 'planet.building.speed-enhancement' => array( - array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingEnhancementListener'), - array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingEnhancementListener') + 'planet.building.building-time' => array( + array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'), + array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener') ), - 'planet.shipyard.speed-enhancement' => array( - array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingEnhancementListener'), - array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingEnhancementListener') - ), - 'planet.research-lab.technology.speed-enhancement' => array( - array('Legacies_Empire_Model_Player_Technology_IntergalacticResearchNetwork', 'researchTechnologyEnhancementListener') - ), - 'core.mvc.controller.front.pre-dispatch' => array( - array('Wootook_Empire_Model_Planet', 'planetChangeListener') + 'planet.shipyard.building-time' => array( + array('Legacies_Empire_Model_Planet_Building_NaniteFactory', 'buildingTimeListener'), + array('Legacies_Empire_Model_Planet_Building_RoboticFactory', 'buildingTimeListener') ) ); diff --git a/src/application/gamedata/legacies/default/fields-alias.php b/application/gamedata/legacies/default/fields-alias.php similarity index 90% rename from src/application/gamedata/legacies/default/fields-alias.php rename to application/gamedata/legacies/default/fields-alias.php index 788a72c..2a56eb1 100644 --- a/src/application/gamedata/legacies/default/fields-alias.php +++ b/application/gamedata/legacies/default/fields-alias.php @@ -41,7 +41,6 @@ Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK => "intergalactic_tech", Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY => "expedition_tech", Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => "graviton_tech", - Legacies_Empire::ID_RESEARCH_ORE_MINING => "ore_mining_tech", // }}} // @@ -62,7 +61,6 @@ Legacies_Empire::ID_SHIP_DEATH_STAR => "dearth_star", Legacies_Empire::ID_SHIP_BATTLECRUISER => "battleship", Legacies_Empire::ID_SHIP_SUPERNOVA => "supernova", - Legacies_Empire::ID_SHIP_ORE_MININER => "ore_miner", // // @@ -80,4 +78,24 @@ Legacies_Empire::ID_SPECIAL_ANTIBALLISTIC_MISSILE => "interceptor_misil", Legacies_Empire::ID_SPECIAL_INTERPLANETARY_MISSILE => "interplanetary_misil", // }}} + +// +// Officers +// {{{ + 601 => "rpg_geologue", + 602 => "rpg_amiral", + 603 => "rpg_ingenieur", + 604 => "rpg_technocrate", + 605 => "rpg_constructeur", + 606 => "rpg_scientifique", + 607 => "rpg_stockeur", + 608 => "rpg_defenseur", + 609 => "rpg_bunker", + 610 => "rpg_espion", + 611 => "rpg_commandant", + 612 => "rpg_destructeur", + 613 => "rpg_general", + 614 => "rpg_raideur", + 615 => "rpg_empereur" +// }}} ); diff --git a/application/gamedata/legacies/default/modules.php b/application/gamedata/legacies/default/modules.php new file mode 100644 index 0000000..5a2bd48 --- /dev/null +++ b/application/gamedata/legacies/default/modules.php @@ -0,0 +1,9 @@ + array( + 'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'), + 'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block'), + 'legacies_core' => array('Legacies_Core_Block_' => 'Legacies/Core/Block'), + 'legacies_empire' => array('Legacies_Empire_Block_' => 'Legacies/Empire/Block'), + 'legacies_officers' => array('Legacies_Officers_Block_' => 'Legacies/Officers/Block') + ) + ); \ No newline at end of file diff --git a/src/application/gamedata/legacies/default/prices.php b/application/gamedata/legacies/default/prices.php similarity index 100% rename from src/application/gamedata/legacies/default/prices.php rename to application/gamedata/legacies/default/prices.php diff --git a/application/gamedata/legacies/default/production.php b/application/gamedata/legacies/default/production.php new file mode 100644 index 0000000..125faa4 --- /dev/null +++ b/application/gamedata/legacies/default/production.php @@ -0,0 +1,71 @@ + array( + Legacies_Empire::RESOURCE_METAL => 40, + Legacies_Empire::RESOURCE_CRISTAL => 10, + Legacies_Empire::RESOURCE_DEUTERIUM => 0, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 1.5, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_MetalMine' + ), + + Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array( + Legacies_Empire::RESOURCE_METAL => 30, + Legacies_Empire::RESOURCE_CRISTAL => 15, + Legacies_Empire::RESOURCE_DEUTERIUM => 0, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 1.6, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_CristalMine' + ), + + Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array( + Legacies_Empire::RESOURCE_METAL => 150, + Legacies_Empire::RESOURCE_CRISTAL => 50, + Legacies_Empire::RESOURCE_DEUTERIUM => 0, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 1.5, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser' + ), + + Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array( + Legacies_Empire::RESOURCE_METAL => 50, + Legacies_Empire::RESOURCE_CRISTAL => 20, + Legacies_Empire::RESOURCE_DEUTERIUM => 0, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 1.5, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_SolarPlant' + ), + + Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array( + Legacies_Empire::RESOURCE_METAL => 500, + Legacies_Empire::RESOURCE_CRISTAL => 200, + Legacies_Empire::RESOURCE_DEUTERIUM => 100, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 1.8, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Building_FusionReactor' + ), +// }}} + +// +// Ships production +// {{{ + Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array( + Legacies_Empire::RESOURCE_METAL => 0, + Legacies_Empire::RESOURCE_CRISTAL => 2000, + Legacies_Empire::RESOURCE_DEUTERIUM => 500, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 0.5, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite' + ), + Legacies_Empire::ID_SHIP_SUPERNOVA => array( + Legacies_Empire::RESOURCE_METAL => 0, + Legacies_Empire::RESOURCE_CRISTAL => 2000, + Legacies_Empire::RESOURCE_DEUTERIUM => 500, + Legacies_Empire::RESOURCE_ENERGY => 0, + Legacies_Empire::RESOURCE_MULTIPLIER => 0.5, + Legacies_Empire::RESOURCE_CLASS => 'Legacies_Empire_Model_Planet_Ship_Supernova' + ) +// }}} + ); diff --git a/src/application/gamedata/legacies/default/requirements.php b/application/gamedata/legacies/default/requirements.php similarity index 95% rename from src/application/gamedata/legacies/default/requirements.php rename to application/gamedata/legacies/default/requirements.php index 2ed5430..838a930 100644 --- a/src/application/gamedata/legacies/default/requirements.php +++ b/application/gamedata/legacies/default/requirements.php @@ -114,10 +114,6 @@ Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => 3 ), - Legacies_Empire::ID_RESEARCH_ORE_MINING => array( - Legacies_Empire::ID_BUILDING_RESEARCH_LAB => 2 - ), - Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array( Legacies_Empire::ID_BUILDING_RESEARCH_LAB => 12 ), @@ -211,13 +207,6 @@ Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => 14, Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => 3 ), - - Legacies_Empire::ID_SHIP_ORE_MININER => array( - Legacies_Empire::ID_BUILDING_SHIPYARD => 12, - Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => 8, - Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => 1, - Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => 16 - ), // }}} // diff --git a/src/application/gamedata/legacies/default/resources.php b/application/gamedata/legacies/default/resources.php similarity index 100% rename from src/application/gamedata/legacies/default/resources.php rename to application/gamedata/legacies/default/resources.php diff --git a/src/application/gamedata/legacies/default/types.php b/application/gamedata/legacies/default/types.php similarity index 97% rename from src/application/gamedata/legacies/default/types.php rename to application/gamedata/legacies/default/types.php index c67c74d..76c773d 100644 --- a/src/application/gamedata/legacies/default/types.php +++ b/application/gamedata/legacies/default/types.php @@ -75,7 +75,6 @@ Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY, Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK, Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY, - Legacies_Empire::ID_RESEARCH_ORE_MINING, Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY ), // }}} @@ -98,8 +97,7 @@ Legacies_Empire::ID_SHIP_DESTRUCTOR, Legacies_Empire::ID_SHIP_DEATH_STAR, Legacies_Empire::ID_SHIP_BATTLECRUISER, - Legacies_Empire::ID_SHIP_SUPERNOVA, - Legacies_Empire::ID_SHIP_ORE_MININER + Legacies_Empire::ID_SHIP_SUPERNOVA ), // }}} diff --git a/src/application/locale/en_US/Legacies_User.csv b/application/locale/en_US/Legacies_User.csv similarity index 100% rename from src/application/locale/en_US/Legacies_User.csv rename to application/locale/en_US/Legacies_User.csv diff --git a/src/application/locale/fr_FR/Legacies_User.csv b/application/locale/fr_FR/Legacies_User.csv similarity index 100% rename from src/application/locale/fr_FR/Legacies_User.csv rename to application/locale/fr_FR/Legacies_User.csv diff --git a/src/application/locale/fr_FR/Legacies_User.txt b/application/locale/fr_FR/Legacies_User.txt similarity index 100% rename from src/application/locale/fr_FR/Legacies_User.txt rename to application/locale/fr_FR/Legacies_User.txt diff --git a/application/scripts/legacies/client.js b/application/scripts/legacies/client.js new file mode 100644 index 0000000..203285c --- /dev/null +++ b/application/scripts/legacies/client.js @@ -0,0 +1,265 @@ +/** + * This file is part of Wootook + * + * @license http://www.gnu.org/licenses/gpl-3.0.txt +* @see http://www.wootook.com/ + * + * Copyright (c) 2009-Present, XNova Support Team + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing XNova. + * + */ +/** + * Main application script execution class + * + * @param string responder + * @param int messageOffset + */ + +function Legacies_Client(responder, messageOffset) { + if (!document.querySelectorAll) { + alert("Your browser is not compatible with CSS selectors API.\n\nCould not continue."); + return; + } + this.responder = responder; + this.messages = []; + this.messageId = messageOffset || 1; + this.callbacks = {}; + this.recurrentMessages = []; + + this.send = (function() { + if (this.messages.length == 0) { + return this; + } + var request = new XMLHttpRequest(); + request.open('POST', this.responder, false); + request.send(JSON.stringify(this.messages)); + this.messages = []; + for (var i in this.recurrentMessages) { + this.enqueue(this.recurrentMessages[i].action, this.recurrentMessages[i].params, this.recurrentMessages[i].callback); + } + if(request.status == 404) { + alert('Request failed, responder not found.'); + return this; + } + try { + var response = JSON.parse(request.responseText); + } catch (e) { + alert('Invalid response.'); + return this; + } + if(request.status == 200) { + for (var i in response) { + this._callback(response[i]); + } + } + return this; + }).bind(this); + + this.main = (function(interval) { + setInterval(this.send, interval || 30000); + }).bind(this); + + this.enqueue = (function(action, params){ + this.messages.push({'uid':this.messageId++,'action':action,'params':params}); + return this; + }).bind(this); + + this.enqueueRecurrent = (function(action, params, callback) { + this.recurrentMessages.push({'callback':callback,'action':action,'params':params}); + this.enqueue(action, params, callback); + }).bind(this); + + this._callback = (function(message){ + if (message.error === undefined || message.payload === undefined) { + return this; + } + if (message.error === true) { + if (typeof(message.payload.messages) == 'string') { + alert(message.payload.messages); + } else { + var info = ''; + for (var i in message.payload.messages) { + info = info + "\n[" + i + "]:\n" + message.payload.messages[i].join("\n") + "\n"; + } + alert("Errors were returned:\n" + info); + } + return this; + } + if (message.callback && this.CallbackType[message.callback]) { + (this.CallbackType[message.callback]).bind(this)(message.payload); + } + return this; + }).bind(this); + + this.login = (function(username, password, rememberme) { + var params = { + 'username': username, + 'password': password, + 'rememberme': rememberme || false + }; + this.enqueue('user.account.login', params).send(); + return this; + }).bind(this); + + this.logout = (function() { + this.enqueue('user.account.logout', {}).send(); + return this; + }).bind(this); + + this.form = (function(event) { + event.preventDefault(); + var form = event.target; + var params = {}; + for (var i = 0; i < form.length; i++) { + if (!form[i].name || !form[i].type) { + continue; + } + if (form[i].type == 'checkbox') { + if (form[i].checked) { + params[form[i].name] = true; + } else { + params[form[i].name] = false; + } + } else if (form[i].type == 'radio') { + params[form[i].name] = form[i].value; + } else if (form[i].value !== undefined) { + params[form[i].name] = form[i].value; + } + } + var action = form.action.slice(form.action.indexOf('#') + 1); + this.enqueue(action, params, this.CallbackType.updater).send(); + }).bind(this); + + this.CallbackType = { + redirector: function(payload) { + if (payload.redirect) { + document.location.href = payload.redirect; + } + }, + updater: function(payload) { + if (payload.html && payload.selector) { + var parent = $$(payload.selector); + var handler = document.createElement("div"); + handler.innerHTML = payload.html; + + var fragment = document.createDocumentFragment(); + for (var i = 0; i < handler.childNodes.length; i++) { + fragment.appendChild(handler.childNodes[i]); + } + + for (var i = 0; i < parent.length; i++) { + parent[i].appendChild(fragment.cloneNode(true)); + } + } + }, + script: function(payload) { + if (payload.script) { + eval(payload.script); + } + }, + error: function(payload) { + if (payload.messages) { + alert(payload.messages.join(', ')); + } + }, + show: function(payload) { + if (payload.selector) { + var elementList = $$(payload.selector); + for (var i = 0; i < elementList.length; i++) { + elementList[i].style.display = 'block'; + } + } + }, + hide: function(payload) { + if (payload.selector) { + var elementList = $$(payload.selector); + for (var i = 0; i < elementList.length; i++) { + elementList[i].style.display = 'none'; + } + } + }, + callback: function(payload) { + if (payload.callback) { + payload.callback.apply(this, payload.params); + } + }, + enqueueRecurrent: function(payload) { + if (payload.action && payload.params && payload.callback) { + this.enqueueRecurrent(payload.action, payload.params, payload.callback); + } + } + }; +} + +function Legacies_Element(object) { + object.listen = (function(event, callback) { + this.addEventListener(event, callback, false); + return this; + }).bind(object); + + return object; +} + +function Legacies_List(object) { + object.listen = (function(event, callback) { + for (var i in this) { + Legacies_Element(Legacies_Element[i]); + this[i].listen(event, callback); + } + return this; + }).bind(object); + + return object; +} + +function $A(object) { + return Array.prototype.slice.call(object); +} + +function $(element) { + if (typeof(element) == 'string') { + element = document.getElementById(element); + } + Legacies_Element(element); + return element; +} + +function $$(selector, context) { + context = context || document; + var nodeList = context.querySelectorAll(selector); + Legacies_List(nodeList); + return nodeList; +} + +function $E(element, methods) { + for (var i in methods) { + if (methods[i] === undefined) { + continue; + } + element[i] = function(){ + var args = $A(arguments); + args.unshift(element); + methods[i].apply(element, args); + } + element[i].bind(element); + } + return element; +} \ No newline at end of file diff --git a/application/scripts/sizzle.js b/application/scripts/sizzle.js new file mode 100644 index 0000000..07654d5 --- /dev/null +++ b/application/scripts/sizzle.js @@ -0,0 +1,1413 @@ +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE + +window.Sizzle = Sizzle; + +})(); diff --git a/application/test/UpdatePlanet.php b/application/test/UpdatePlanet.php new file mode 100644 index 0000000..f91e5af --- /dev/null +++ b/application/test/UpdatePlanet.php @@ -0,0 +1,163 @@ + 0, + + 'b_laboratory' => 0, + 'b_laboratory_id' => serialize(array()), + + "spy_tech" => 12, + "computer_tech" => 8, + "military_tech" => 10, + "defence_tech" => 10, + "shield_tech" => 10, + "energy_tech" => 8, + "hyperspace_tech" => 8, + "combustion_tech" => 6, + "impulse_motor_tech" => 6, + "hyperspace_motor_tech" => 6, + "laser_tech" => 6, + "ionic_tech" => 6, + "buster_tech" => 6, + "intergalactic_tech" => 0, + "expedition_tech" => 0, + "graviton_tech" => 0, + )); + +$data = array( + 'last_update' => 0, + 'planet_type' => 1, + + 'b_building_id' => '', + 'b_hangar_id' => serialize(array(/*array( + 'ship_id' => Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT, + 'qty' => 10, + 'created_at' => 0, + 'updated_at' => 0 + ), array( + 'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT, + 'qty' => 20, + 'created_at' => 600, + 'updated_at' => 600 + ), array( + 'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT, + 'qty' => 30, + 'created_at' => 650, + 'updated_at' => 650 + ), array( + 'ship_id' => Legacies_Empire::ID_SHIP_LARGE_TRANSPORT, + 'qty' => 40, + 'created_at' => 700, + 'updated_at' => 700 + )*/)), + + 'metal' => 500000, + 'metal_perhour' => 20, + 'cristal' => 500000, + 'cristal_perhour' => 10, + 'deuterium' => 300000, + 'deuterium_perhour' => 0, + 'energy_max' => 0, + 'energy_used' => 0, + + 'metal_mine_porcent' => 10, + 'cristal_mine_porcent' => 10, + 'solar_plant_porcent' => 10, + 'fusion_plant_porcent' => 10, + 'solar_satelit_porcent' => 10, + 'deuterium_sintetizer_porcent' => 10, + + 'metal_mine' => 20, + 'cristal_mine' => 19, + 'deuterium_sintetizer' => 0, + 'solar_plant' => 20, + 'fusion_plant' => 0, + 'robot_factory' => 0, + 'nano_factory' => 0, + 'hangar' => 12, + 'metal_store' => 10, + 'cristal_store' => 10, + 'deuterium_store' => 10, + + 'rpg_stockeur' => 0 + ); +$planet = new Legacies_Empire_Model_Planet($data); + +$planet->setUser($user); +//var_dump(array('$planet->setUser($user)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + +$planet->updateStorages(0); +//var_dump(array('$planet->updateStorages(0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + +$planet->updateResourceProduction(0); +//var_dump(array('$planet->updateResourceProduction(0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + +$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0); +//var_dump(array('$planet->getShipyard()->appendQueue(Legacies_Empire::ID_SHIP_LIGHT_FIGHTER, 10, 0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + +$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0); +//var_dump(array('$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0)', array_diff($planet->getAllDatas(), $data))); +$data = $planet->getAllDatas(); + +$userData = $user->getAllDatas(); +$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0); +var_dump(array('$planet->getResearchLab()->appendQueue(Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY, false, 0)', array_diff($planet->getAllDatas(), $data), array_diff($user->getAllDatas(), $userData))); +$data = $planet->getAllDatas(); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); + +Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet, + 'time' => 5400 + )); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); + +Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet, + 'time' => (3600 * 20) + )); + +$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 3600); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); + +Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet, + 'time' => (3600 * 30) + )); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); + +Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet, + 'time' => (3600 * 5000) + )); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); + +$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_CRISTAL_MINE, false, 0); +$planet->appendBuildingQueue(Legacies_Empire::ID_BUILDING_SOLAR_PLANT, false, 0); + +Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet, + 'time' => (3600 * 10000) + )); + +var_dump(array_diff($planet->getAllDatas(), $data)); +$data = $planet->getAllDatas(); \ No newline at end of file diff --git a/application/test/bootstrap.php b/application/test/bootstrap.php new file mode 100644 index 0000000..3eb5410 --- /dev/null +++ b/application/test/bootstrap.php @@ -0,0 +1,46 @@ + $listenerList) { + foreach ($listenerList as $listener) { + Wootook::registerListener($event, $listener); + } +} + +include ROOT_PATH . 'includes/constants.php'; \ No newline at end of file diff --git a/application/test/registration.php b/application/test/registration.php new file mode 100644 index 0000000..e02fbe7 --- /dev/null +++ b/application/test/registration.php @@ -0,0 +1,43 @@ + array(), + 'system' => array(), + ); +*/ +for ($i = 0; $i < 10000; $i++) { + $collection = Legacies_Empire_Model_Planet::searchMostFreeSystems(); + $collection->limit(1)->load(); + $systemInfo = $collection->current(); + + //var_dump($systemInfo->getallDatas()); + echo $systemInfo->getData('galaxy') . ';' . $systemInfo->getData('system') . PHP_EOL; +/* + $galaxy = $systemInfo->getData('galaxy'); + if (!isset($datas['galaxy'][$galaxy])) { + $datas['galaxy'][$galaxy] = 1; + } else { + $datas['galaxy'][$galaxy]++; + } + + $system = $systemInfo->getData('system'); + if (!isset($datas['system'][$system])) { + $datas['system'][$system] = 1; + } else { + $datas['system'][$system]++; + } +*/ +} +/* +asort($datas['galaxy'], SORT_NUMERIC); +asort($datas['system'], SORT_NUMERIC); + +var_dump($datas); +*/ \ No newline at end of file diff --git a/src/banned.php b/banned.php similarity index 94% rename from src/banned.php rename to banned.php index 7874d75..53c3b94 100644 --- a/src/banned.php +++ b/banned.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/buddy.php b/buddy.php similarity index 98% rename from src/buddy.php rename to buddy.php index edc72dc..a59aca3 100644 --- a/src/buddy.php +++ b/buddy.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/build.xml b/build.xml deleted file mode 100644 index fe8adf3..0000000 --- a/build.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/phpcs.xml b/build/phpcs.xml deleted file mode 100644 index b2c5440..0000000 --- a/build/phpcs.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - Default coding standard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/phpmd.xml b/build/phpmd.xml deleted file mode 100644 index 6a8b260..0000000 --- a/build/phpmd.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - Default coding standard - - - - - - - - - - - - - - - - - - diff --git a/buildings.php b/buildings.php new file mode 100644 index 0000000..46a4665 --- /dev/null +++ b/buildings.php @@ -0,0 +1,151 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + +includeLang('buildings'); + +$user = Wootook_Empire_Model_User::getSingleton(); +$planet = $user->getCurrentPlanet(); +$mode = isset($_GET['mode']) ? $_GET['mode'] : null; + +switch ($mode) { +case 'fleet': + if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) { + $layout = new Wootook_Core_Layout(); + $layout->load('message'); + + $block = $layout->getBlock('message'); + $block['title'] = Wootook::__('Shipyard is required'); + $block['message'] = Wootook::__('In order to build ships you will need to build a shipyard building.'); + + echo $layout->render(); + break; + } + + /** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */ + $shipyard = $planet->getShipyard(); + if (isset($_POST['ship']) && is_array($_POST['ship'])) { + foreach ($_POST['ship'] as $shipId => $count) { + $shipId = intval($shipId); + $count = intval($count); + + $shipyard->appendQueue($shipId, $count); + } + $planet->save(); + } + + $layout = new Wootook_Core_Layout(); + $layout->load('planet.shipyard'); + + echo $layout->render(); + break; + +case 'research': + if ($planet->getElement(Legacies_Empire::ID_BUILDING_RESEARCH_LAB) < 1) { + $layout = new Wootook_Core_Layout(); + $layout->load('message'); + + $block = $layout->getBlock('message'); + $block['title'] = Wootook::__('Research lab is required'); + $block['message'] = Wootook::__('In order to do technological researches, you will need to build a research lab building.'); + + echo $layout->render(); + break; + } + + if (isset($_GET['research']) && !empty($_GET['research'])) { + $data = $planet->getAllDatas(); + $planet->appendBuildingQueue(intval($_GET['research']), isset($_GET['destroy'])); + $planet->save(); + } else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) { + $planet->dequeueItem($_GET['cancel']); + $planet->save(); + } + + $layout = new Wootook_Core_Layout(); + $layout->load('planet.research-lab'); + + echo $layout->render(); + break; + +case 'defense': + if ($planet->getElement(Legacies_Empire::ID_BUILDING_SHIPYARD) < 1) { + $layout = new Wootook_Core_Layout(); + $layout->load('message'); + + $block = $layout->getBlock('message'); + $block['title'] = Wootook::__('Shipyard is required'); + $block['message'] = Wootook::__('In order to build ships you will need to build a shipyard building.'); + + echo $layout->render(); + break; + } + + /** @var Legacies_Empire_Model_Planet_Building_Shipyard $shipyard */ + $shipyard = $planet->getShipyard(); + if (isset($_POST['defense']) && is_array($_POST['defense'])) { + foreach ($_POST['defense'] as $defenseId => $count) { + $defenseId = intval($defenseId); + $count = intval($count); + + $shipyard->appendQueue($defenseId, $count); + } + $planet->save(); + } + + $layout = new Wootook_Core_Layout(); + $layout->load('planet.defense'); + + /** @var Legacies_Empire_Block_Planet_Shipyard $block */ + $block = $layout->getBlock('item-list'); + $block->setType(Legacies_Empire::TYPE_DEFENSE); + + echo $layout->render(); + break; + +default: + if (isset($_GET['building']) && !empty($_GET['building'])) { + $data = $planet->getAllDatas(); + $planet->appendBuildingQueue(intval($_GET['building']), isset($_GET['destroy'])); + $planet->save(); + } else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) { + $planet->dequeueItem($_GET['cancel']); + $planet->save(); + } + + $layout = new Wootook_Core_Layout(); + $layout->load('planet.buildings'); + echo $layout->render(); + break; +} + diff --git a/src/calc.php b/calc.php similarity index 98% rename from src/calc.php rename to calc.php index ab69276..13c5db8 100644 --- a/src/calc.php +++ b/calc.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/changelog.php b/changelog.php similarity index 93% rename from src/changelog.php rename to changelog.php index ff78373..00df85d 100644 --- a/src/changelog.php +++ b/changelog.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/chat.php b/chat.php similarity index 92% rename from src/chat.php rename to chat.php index a10f64b..16254dd 100644 --- a/src/chat.php +++ b/chat.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/chat_add.php b/chat_add.php similarity index 94% rename from src/chat_add.php rename to chat_add.php index 62381d4..f3f8c13 100644 --- a/src/chat_add.php +++ b/chat_add.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/chat_msg.php b/chat_msg.php similarity index 94% rename from src/chat_msg.php rename to chat_msg.php index 7228440..acb1bfa 100644 --- a/src/chat_msg.php +++ b/chat_msg.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -62,7 +62,7 @@ while($v=mysql_fetch_object($query)){ $msg=preg_replace("#:\(#isU","\":(\"",$msg); $msg=preg_replace("#;\)#isU","\";)\"",$msg); $msg=preg_replace("#:s#isU","\":s\"",$msg); - $msg=preg_replace("#xnova#","Wootook",$msg); + $msg=preg_replace("#xnova#","Wootook",$msg); // Affichage du message $msg="
".$nick." > ".$msg."
"; diff --git a/src/application/code/core/Wootook/Empire/install/mysql5/.placeholder b/config.php similarity index 100% rename from src/application/code/core/Wootook/Empire/install/mysql5/.placeholder rename to config.php diff --git a/config.php.default b/config.php.default new file mode 100644 index 0000000..fcc1572 --- /dev/null +++ b/config.php.default @@ -0,0 +1,34 @@ + array( + 'storyline' => array( + 'universe' => 'legacies', + 'episode' => 'default', + ), + 'web' => array( + 'base_url' => 'http://testing.xnova-legacies.org/' + ), + 'date' => array( + 'timezone' => 'Europe/Paris' + ), + 'database' => array( + 'engine' => 'mysql', + 'options' => array( + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => '', + 'database' => 'db_xnova' + ), + 'table_prefix' => 'game_', + ), + 'layout' => array( + 'page' => 'page.php', + 'empire' => 'empire.php' + ), + 'locales' => array( + 'fr' => 'fr_FR', + 'fr_FR' => 'fr_FR', + 'en' => 'en_US', + 'en_US' => 'en_US' + ) + ) + ); \ No newline at end of file diff --git a/src/contact.php b/contact.php similarity index 95% rename from src/contact.php rename to contact.php index 437950c..17fc8bf 100644 --- a/src/contact.php +++ b/contact.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/emoticones/Oo.png b/emoticones/Oo.png similarity index 100% rename from src/emoticones/Oo.png rename to emoticones/Oo.png diff --git a/src/emoticones/Smile.png b/emoticones/Smile.png similarity index 100% rename from src/emoticones/Smile.png rename to emoticones/Smile.png diff --git a/src/emoticones/cool.png b/emoticones/cool.png similarity index 100% rename from src/emoticones/cool.png rename to emoticones/cool.png diff --git a/src/emoticones/grrr.png b/emoticones/grrr.png similarity index 100% rename from src/emoticones/grrr.png rename to emoticones/grrr.png diff --git a/src/emoticones/love.png b/emoticones/love.png similarity index 100% rename from src/emoticones/love.png rename to emoticones/love.png diff --git a/src/emoticones/msn.png b/emoticones/msn.png similarity index 100% rename from src/emoticones/msn.png rename to emoticones/msn.png diff --git a/src/emoticones/perdu.png b/emoticones/perdu.png similarity index 100% rename from src/emoticones/perdu.png rename to emoticones/perdu.png diff --git a/src/emoticones/wink.png b/emoticones/wink.png similarity index 100% rename from src/emoticones/wink.png rename to emoticones/wink.png diff --git a/src/emoticones/wow.png b/emoticones/wow.png similarity index 100% rename from src/emoticones/wow.png rename to emoticones/wow.png diff --git a/src/favicon.ico b/favicon.ico similarity index 100% rename from src/favicon.ico rename to favicon.ico diff --git a/src/fleet.php b/fleet.php similarity index 93% rename from src/fleet.php rename to fleet.php index e43bc39..8ed31d9 100644 --- a/src/fleet.php +++ b/fleet.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -31,7 +31,6 @@ define('INSIDE' , true); define('INSTALL' , false); require_once dirname(__FILE__) .'/application/bootstrap.php'; -$labels = Wootook_Empire_Helper_Config_Labels::getSingleton(); //Compteur de flotte en expéditions et nombre d'expédition maximum $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY); @@ -69,18 +68,18 @@ $position = isset($_GET['planet']) ? intval($_GET['planet']) : 0; $planetType = isset($_GET['planettype']) ? intval($_GET['planettype']) : 0; $targetMission = isset($_GET['target_mission']) ? intval($_GET['target_mission']) : 0; -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); +$user = Wootook_Empire_Model_User::getSingleton(); $planet = $user->getCurrentPlanet(); $MaxFlyingFleets = $user->getFleetCount(); -if ($galaxy <= 0 || $galaxy > Wootook::getGameConfig('engine/universe/galaxies')) { +if ($galaxy <= 0 || $galaxy > MAX_GALAXY_IN_WORLD) { $galaxy = $planet['galaxy']; } -if ($system <= 0 || $system > Wootook::getGameConfig('engine/universe/systems')) { +if ($system <= 0 || $system > MAX_SYSTEM_IN_GALAXY) { $system = $planet['system']; } -if ($position <= 0 || $position > Wootook::getGameConfig('engine/universe/positions')) { +if ($position <= 0 || $position > MAX_PLANET_IN_SYSTEM) { $position = $planet['planet']; } @@ -231,11 +230,11 @@ $ShipData = ""; $have_ships = false; foreach ($reslist['fleet'] as $n => $i) { - if ($planet->getElement($i) > 0) { + if ($planet[$resource[$i]] > 0) { $page .= ""; - $page .= "" . $labels[$i]['name'] . ""; - $page .= "". pretty_number ($planet->getElement($i)); - $ShipData .= "getElement($i) ."\" />"; + $page .= "" . $lang['tech'][$i] . ""; + $page .= "". pretty_number ($planet[$resource[$i]]); + $ShipData .= ""; $ShipData .= ""; $ShipData .= ""; $ShipData .= ""; @@ -245,7 +244,7 @@ foreach ($reslist['fleet'] as $n => $i) { $page .= ""; } else { $page .= "".$lang['fl_selmax']." "; - $page .= "getElement($i) ."\" onChange=\"shortInfo()\" onKeyUp=\"shortInfo()\" />"; + $page .= ""; } $page .= ""; $have_ships = true; diff --git a/fleetback.php b/fleetback.php new file mode 100644 index 0000000..d82571b --- /dev/null +++ b/fleetback.php @@ -0,0 +1,73 @@ + +Website: http://project.galacticnova.vinilox.eu/ +Last revision: 13/07/11 + +*/ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + includeLang('fleet'); + + $BoxTitle = $lang['fl_error']; + $TxtColor = "red"; + $BoxMessage = $lang['fl_notback']; + if ( is_numeric($_POST['fleetid']) ) { + $fleetid = intval($_POST['fleetid']); + + $FleetRow = doquery("SELECT * FROM {{table}} WHERE `fleet_id` = '". $fleetid ."';", 'fleets', true); + $i = 0; + + if ($FleetRow['fleet_owner'] == $user['id']) { + if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) { + if ($FleetRow['fleet_end_stay'] != 0) { + // Faut calculer le temps reel de retour + if ($FleetRow['fleet_start_time'] > time()) { + // On a pas encore entamé le stationnement + // Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte + $CurrentFlyingTime = time() - $FleetRow['start_time']; + } else { + // On est deja en stationnement + // Il faut donc directement calculer la durée d'un vol aller ou retour + $CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time']; + } + } else { + // C'est quoi le stationnement ?? + // On calcule sagement la parcelle de temps ecoulée depuis le depart + $CurrentFlyingTime = time() - $FleetRow['start_time']; + } + // Allez houste au bout du compte y a la maison !! (E.T. phone home.............) + $ReturnFlyingTime = $CurrentFlyingTime + time(); + + $QryUpdateFleet = "UPDATE {{table}} SET "; + $QryUpdateFleet .= "`fleet_start_time` = '". (time() - 1) ."', "; + $QryUpdateFleet .= "`fleet_end_stay` = '0', "; + $QryUpdateFleet .= "`fleet_end_time` = '". ($ReturnFlyingTime + 1) ."', "; + $QryUpdateFleet .= "`fleet_target_owner` = '". $user['id'] ."', "; + $QryUpdateFleet .= "`fleet_mess` = '1' "; + $QryUpdateFleet .= "WHERE "; + $QryUpdateFleet .= "`fleet_id` = '" . $fleetid . "';"; + doquery( $QryUpdateFleet, 'fleets'); + + $BoxTitle = $lang['fl_sback']; + $TxtColor = "lime"; + $BoxMessage = $lang['fl_isback']; + } elseif ($FleetRow['fleet_mess'] == 1) { + $BoxMessage = $lang['fl_notback']; + } + } else { + $BoxMessage = $lang['fl_onlyyours']; + } + } + + message ("". $BoxMessage ."", $BoxTitle, "fleet.". PHPEXT, 2); + +// ----------------------------------------------------------------------------------------------------------- +?> diff --git a/fleetshortcut.php b/fleetshortcut.php new file mode 100644 index 0000000..538c8ae --- /dev/null +++ b/fleetshortcut.php @@ -0,0 +1,165 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + + +$mode = $_GET['mode']; +$a = $_GET['a']; +/* + Este script es original xD + La funcion de este script es administrar una variable del $user + Permite agregar y quitar arrays... +*/ +//Lets start! +if(isset($_GET['mode'])){ + if($_POST){ + //Pegamos el texto :P + if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";} + + $r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n"; + $user['fleet_shortcut'] .= $r; + doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users"); + message("Le raccourcis a été enregistré !","Enregistrment","fleetshortcut.php"); + } + $page = "
+ + + + "; + $page .= '
Nom [Galaxie/Système solaire/Planète]
+ + + + + +
"; + //Muestra un (L) si el destino pertenece a luna, lo mismo para escombros + $page .= "
Effacer
'; +} +elseif(isset($_GET['a'])){ + if($_POST){ + //Armamos el array... + $scarray = explode("\r\n",$user['fleet_shortcut']); + if($_POST["delete"]){ + unset($scarray[$a]); + $user['fleet_shortcut'] = implode("\r\n",$scarray); + doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users"); + message("Shortcut wurde gelöscht","Gelöscht","fleetshortcut.php"); + } + else{ + $r = explode(",",$scarray[$a]); + $r[0] = strip_tags($_POST['n']); + $r[1] = intval($_POST['g']); + $r[2] = intval($_POST['s']); + $r[3] = intval($_POST['p']); + $r[4] = intval($_POST['t']); + $scarray[$a] = implode(",",$r); + $user['fleet_shortcut'] = implode("\r\n",$scarray); + doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users"); + message("Le raccourcis a été édité !.","Editer","fleetshortcut.php"); + } + } + if($user['fleet_shortcut']){ + + $scarray = explode("\r\n",$user['fleet_shortcut']); + $c = explode(',',$scarray[$a]); + + $page = "
+ + + "; + //if($i==0){$page .= "";} + $page .= " + "; + + }else{$page .= message("Le raccourcis a été enregistré !","Enregistrer","fleetshortcut.php");} + + $page .= '
Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]
+ + + + + + +
"; + $page .= "
Retour
'; + + +} +else{ + + $page = ' + + + '; + + if($user['fleet_shortcut']){ + /* + Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones + de acceso directo, el formato es el siguiente. + Nombre, Galaxia,Sistema,Planeta,Tipo + */ + $scarray = explode("\r\n",$user['fleet_shortcut']); + $i=$e=0; + foreach($scarray as $a => $b){ + if($b!=""){ + $c = explode(',',$b); + if($i==0){$page .= "";} + $page .= ""; + if($i==1){$page .= "";} + if($i==1){$i=0;}else{$i=1;} + } + + } + if($i==1){$page .= "";} + + }else{$page .= "";} + + $page .= '
Raccourcis(Ajout)
"; + $page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}"; + //Muestra un (L) si el destino pertenece a luna, lo mismo para escombros + if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";} + $page .= "
Pas de Raccourcis
Retour
'; +} +display($page,"Shortcutmanager"); + +// Created by Perberos. All rights reversed (C) 2006 +?> diff --git a/src/floten1.php b/floten1.php similarity index 86% rename from src/floten1.php rename to floten1.php index 5c881a1..42bb9c7 100644 --- a/src/floten1.php +++ b/floten1.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -46,7 +46,7 @@ $speed = array( 1 => 10, ); -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); +$user = Wootook_Empire_Model_User::getSingleton(); $planetrow = $user->getCurrentPlanet(); $g = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0; @@ -54,13 +54,13 @@ $s = isset($_POST['system']) ? intval($_POST['system']) : 0; $p = isset($_POST['planet']) ? intval($_POST['planet']) : 0; $t = isset($_POST['planet_type']) ? intval($_POST['planet_type']) : 0; -if ($g <= 0 || $g > Wootook::getGameConfig('engine/universe/galaxies')) { +if ($g <= 0 || $g > MAX_GALAXY_IN_WORLD) { $g = $planetrow['galaxy']; } -if ($s <= 0 || $s > Wootook::getGameConfig('engine/universe/systems')) { +if ($s <= 0 || $s > MAX_SYSTEM_IN_GALAXY) { $s = $planetrow['system']; } -if ($p <= 0 || $p > Wootook::getGameConfig('engine/universe/positions')) { +if ($p <= 0 || $p > MAX_PLANET_IN_SYSTEM) { $p = $planetrow['planet']; } $allowedPlanetTypes = array( @@ -128,8 +128,8 @@ if (empty($fleetArray)) { $speedFactor = GetGameSpeedFactor(); $session['speedallsmin'] = $speedallsmin; -$scriptPath = Wootook::getStaticUrl('scripts/flotten.js'); -$page = ""; +$scriptPath = Wootook::getUrl('scripts/flotten.js'); +$page .= ""; $page .= ""; diff --git a/src/floten2.php b/floten2.php similarity index 80% rename from src/floten2.php rename to floten2.php index 1563070..367df96 100644 --- a/src/floten2.php +++ b/floten2.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify @@ -37,20 +37,20 @@ $session = Wootook::getSession('fleet'); $galaxy = isset($_POST['galaxy']) ? intval($_POST['galaxy']) : 0; $system = isset($_POST['system']) ? intval($_POST['system']) : 0; -$position = isset($_POST['planet']) ? intval($_POST['planet']) : 0; -$planetType = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0; +$planet = isset($_POST['planet']) ? intval($_POST['planet']) : 0; +$planettype = isset($_POST['planettype']) ? intval($_POST['planettype']) : 0; $speed = isset($_POST['speed']) ? intval($_POST['speed']) : 10; $coords = array( 'galaxy' => $galaxy, 'system' => $system, - 'position' => $position + 'position' => $planet ); -$destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $planetType); +$destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $planettype); $session['planet_destination'] = $destination->getId(); -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); -$planet = $user->getCurrentPlanet(); +$user = Wootook_Empire_Model_User::getSingleton(); +$planetrow = $user->getCurrentPlanet(); $YourPlanet = false; if ($destination->getUserId() == $user->getId()) { @@ -62,28 +62,22 @@ if ($destination->getId()) { } $fleetArray = $session['fleet']; -if (empty($fleetArray)) { - Wootook::getResponse() - ->setRedirect(Wootook::getStaticUrl('fleet.php')) - ->sendHeaders(); - exit(0); -} $missionTypes = array(); // Determinons les type de missions possibles par rapport a la planete cible -if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { +if ($position == (MAX_PLANET_IN_SYSTEM + 1)) { $missionTypes[Legacies_Empire::ID_MISSION_EXPEDITION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION]; } else { - if ($planetType == Wootook_Empire_Model_Planet::TYPE_DEBRIS) { + if ($planettype == Wootook_Empire_Model_Planet::TYPE_DEBRIS) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) { $missionTypes[Legacies_Empire::ID_MISSION_RECYCLE] = $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE]; } - } else if ($planetType == Wootook_Empire_Model_Planet::TYPE_PLANET) { + } else if ($planettype == Wootook_Empire_Model_Planet::TYPE_PLANET) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) { $missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][7]; } - } else if ($planetType == Wootook_Empire_Model_Planet::TYPE_MOON) { + } else if ($planettype == Wootook_Empire_Model_Planet::TYPE_MOON) { if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) && !$YourPlanet && $UsedPlanet) { @@ -91,7 +85,7 @@ if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { } } - if (in_array($planetType, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) { + if (in_array($planettype, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) { if (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && !$YourPlanet) { $missionTypes[Legacies_Empire::ID_MISSION_SPY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SPY]; } @@ -102,8 +96,9 @@ if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { (isset($fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER]) && $fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_CRUISER]) && $fleetArray[Legacies_Empire::ID_SHIP_CRUISER] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP] > 0) || + (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && Wootook::getGameConfig('engine/combat/allow_spy_drone_attacks')) || + (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && ALLOW_SPY_DRONE_ATTACKS) || (isset($fleetArray[Legacies_Empire::ID_SHIP_BOMBER]) && $fleetArray[Legacies_Empire::ID_SHIP_BOMBER] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR]) && $fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR] > 0) || (isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) || @@ -130,11 +125,11 @@ if (isset($fleetArray[Legacies_Empire::ID_SHIP_SOLAR_SATELLITE])) { $mission = isset($_POST['target_mission']) ? $_POST['target_mission'] : 0; -$SpeedFactor = Wootook::getGameConfig('game/speed/general'); +$SpeedFactor = GetGameSpeedFactor(); $AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user); $MaxFleetSpeed = min($AllFleetSpeed); -$distance = GetTargetDistance($planet->getGalaxy(), $galaxy, $planet->getSystem(), $system, $planet->getPosition(), $position); +$distance = GetTargetDistance($planetrow->getGalaxy(), $galaxy, $planetrow->getSystem(), $system, $planetrow->getPosition(), $planet); $duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor); $consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user ); @@ -144,12 +139,12 @@ $session['consumption'] = $consumption; $session['speed'] = $speed; $session['galaxy'] = $galaxy; $session['system'] = $system; -$session['position'] = $position; -$session['type'] = $planetType; +$session['position'] = $planet; +$session['type'] = $planettype; $MissionSelector = ""; if (count($missionTypes) > 0) { - if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { + if ($planet == (MAX_PLANET_IN_SYSTEM + 1)) { $MissionSelector .= ""; $MissionSelector .= ""; $MissionSelector .= "". $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION] ."

"; @@ -176,36 +171,27 @@ if (count($missionTypes) > 0) { $MissionSelector .= ""; } -if ($planet->isPlanet()) { - $TableTitle = "{$planet->getCoords()} - {$lang['fl_planet']}"; -} elseif ($planet->isMoon()) { - $TableTitle = "{$planet->getCoords()} - {$lang['fl_moon']}"; +if ($planetrow->isPlanet()) { + $TableTitle = "{$planetrow->getCoords()} - {$lang['fl_planet']}"; +} elseif ($planetrow->isMoon()) { + $TableTitle = "{$planetrow->getCoords()} - {$lang['fl_moon']}"; } -$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); $maxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY); $ExpeditionEnCours = 0; $EnvoiMaxExpedition = 0; if ($maxExpedition >= 1) { - $ExpeditionEnCours = $readAdapter->select() - ->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')) - ->from(array('fleet' => $readAdapter->getTable('fleets'))) - ->where('fleet_owner', $user->getId()) - ->where('fleet_mission', Legacies_Empire::ID_MISSION_EXPEDITION) - ->prepare() - ->fetchColumn() - ; + $maxexpde = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."' AND `fleet_mission` = '15';", 'fleets'); + $ExpeditionEnCours = $maxexpde->rowCount(); + $maxexpde->closeCursor(); - $EnvoiMaxExpedition = 1 + floor(sqrt($maxExpedition)); + $EnvoiMaxExpedition = 1 + floor($maxExpedition / 3); } -$MaxFlyingFleets = $readAdapter->select() - ->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')) - ->from(array('fleet' => $readAdapter->getTable('fleets'))) - ->where('fleet_owner', $user->getId()) - ->prepare() - ->fetchColumn() -; +$maxfleet = doquery("SELECT 1 FROM {{table}} WHERE `fleet_owner` = '".$user['id']."';", 'fleets'); + +$MaxFlyingFleets = $maxfleet->rowCount(); +$maxfleet->closeCursor(); $page = ""; $page .= " -JS_EOF; - echo '

Configuration profiler

'; - echo ''; - echo '
'; - $config = clone Wootook::getConfig(); - foreach ($config->getConfig('resource/database') as $node) { - if ($node->params) { - $node->params->reset(); - } - } - echo $this->_renderConfig(Wootook::getConfig(), 0); - echo '
'; - echo ''; - echo '
'; - echo $this->_renderConfig(Wootook::getWebsiteConfig()); - echo '
'; - echo ''; - echo '
'; - echo $this->_renderConfig(Wootook::getGameConfig()); - echo '
'; - echo ''; - echo << -(function(){ -var sections = jQuery('.config-profiler'); -sections.each(function(){ - var element = jQuery(this); - element.hide(); - }); - -jQuery('.config-profiler-link').click(function(e){ - var rel = jQuery(this).attr('rel'); - sections.each(function(){ - var element = jQuery(this); - if (element.hasClass(rel) && !element.hasClass('opened')) { - element.slideDown(500, function(){element.addClass('opened');}); - } else { - element.slideUp(500, function(){element.removeClass('opened');}); - } - }); - }); -})(); - -JS_EOF; - } - - public static function register() - { - set_error_handler(array(self::getSingleton(), 'errorManager')); - set_exception_handler(array(self::getSingleton(), 'exceptionManager')); - - if (defined('DEBUG')) { - self::getSingleton()->_mute = false; - } - - if (self::$_isTraceRegistered === false && defined('DEBUG')) { - self::$_isTraceRegistered = true; - register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); - } - } - - public static function unregister($force = false) - { - restore_error_handler(); - restore_exception_handler(); - - self::getSingleton()->_mute = true; - - if ((self::$_isTraceRegistered === false && defined('DEBUG')) || $force) { - self::$_isTraceRegistered = true; - register_shutdown_function(array(self::getSingleton(), 'shutdownManager')); - } - } - - public function sleep() - { - $this->_listen = false; - } - - public function wakeup() - { - $this->_listen = true; - } -} diff --git a/src/application/code/core/Wootook/Core/Exception.php b/src/application/code/core/Wootook/Core/Exception.php deleted file mode 100644 index 7a9030d..0000000 --- a/src/application/code/core/Wootook/Core/Exception.php +++ /dev/null @@ -1,37 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * Enter description here ... - * @author Greg - * - */ -interface Wootook_Core_Exception extends Wootook_Exception {} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Exception/Database/AdapterError.php b/src/application/code/core/Wootook/Core/Exception/Database/AdapterError.php deleted file mode 100644 index a399398..0000000 --- a/src/application/code/core/Wootook/Core/Exception/Database/AdapterError.php +++ /dev/null @@ -1,20 +0,0 @@ -_adapter = $adapter; - } - - public function getAdapter() - { - return $this->_adapter; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Exception/Database/Error.php b/src/application/code/core/Wootook/Core/Exception/Database/Error.php deleted file mode 100644 index 6d485fa..0000000 --- a/src/application/code/core/Wootook/Core/Exception/Database/Error.php +++ /dev/null @@ -1,5 +0,0 @@ -_statement = $statement; - } - - public function getStatement() - { - return $this->_statement; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Exception/Deprecated.php b/src/application/code/core/Wootook/Core/Exception/Deprecated.php deleted file mode 100644 index 75cbf77..0000000 --- a/src/application/code/core/Wootook/Core/Exception/Deprecated.php +++ /dev/null @@ -1,7 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Exception/GameError.php b/src/application/code/core/Wootook/Core/Exception/GameError.php deleted file mode 100644 index ab228a8..0000000 --- a/src/application/code/core/Wootook/Core/Exception/GameError.php +++ /dev/null @@ -1,7 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } - - public function __toString() - { - return << - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * Enter description here ... - * @author Greg - * - */ -class Wootook_Core_Form -{ - protected $_elements = array(); - - protected $_request = null; - - /** - * - * Element class loader - * @var Wootook_Core_Form_ElementLoader - */ - protected $_elementLoader = null; - - /** - * - * Validator class loader - * @var Wootook_Core_Form_ValidatorLoader - */ - protected $_validatorLoader = null; - - /** - * - * Enter description here ... - * @var Wootook_Core_Model_Session - */ - protected $_session = null; - - public function __construct(Wootook_Core_Model_Session $session, Array $elements = array()) - { - $this->_session = $session; - - $this->_elementLoader = new Wootook_Core_Form_ElementLoader($this, array( - 'Wootook_Core_Form_Element_' => 'Wootook/Core/Form/Element' - )); - - $this->_validatorLoader = new Wootook_Core_Form_ValidatorLoader($this, array( - 'Wootook_Core_Form_Validator_' => 'Wootook/Core/Form/Validator' - )); - - $this->addElement('__formkey', 'text', array('form_key' => 'formKey')); - - foreach ($elements as $elementName => $elementConfig) { - if (is_string($elementConfig)) { - $this->addElement($elementName, $elementConfig); - } else if ($elementConfig instanceof Wootook_Core_Form_ElementAbstract) { - $this->addElement($elementName, $elementConfig); - } else { - if (isset($elementConfig['validators'])) { - $this->addElement($elementName, $elementConfig['type'], $elementConfig['validators']); - } else { - $this->addElement($elementName, $elementConfig['type']); - } - } - } - } - - public function validate() - { - foreach ($this->_elements as $element) { - if (!$element->validate()) { - return false; - } - } - return true; - } - - /** - * - * Enter description here ... - * @param string $name - * @param string|Wootook_Core_Form_ElementAbstract $type - * @return Wootook_Core_Form - */ - public function addElement($name, $type = 'text', Array $validators = array()) - { - if ($type instanceof Wootook_Core_Form_ElementAbstract) { - $this->_elements[$name] = $type; - $this->_elements[$name]->setForm($this); - } else { - $element = $this->_elementLoader->load($type); - - if ($element === null) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_RuntimeException(sprintf('Element %1$s (type: %2$s) could not be created.', $name, $type))); - return $this; - } - $element->setForm($this); - $this->_elements[$name] = $element; - } - $this->_elements[$name]->setName($name); - - foreach ($validators as $validatorName => $validatorType) { - if ($validatorType instanceof Wootook_Core_Form_ElementAbstract) { - $this->_elements[$name]->addValidator($validatorType, $validatorName); - } else { - $validator = $this->_validatorLoader->load($validatorType); - - if ($validator === null) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException(new Wootook_Core_Exception_RuntimeException(sprintf('Validator %1$s (type: %2$s) could not be created.', $validatorName, $validatorType))); - return $this; - } - $this->_elements[$name]->addValidator($validator, $validatorName); - } - } - - return $this; - } - - /** - * - * Enter description here ... - * @param string $name - * @return Wootook_Core_Form_ElementAbstract - */ - public function getElement($name) - { - if (!isset($this->_elements[$name])) { - return null; - } - - return $this->_elements[$name]; - } - - /** - * - * Enter description here ... - * @param string $name - * @return Wootook_Core_Model_Session - */ - public function getSession() - { - return $this->_session; - } - - public function setRequest(Wootook_Core_Mvc_Controller_Request_Http $request) - { - $this->_request = $request; - - return $this; - } - - /** - * - * Enter description here ... - * @return Wootook_Core_Mvc_Controller_Request_Http - */ - public function getRequest() - { - return $this->_request; - } - - public function getData() - { - $request = $this->getRequest(); - if ($request === null) { - return array(); - } - if ($request->isPost()) { - return $request->getAllPostData(); - } - return $request->getAllQueryData(); - } - - public function populate(Array $datas = array()) - { - $request = $this->getRequest(); - - foreach ($this->_elements as $elementName => $element) { - if (isset($datas[$elementName])) { - $element->populate($datas[$elementName]); - } else if ($request->isPost()) { - $element->populate($request->getPost($elementName)); - } else { - $element->populate($request->getQuery($elementName)); - } - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Element/Button.php b/src/application/code/core/Wootook/Core/Form/Element/Button.php deleted file mode 100644 index 4e17721..0000000 --- a/src/application/code/core/Wootook/Core/Form/Element/Button.php +++ /dev/null @@ -1,11 +0,0 @@ -setForm($form); - } - - $this->setName($name); - $this->setAllParams($params); - } - - abstract public function getType(); - - public function validate() - { - $data = $this->getData(); - - foreach ($this->_validators as $validator) { - if (!$validator->validate($this, $data)) { - return false; - } - } - return true; - } - - public function setName($name) - { - $this->_name = $name; - - return $this; - } - - public function getName() - { - return $this->_name; - } - - public function setAllParams($params) - { - $this->_params = $params; - - return $this; - } - - public function getAllParams() - { - return $this->_params; - } - - public function setParam($param, $value) - { - $this->_params[$param] = $value; - - return $this; - } - - public function getParam($param) - { - return $this->_params[$param]; - } - - public function hasParam($param) - { - return isset($this->_params[$param]); - } - - public function unsetParam($param) - { - unset($this->_params[$param]); - - return $this; - } - - public function setForm(Wootook_Core_Form $form) - { - $this->_form = $form; - - return $this; - } - - public function getForm() - { - return $this->_form; - } - - public function getData() - { - return $this->_value; - } - - public function populate($value) - { - $this->_value = $value; - - return $this; - } - - public function addValidator(Wootook_Core_Form_ValidatorAbstract $validator, $name = null) - { - if ($name === null) { - $this->_validators = array(); - $name = 'default'; - } - - $this->_validators[$name] = $validator; - - return $this; - } - - public function getValidator($name) - { - if (!isset($this->_validators[$name])) { - return null; - } - - return $this->_validators[$name]; - } - - public function clearValidator($name) - { - if (isset($this->_validators[$name])) { - unset($this->_validators[$name]); - } - - return $this; - } - - public function clearAllValidators() - { - $this->_validators = array(); - - return $this; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/ElementLoader.php b/src/application/code/core/Wootook/Core/Form/ElementLoader.php deleted file mode 100644 index 019f082..0000000 --- a/src/application/code/core/Wootook/Core/Form/ElementLoader.php +++ /dev/null @@ -1,37 +0,0 @@ -_form = $form; - - foreach ($namespaces as $namespace => $path) { - if (is_int($namespace)) { - $this->registerNamespace($path); - } else { - $this->registerNamespace($namespace, $path); - } - } - } - - protected function _load($className, $useSingleton, Array $constructorParams = array()) - { - $reflection = new ReflectionClass($className); - if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) { - $method = $reflection->getMethod('getSingleton'); - return $method->invoke(null); - } - - try { - return $reflection->newInstance($this->_form); - } catch (ReflectionException $e) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException($e); - return null; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Alnum.php b/src/application/code/core/Wootook/Core/Form/Validator/Alnum.php deleted file mode 100644 index cdacc4f..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Alnum.php +++ /dev/null @@ -1,21 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should only contain alphanumeric characters.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Alpha.php b/src/application/code/core/Wootook/Core/Form/Validator/Alpha.php deleted file mode 100644 index fb091ce..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Alpha.php +++ /dev/null @@ -1,21 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should only contain alphabetic characters.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Email.php b/src/application/code/core/Wootook/Core/Form/Validator/Email.php deleted file mode 100644 index 3ec8e21..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Email.php +++ /dev/null @@ -1,21 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should contain an email.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/FormKey.php b/src/application/code/core/Wootook/Core/Form/Validator/FormKey.php deleted file mode 100644 index 11f49d0..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/FormKey.php +++ /dev/null @@ -1,20 +0,0 @@ -getForm(); - $session = $form->getSession(); - - if ($session->getFormKey(false) == $data) { - return true; - } - - $this->_getSession($field) - ->addError('CSRF token failure.', $field->getName()); - - return false; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Hex.php b/src/application/code/core/Wootook/Core/Form/Validator/Hex.php deleted file mode 100644 index cbb2913..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Hex.php +++ /dev/null @@ -1,22 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should only contain numeric characters.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Host.php b/src/application/code/core/Wootook/Core/Form/Validator/Host.php deleted file mode 100644 index 4d1f7f5..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Host.php +++ /dev/null @@ -1,21 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should contain a host name.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Numeric.php b/src/application/code/core/Wootook/Core/Form/Validator/Numeric.php deleted file mode 100644 index 35f275d..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Numeric.php +++ /dev/null @@ -1,22 +0,0 @@ -_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" should only contain numeric characters.', $element->getName()); - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/Validator/Regex.php b/src/application/code/core/Wootook/Core/Form/Validator/Regex.php deleted file mode 100644 index 172a787..0000000 --- a/src/application/code/core/Wootook/Core/Form/Validator/Regex.php +++ /dev/null @@ -1,28 +0,0 @@ -_expression = $expression; - } - - public function validate(Wootook_Core_Form_ElementAbstract $element, $data) - { - if (!$this->_validate($element, $data)) { - $this->_getSession($element) - ->addError('Field "%s" does not match the validation pattern.', $element->getName()); - - return false; - } - return true; - } - - protected function _validate(Wootook_Core_Form_ElementAbstract $element, $data) - { - return preg_match($this->_expression, $data); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/ValidatorAbstract.php b/src/application/code/core/Wootook/Core/Form/ValidatorAbstract.php deleted file mode 100644 index d3f6da2..0000000 --- a/src/application/code/core/Wootook/Core/Form/ValidatorAbstract.php +++ /dev/null @@ -1,15 +0,0 @@ -getForm(); - if (!$form instanceof Wootook_Core_Form) { - return null; - } - return $element->getSession(); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Form/ValidatorLoader.php b/src/application/code/core/Wootook/Core/Form/ValidatorLoader.php deleted file mode 100644 index 123bd64..0000000 --- a/src/application/code/core/Wootook/Core/Form/ValidatorLoader.php +++ /dev/null @@ -1,37 +0,0 @@ -_form = $form; - - foreach ($namespaces as $namespace => $path) { - if (is_int($namespace)) { - $this->registerNamespace($path); - } else { - $this->registerNamespace($namespace, $path); - } - } - } - - protected function _load($className, $useSingleton, Array $constructorParams = array()) - { - $reflection = new ReflectionClass($className); - if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) { - $method = $reflection->getMethod('getSingleton'); - return $method->invoke(null); - } - - try { - return $reflection->newInstance(); - } catch (ReflectionException $e) { - Wootook_Core_ErrorProfiler::getSingleton() - ->addException($e); - return null; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/Model/Config.php b/src/application/code/core/Wootook/Core/Model/Config.php deleted file mode 100644 index 5607ddf..0000000 --- a/src/application/code/core/Wootook/Core/Model/Config.php +++ /dev/null @@ -1,61 +0,0 @@ -_tableName = 'core_config'; - $this->_idFieldNames = array('config_path', 'website_id', 'game_id'); - } - - public function setWebsiteId($websiteId) - { - return $this->setData('website_id', $websiteId); - } - - public function getWebsiteId() - { - return $this->getData('website_id'); - } - - public function setGameId($gameId) - { - return $this->setData('game_id', $gameId); - } - - public function getGameId() - { - return $this->getData('game_id'); - } - - public function setPath($path) - { - return $this->setData('config_path', $path); - } - - public function getPath() - { - return $this->getData('config_path'); - } - - public function setValue($value) - { - return $this->setData('config_value', $value); - } - - public function getValue() - { - return $this->getData('config_value'); - } -} diff --git a/src/application/code/core/Wootook/Core/Model/Game.php b/src/application/code/core/Wootook/Core/Model/Game.php deleted file mode 100644 index bc4c234..0000000 --- a/src/application/code/core/Wootook/Core/Model/Game.php +++ /dev/null @@ -1,23 +0,0 @@ -_tableName = 'core_game'; - $this->_idFieldName = 'game_id'; - } -} diff --git a/src/application/code/core/Wootook/Core/Model/Layout/Parser.php b/src/application/code/core/Wootook/Core/Model/Layout/Parser.php deleted file mode 100644 index 1e07ae8..0000000 --- a/src/application/code/core/Wootook/Core/Model/Layout/Parser.php +++ /dev/null @@ -1,165 +0,0 @@ - 0 && (time() - filemtime($cachePath) <= $cacheLifetime)) { - return include $cachePath; - } - - $parsedData = $this->_parse($filename); - - if ($cachePath !== null) { - $parsedData->save($cachePath); - } - - return $parsedData->toArray(); - } - - protected function _parse($filename) - { - $layout = simplexml_load_file($filename); - - if ($layout->getName() !== 'layout') { - return array(); - } - - $result = new Wootook_Core_Config_Adapter_Array(); - foreach ($layout->handle as $handle) { - $name = (string) $handle['name']; - if (empty($name)) { - continue; - } - - $handleNode = new Wootook_Core_Config_Node(array(), $result); - $result->$name = $handleNode; - - if (isset($handle->update)) { - $updateListNode = new Wootook_Core_Config_Node(array(), $handleNode); - $handleNode->update = $updateListNode; - - foreach ($handle->update as $update) { - if (isset($update['name'])) { - $updateListNode->__set(uniqid(), (string) $update['name']); - } - } - } - - if (isset($handle->block)) { - $this->_parseBlock($handle->block[0], $handleNode); - } - - if (isset($handle->reference)) { - $referenceListNode = new Wootook_Core_Config_Node(array(), $handleNode); - $handleNode->reference = $referenceListNode; - - foreach ($handle->reference as $reference) { - $referenceName = (string) $reference['name']; - if (empty($referenceName)) { - continue; - } - - $referenceNode = new Wootook_Core_Config_Node(array(), $referenceListNode); - $referenceListNode->$referenceName = $referenceNode; - - $this->_parseBlockBody($reference, $referenceNode); - } - } - } - - return $result; - } - - protected function _parseBlock(SimpleXMLElement $handle, Wootook_Core_Config_Node $blockNode) - { - foreach ($handle->attributes() as $attributeName => $attributeValue) { - $blockNode->$attributeName = (string) $attributeValue; - } - - $this->_parseBlockBody($handle, $blockNode); - } - - protected function _parseBlockBody(SimpleXMLElement $handle, Wootook_Core_Config_Node $blockNode) - { - if (isset($handle->block)) { - $childrenNode = new Wootook_Core_Config_Node(array(), $blockNode); - $blockNode->children = $childrenNode; - - foreach ($handle->block as $block) { - $blockName = (string) $block['name']; - if (empty($blockName)) { - continue; - } - - $childNode = new Wootook_Core_Config_Node(array(), $childrenNode); - $childrenNode->$blockName = $childNode; - - $this->_parseBlock($block, $childNode); - } - } - - if (isset($handle->action)) { - $actionListNode = new Wootook_Core_Config_Node(array(), $blockNode); - $blockNode->actions = $actionListNode; - - foreach ($handle->action as $action) { - $methodName = (string) $action['method']; - if (empty($methodName)) { - continue; - } - - $actionNode = new Wootook_Core_Config_Node(array( - 'method' => $methodName, - 'params' => array() - ), $actionListNode); - - $actionListNode[] = $actionNode; - - if (isset($action->param)) { - $paramsNode = $actionNode->params; - - foreach ($action->param as $param) { - $paramName = (string) $param['name']; - if (empty($paramName)) { - continue; - } - - if (count($param)) { - if (isset($param->const) && isset($param->const['name']) && defined((string) $param->const['name'])) { - $paramsNode->$paramName = constant((string) $param->const['name']); - } else { - $paramArrayNode = new Wootook_Core_Config_Node(array(), $paramsNode); - $paramsNode->$paramName = $paramArrayNode; - - $this->_parseArrayParam($param, $paramArrayNode); - } - } else { - $paramsNode->$paramName = (string) $param; - } - } - } - } - } - } - - protected function _parseArrayParam(SimpleXMLElement $element, Wootook_Core_Config_Node $parentNode) - { - foreach ($element->children() as $child) { - if (count($child)) { - $childNode = new Wootook_Core_Config_Node(array(), $parentNode); - $parentNode->{$child->getName()} = $childNode; - - $this->_parseArrayParam($child, $childNode); - continue; - } - - $parentNode->{$child->getName()} = (string) $child; - } - } -} diff --git a/src/application/code/core/Wootook/Core/Model/Session.php b/src/application/code/core/Wootook/Core/Model/Session.php deleted file mode 100644 index 2306f03..0000000 --- a/src/application/code/core/Wootook/Core/Model/Session.php +++ /dev/null @@ -1,226 +0,0 @@ - 'CRIT', - self::ERR => 'ERR', - self::WARN => 'WARN', - self::INFO => 'INFO', - self::DEBUG => 'DEBUG', - self::SUCCESS => 'SUCCESS' - ); - - protected $_messages = array(); - - const COOKIE_LIFETIME_CONFIG_KEY = 'web/session/time'; - const COOKIE_DOMAIN_CONFIG_KEY = 'web/session/domain'; - const COOKIE_PATH_CONFIG_KEY = 'web/session/path'; - - const IDENTIFIER_MESSAGES = 'messages'; - const IDENTIFIER_DATA = 'data'; - - public static function factory($namespace) - { - $namespace = (string) $namespace; - if (!isset(self::$_instances[$namespace])) { - self::$_instances[$namespace] = new self($namespace); - } - return self::$_instances[$namespace]; - } - - public static function destroy() - { - session_destroy(); - } - - public function __construct($namespace) - { - if (session_id() == '') { - session_set_cookie_params($this->getCookieLifetime(), $this->getCookiePath(), $this->getCookieDomain(), false, true); - - session_cache_limiter('private_no_expire'); - session_cache_expire(15); - - session_start(); - session_regenerate_id(true); - } - - if (!isset($_SESSION[$namespace])) { - $_SESSION[$namespace] = array( - self::IDENTIFIER_MESSAGES => array(), - self::IDENTIFIER_DATA => array() - ); - } - - if (!isset($_SESSION[$namespace][self::IDENTIFIER_MESSAGES]) || !is_array($_SESSION[$namespace][self::IDENTIFIER_MESSAGES])) { - $_SESSION[$namespace][self::IDENTIFIER_MESSAGES] = array(); - } - - $this->_data = &$_SESSION[$namespace][self::IDENTIFIER_DATA]; - $this->_messages = &$_SESSION[$namespace][self::IDENTIFIER_MESSAGES]; - } - - public function getCookieLifetime() - { - $lifetime = Wootook::getWebsiteConfig(self::COOKIE_LIFETIME_CONFIG_KEY); - if (!is_numeric($lifetime) || $lifetime <= 0) { - return 900; - } - - return $lifetime; - } - - public function getCookieDomain() - { - $domain = Wootook::getWebsiteConfig(self::COOKIE_DOMAIN_CONFIG_KEY); - if ($domain === null) { - return $_SERVER['SERVER_NAME']; - } - return $domain; - } - - public function getCookiePath() - { - $path = Wootook::getWebsiteConfig(self::COOKIE_PATH_CONFIG_KEY); - if ($path === null) { - return '/'; - } - return $path; - } - - public function getMessages($clear = true) - { - $messages = $this->_messages; - if ($clear == true) { - $this->_messages = array(); - } - return $messages; - } - - public function addMessage($message, $type = self::DEBUG) - { - if (!isset(self::$_levels[$type])) { - $type = self::DEBUG; - } - - if (!isset($this->_messages)) { - $this->_messages = array(); - } - if (!isset($this->_messages[self::$_levels[$type]])) { - $this->_messages[self::$_levels[$type]] = array(); - } - $this->_messages[self::$_levels[$type]][] = $message; - - return $this; - } - - public function addCritical($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::CRIT); - } - - public function addError($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::ERR); - } - - public function addWarning($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::WARN); - } - - public function addSuccess($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::SUCCESS); - } - - public function addInfo($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::INFO); - } - - public function addDebug($message, $_ = null) - { - $args = func_get_args(); - array_shift($args); - - return $this->addMessage(vsprintf($message, $args), self::DEBUG); - } - - public function initFormKey() - { - $key = $this->getData('form_key'); - $this->setData('form_key', uniqid()); - - return $key; - } - - public function getFormKey($reset = true) - { - if (!$this->getData('form_key')) { - $this->initFormKey(); - return $this->getData('form_key'); - } - - if ($reset === true) { - $this->initFormKey(); - } - - return $this->getData('form_key'); - } - - public function setFormData(Array $data = array()) - { - if (isset($data['__formkey'])) { - unset($data['__formkey']); - } - - $this->setData('form_data', $data); - - return $this; - } - - public function getFormData($key = null, $default = null) - { - $data = $this->getData('form_data'); - if ($key === null) { - return $data; - } else if (isset($data[$key])) { - return $data[$key]; - } - return $default; - } -} diff --git a/src/application/code/core/Wootook/Core/Model/Website.php b/src/application/code/core/Wootook/Core/Model/Website.php deleted file mode 100644 index 018edac..0000000 --- a/src/application/code/core/Wootook/Core/Model/Website.php +++ /dev/null @@ -1,23 +0,0 @@ -_tableName = 'core_website'; - $this->_idFieldName = 'website_id'; - } -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Action.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Action.php deleted file mode 100644 index e6230ba..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Action.php +++ /dev/null @@ -1,164 +0,0 @@ -setRequest($request); - $this->setResponse($response); - } - - public function init() - { - } - - public function preDispatch() - { - } - - public function postDispatch() - { - } - - public function setRequest(Wootook_Core_Mvc_Controller_Request_Http $request) - { - $this->_request = $request; - - return $this; - } - - public function setResponse(Wootook_Core_Mvc_Controller_Response_Http $response) - { - $this->_response = $response; - - return $this; - } - - /** - * - * @return Wootook_Core_Mvc_Controller_Request_Http - */ - public function getRequest() - { - return $this->_request; - } - - /** - * - * @return Wootook_Core_Mvc_Controller_Response_Http - */ - public function getResponse() - { - return $this->_response; - } - - protected function _forward($action, $controller = null, $module = null) - { - $request = $this->getRequest(); - - $request->setActionName($action); - if ($controller !== null) { - $request->setControllerName($controller); - if ($module != null) { - $request->setModuleName($module); - } - } - $this->getResponse()->setIsDispatched(false); - } - - protected function _redirect($uri, Array $params = array(), $code = Wootook_Core_Mvc_Controller_Response_Http::REDIRECT_FOUND) - { - $parts = explode('/', $uri); - $partsCount = count($parts); - if ($partsCount > 0 && $parts[0] == '*') { - $parts[0] = $this->getRequest()->getModuleName(); - if ($partsCount > 1 && $parts[1] == '*') { - $parts[1] = $this->getRequest()->getControllerName(); - if ($partsCount > 2 && $parts[2] == '*') { - $parts[2] = $this->getRequest()->getActionName(); - } - } - } - $uri = implode('/', array_slice($parts, 0, 3)); - - $this->getResponse() - ->setRedirect(Wootook::getUrl($uri, $params), $code); - - Wootook_Core_ErrorProfiler::unregister(true); - - return $this; - } - - protected function _redirectUrl($url, $code = Wootook_Core_Mvc_Controller_Response_Http::REDIRECT_FOUND) - { - $this->getResponse()->setRedirect($url, $code); - - return $this; - } - - protected function _buildLayoutHandle() - { - $request = $this->getRequest(); - - $module = $request->getModuleName(); - $controller = $request->getControllerName(); - $action = $request->getActionName(); - - return "{$module}.{$controller}.{$action}"; - } - - public function loadLayout($handle = null) - { - if ($this->_layout === null) { - $this->_layout = $this->_initLayout(); - } - - if ($handle === null) { - $handle = $this->_buildLayoutHandle(); - } - $this->_layout->load($handle); - - return $this; - } - - protected function _initLayout() - { - return new Wootook_Core_Model_Layout(Wootook_Core_Model_Layout::DOMAIN_FRONTEND); - } - - /** - * - * @return Wootook_Core_Model_Layout - */ - public function getLayout() - { - return $this->_layout; - } - - public function renderLayout() - { - try { - $content = $this->getLayout()->render(); - } catch (Wootook_Core_Exception_LayoutException $e) { - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - return $this; - } - $this->getResponse()->setBody($content); - - return $this; - } - - protected function _prepareLayoutMessages($namespace) - { - $this->getLayout() - ->getMessagesBlock() - ->prepareMessages($namespace); - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php deleted file mode 100644 index 6c6b20f..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Front.php +++ /dev/null @@ -1,271 +0,0 @@ - array( - 'modules' => array( - 'core' => array( - 'class' => 'Wootook_Core_Controller_', - 'path' => 'Wootook/Core/Controller' - ) - ), - 'defaults' => array( - 'module' => 'core', - 'controller' => 'error', - 'action' => 'no-route' - ) - ), - self::ROUTE_DEFAULT => array( - 'modules' => array( - ), - 'defaults' => array( - 'module' => 'core', - 'controller' => 'index', - 'action' => 'index' - ) - ) - ); - - protected $_request = null; - protected $_response = null; - - public function __construct(Wootook_Core_Mvc_Controller_Request_Request $request, - Wootook_Core_Mvc_Controller_Response_Response $response) - { - $this->_request = $request; - $this->_response = $response; - } - - protected function _setNoRouteAction(&$route, &$moduleKey, &$controllerKey, &$actionKey) - { - $route = self::ROUTE_ERROR; - $moduleKey = $this->_routes[self::ROUTE_ERROR]['defaults']['module']; - $controllerKey = $this->_routes[self::ROUTE_ERROR]['defaults']['controller']; - $actionKey = $this->_routes[self::ROUTE_ERROR]['defaults']['action']; - - return $this; - } - - protected function _setDefaultRouteAction(&$route, &$moduleKey, &$controllerKey, &$actionKey) - { - $route = self::ROUTE_DEFAULT; - $moduleKey = $this->_routes[self::ROUTE_DEFAULT]['defaults']['module']; - $controllerKey = $this->_routes[self::ROUTE_DEFAULT]['defaults']['controller']; - $actionKey = $this->_routes[self::ROUTE_DEFAULT]['defaults']['action']; - - return $this; - } - - protected function _camelizeClass($string) - { - $string = strtolower($string); - $string = str_replace(' ', '_', ucwords(str_replace('.', ' ', $string))); - return str_replace(' ', '', ucwords(str_replace('-', ' ', $string))); - } - - protected function _camelizePath($string) - { - $string = strtolower($string); - $string = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('.', ' ', $string))); - return str_replace(' ', '', ucwords(str_replace('-', ' ', $string))); - } - - protected function _camelizeMethod($string) - { - return lcfirst(str_replace(' ', '', ucwords(str_replace('-', ' ', $string)))); - } - - protected function _getControllerClass($route, $module, $controllerKey) - { - if (!isset($this->_routes[$route])) { - return null; - } - if (!isset($this->_routes[$route]['modules'][$module])) { - return null; - } - $modulePrefix = $this->_routes[$route]['modules'][$module]['class']; - return $modulePrefix . $this->_camelizeClass($controllerKey) . 'Controller'; - } - - protected function _getControllerFilename($route, $module, $controllerKey) - { - if (!isset($this->_routes[$route])) { - return null; - } - if (!isset($this->_routes[$route]['modules'][$module])) { - return null; - } - $modulePath = $this->_routes[$route]['modules'][$module]['path']; - - return $modulePath . DIRECTORY_SEPARATOR . $this->_camelizePath($controllerKey) . 'Controller.php'; - } - - protected function _getActionMethod($actionKey) - { - return $this->_camelizeMethod($actionKey) . 'Action'; - } - - protected function _forward($action, $controller = null, $module = null) - { - $this->_request->setActionName($action); - if ($controller !== null) { - $this->_request->setControllerName($controller); - if ($module != null) { - $this->_request->setModuleName($module); - } - } - $this->_response->setIsDispatched(false); - } - - public function dispatch($route = null) - { - if ($route == null) { - $route = self::ROUTE_DEFAULT; - } - - if (!isset($this->_routes[$route])) { - $route = self::ROUTE_DEFAULT; - } - - $loop = 0; - while ($loop++ < 100) { - $moduleKey = $this->_request->getModuleName(); - if (empty($moduleKey)) { - $this->_forward( - $this->_routes[$route]['defaults']['action'], - $this->_routes[$route]['defaults']['controller'], - $this->_routes[$route]['defaults']['module'] - ); - continue; - } - - if (!isset($this->_routes[$route]['modules'][$moduleKey])) { - $this->_forward( - $this->_routes[self::ROUTE_ERROR]['defaults']['action'], - $this->_routes[self::ROUTE_ERROR]['defaults']['controller'], - $this->_routes[self::ROUTE_ERROR]['defaults']['module'] - ); - $route = self::ROUTE_ERROR; - continue; - } - - $controllerKey = $this->_request->getControllerName(); - if (empty($controllerKey)) { - $controllerKey = $this->_routes[$route]['defaults']['controller']; - } - - $controllerClass = $this->_getControllerClass($route, $moduleKey, $controllerKey); - $controllerPath = $this->_getControllerFilename($route, $moduleKey, $controllerKey); - - if (!class_exists($controllerClass, false) && Wootook::fileExists($controllerPath)) { - include_once $controllerPath; - } - - if (!class_exists($controllerClass, false)) { - $this->_forward( - $this->_routes[self::ROUTE_ERROR]['defaults']['action'], - $this->_routes[self::ROUTE_ERROR]['defaults']['controller'], - $this->_routes[self::ROUTE_ERROR]['defaults']['module'] - ); - $route = self::ROUTE_ERROR; - continue; - } - - $actionKey = $this->_request->getActionName(); - if (empty($actionKey)) { - $actionKey = $this->_routes[$route]['defaults']['action']; - } - - $actionMethod = $this->_getActionMethod($actionKey); - if (!method_exists($controllerClass, $actionMethod)) { - $this->_forward( - $this->_routes[self::ROUTE_ERROR]['defaults']['action'], - $this->_routes[self::ROUTE_ERROR]['defaults']['controller'], - $this->_routes[self::ROUTE_ERROR]['defaults']['module'] - ); - $route = self::ROUTE_ERROR; - continue; - } - - $controller = new $controllerClass($this->_request, $this->_response); - $controller->init(); - - $this->_response->setIsDispatched(); - - $this->preDispatch(); - $controller->preDispatch(); - if (!$this->_response->isDispatched()) { - continue; - } - if ($this->_response->isRedirect()) { - break; - } - - $controller->$actionMethod(); - - if (!$this->_response->isDispatched()) { - continue; - } - - $controller->postDispatch(); - $this->postDispatch(); - - if ($this->_response->isDispatched() || $this->_response->isRedirect()) { - break; - } - } - - return $this; - } - - public function send() - { - $this->_response->render(); - } - - public function addModule($frontName, $namespace, $path) - { - $this->_routes[self::ROUTE_DEFAULT]['modules'][$frontName] = array( - 'class' => $namespace, - 'path' => $path - ); - - return $this; - } - - public function setDefaults($module, $controller, $action) - { - $this->_routes[self::ROUTE_DEFAULT]['defaults'] = array( - 'module' => $module, - 'controller' => $controller, - 'action' => $action - ); - - return $this; - } - - public function preDispatch() - { - Wootook::dispatchEvent('core.mvc.controller.front.pre-dispatch', array( - 'request' => $this->_request, - 'response' => $this->_response - )); - - return $this; - } - - public function postDispatch() - { - Wootook::dispatchEvent('core.mvc.controller.front.post-dispatch', array( - 'request' => $this->_request, - 'response' => $this->_response - )); - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Http.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Http.php deleted file mode 100644 index 3780a37..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Http.php +++ /dev/null @@ -1,374 +0,0 @@ -_baseUrl = Wootook::getBaseUrl('link'); - if ($this->_baseUrl === null) { - $this->_baseUrl = 'http://' . $this->getServer('HTTP_HOST') . $this->getServer('REQUEST_URI'); - } - $offset = strpos($this->_baseUrl, '/', 8); - if ($offset !== false) { - $baseUri = substr($this->_baseUrl, $offset); // Get the path from the DocumentRoot - } else { - $baseUri = '/'; - } - - $params = ''; - if (($offset = strpos($this->getServer('REQUEST_URI'), $baseUri)) !== false) { - $queryParamsOffset = strpos($this->getServer('REQUEST_URI'), '?'); - if ($queryParamsOffset !== false) { - $path = substr($this->getServer('REQUEST_URI'), $offset + strlen($baseUri), $queryParamsOffset - $offset - 1); - } else { - $path = substr($this->getServer('REQUEST_URI'), $offset + strlen($baseUri)); - } - - $moduleOffset = strpos($path, '/'); - if ($moduleOffset !== false) { - $this->setModuleName(substr($path, 0, $moduleOffset)); - - $controllerOffset = strpos($path, '/', $moduleOffset + 1); - if ($controllerOffset !== false) { - $this->setControllerName(substr($path, $moduleOffset + 1, $controllerOffset - $moduleOffset - 1)); - - $actionOffset = strpos($path, '/', $controllerOffset + 1); - if ($actionOffset !== false) { - $this->setActionName(substr($path, $controllerOffset + 1, $actionOffset - $controllerOffset - 1)); - - $params = substr($path, $actionOffset); - } else if ($controllerOffset !== false) { - $this->setActionName(substr($path, $controllerOffset + 1)); - } - } else if ($moduleOffset !== false) { - $this->setControllerName(substr($path, $moduleOffset + 1)); - } - } else { - $this->setModuleName($path); - } - } - - if (!empty($params)) { - $paramOffset = 0; - $valueOffset = 0; - while (true) { - $paramOffset = strpos($params, '/', $valueOffset + 1); - if ($paramOffset === false) { - break; - } - $paramKey = substr($params, $valueOffset + 1, $paramOffset - $valueOffset - 1); - - $valueOffset = strpos($params, '/', $paramOffset + 1); - if ($valueOffset === false) { - $this->setParam($paramKey, substr($params, $paramOffset + 1)); - break; - } - $this->setParam($paramKey, substr($params, $paramOffset + 1, $valueOffset - $paramOffset - 1)); - } - } - } - - public function init() - { - $this->_queryVars = $_GET; - $this->_postVars = $_POST; - $this->_cookieVars = $_COOKIE; - $this->_serverVars = $_SERVER; - $this->_postFiles = $_FILES; - - $this->clearData(); - - $this->addData($this->_serverVars); - $this->addData($this->_cookieVars); - $this->addData($this->_queryVars); - $this->addData($this->_postVars); - } - - public function setParam($key, $value) - { - return $this->setData($key, $value); - } - - public function getParam($key, $default = null) - { - if ($this->hasData($key)) { - return $this->getData($key); - } - if ($this->hasPost($key)) { - return $this->getPost($key); - } - if ($this->hasQuery($key)) { - return $this->getQuery($key); - } - if ($this->hasCookie($key)) { - return $this->getCookie($key); - } - - return $this->getServer($key, $default); - } - - public function getQuery($key, $default = null) - { - if (!isset($this->_queryVars[$key])) { - return $default; - } - return $this->_queryVars[$key]; - } - - public function getAllQueryData() - { - return $this->_queryVars; - } - - public function hasQuery($key) - { - return isset($this->_queryVars[$key]); - } - - public function setQuery($key, $value) - { - $this->_queryVars[$key] = (string) $value; - - return $this; - } - - public function unsetQuery($key) - { - unset($this->_queryVars[$key]); - - return $this; - } - - public function getPost($key, $default = null) - { - if (!isset($this->_postVars[$key])) { - return $default; - } - return $this->_postVars[$key]; - } - - public function getAllPostData() - { - return $this->_postVars; - } - - public function hasPost($key) - { - return isset($this->_postVars[$key]); - } - - public function setPost($key, $value) - { - $this->_postVars[$key] = (string) $value; - - return $this; - } - - public function unsetPost($key) - { - unset($this->_postVars[$key]); - - return $this; - } - - public function getCookie($key, $default = null) - { - if (!isset($this->_cookieVars[$key])) { - return $default; - } - return unserialize(stripslashes($this->_cookieVars[$key])); - } - - public function getRawCookie($key, $default = null) - { - if (!isset($this->_cookieVars[$key])) { - return $default; - } - return $this->_cookieVars[$key]; - } - - public function getAllCookieData() - { - $data = array(); - foreach ($this->_cookieVars as $key => $value) { - $data[$key] = unserialize(stripslashes($value)); - } - return $data; - } - - public function getAllRawCookieData() - { - return $this->_cookieVars; - } - - public function hasCookie($key) - { - return isset($this->_cookieVars[$key]); - } - - public function setCookie($key, $value) - { - $this->_cookieVars[$key] = addslashes(serialize((string) $value)); - - return $this; - } - - public function setRawCookie($key, $value) - { - $this->_cookieVars[$key] = (string) $value; - - return $this; - } - - public function unsetCookie($key) - { - unset($this->_cookieVars[$key]); - - return $this; - } - - public function getServer($key, $default = null) - { - if (!isset($this->_serverVars[$key])) { - return $default; - } - return $this->_serverVars[$key]; - } - - public function getAllServerData() - { - return $this->_serverVars; - } - - public function getFile($key, $default = null) - { - if (!isset($this->_postFiles[$key])) { - return $default; - } - return $this->_postFiles[$key]; - } - - public function getAllFilesData() - { - return $this->_postFiles; - } - - public function isPost() - { - if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') { - return true; - } - return false; - } - - public function isPut() - { - if (strtoupper($this->getServer('REQUEST_METHOD')) == 'PUT') { - return true; - } - return false; - } - - public function isHead() - { - if (strtoupper($this->getServer('REQUEST_METHOD')) == 'HEAD') { - return true; - } - return false; - } - - public function isGet() - { - if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') { - return true; - } - return false; - } - - public function getModuleKey() - { - return $this->_moduleKey; - } - - public function setModuleKey($key) - { - $this->_moduleKey = $key; - - return $this; - } - - public function getModuleName() - { - return $this->getParam($this->getModuleKey()); - } - - public function setModuleName($name) - { - if ($name === null || is_string($name)) { - return $this->setParam($this->getModuleKey(), $name); - } - } - - public function getControllerKey() - { - return $this->_controllerKey; - } - - public function setControllerKey($key) - { - $this->_controllerKey = $key; - - return $this; - } - - public function getControllerName() - { - return $this->getParam($this->getControllerKey()); - } - - public function setControllerName($name) - { - if ($name === null || is_string($name)) { - return $this->setParam($this->getControllerKey(), $name); - } - } - - public function getActionKey() - { - return $this->_actionKey; - } - - public function setActionKey($key) - { - $this->_actionKey = $key; - - return $this; - } - - public function getActionName() - { - return $this->getParam($this->getActionKey()); - } - - public function setActionName($name) - { - if ($name === null || is_string($name)) { - return $this->setParam($this->getActionKey(), $name); - } - } -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Request.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Request.php deleted file mode 100644 index 3a77073..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Request/Request.php +++ /dev/null @@ -1,35 +0,0 @@ -init(); - - parent::__construct($data); - } - - public function setParam($key, $value) - { - return $this->setData($key, $value); - } - - public function getParam($key, $default = null) - { - if ($this->hasData($key)) { - return $this->getData($key); - } - return $default; - } - - abstract public function init(); - - abstract public function getModuleName(); - abstract public function getControllerName(); - abstract public function getActionName(); - - abstract public function setModuleName($name); - abstract public function setControllerName($name); - abstract public function setActionName($name); -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Response.php b/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Response.php deleted file mode 100644 index a36048a..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Controller/Response/Response.php +++ /dev/null @@ -1,21 +0,0 @@ -_isDispatched = $dispatched; - - return $this; - } - - public function isDispatched() - { - return $this->_isDispatched; - } - - abstract public function render($send = true); -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Model/Entity.php b/src/application/code/core/Wootook/Core/Mvc/Model/Entity.php deleted file mode 100644 index 2c19005..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Model/Entity.php +++ /dev/null @@ -1,142 +0,0 @@ -_idFieldName = $fieldName; - - return $this; - } - - public function getIdFieldName() - { - return $this->_idFieldName; - } - - public function setId($id) - { - $this->setData($this->getIdFieldName(), $id); - - return $this; - } - - public function getId() - { - return $this->getData($this->getIdFieldName()); - } - - protected function _load() - { - $id = func_get_arg(0); - - if (func_num_args() >= 2) { - $idFieldName = func_get_arg(1); - } else { - $idFieldName = $this->getIdFieldName(); - } - - $database = $this->getReadConnection(); - if ($database === null) { - throw new Wootook_Core_Exception_DataAccessException('Could not load data: no read connection configured.'); - } - - $select = $database->select() - ->from(array('main_table' => $database->getTable($this->getTableName()))) - ->where($idFieldName, new Wootook_Core_Database_Sql_Placeholder_Param('id', $id)) - ->limit(1); - - $statement = $select->prepare(); - $statement->execute(array( - 'id' => $id - )); - - $datas = $statement->fetch(PDO::FETCH_ASSOC); - if (!is_array($datas) || empty($datas)) { - throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id could not be found.'); - } - $realId = $datas[$this->getIdFieldName()]; - unset($datas[$this->getIdFieldName()]); - - $this->_data = array(); - $this->getDataMapper()->decode($this, $datas); - $this->setId($realId); - - return $this; - } - - protected function _save() - { - $adapter = $this->getWriteConnection(); - - if ($adapter === null) { - throw new Wootook_Core_Exception_DataAccessException('Could not save data: no write connection configured.'); - } - - if ($this->getId() !== null) { - $update = $adapter->update() - ->into($adapter->getTable($this->getTableName())) - ->where(new Wootook_Core_Database_Sql_Placeholder_Expression("{$adapter->quoteIdentifier($this->getIdFieldName())}=:id", array('id' => $this->getId()))); - - foreach ($this->getDataMapper()->encode($this, $this->getChangedDatas()) as $field => $value) { - $update->set($field, new Wootook_Core_Database_Sql_Placeholder_Param($field, $value)); - } - try { - $statement = $update->prepare(); - $statement->execute(); - } catch (Wootook_Core_Exception_Database_AdapterError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not save data: ' . $e->getMessage(), null, $e); - } catch (Wootook_Core_Exception_Database_StatementError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not save data: ' . $e->getMessage(), null, $e); - } - } else { - $insert = $adapter->insert() - ->into($adapter->getTable($this->getTableName())); - - foreach ($this->getDataMapper()->encode($this, $this->getAllDatas()) as $field => $value) { - $insert->set($field, new Wootook_Core_Database_Sql_Placeholder_Param($field, $value)); - } - try { - $statement = $insert->prepare(); - $statement->execute(); - - $id = $adapter->lastInsertId($adapter->getTable($this->getTableName())); - $this->setId($id); - } catch (Wootook_Core_Exception_Database_AdapterError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not save data: ' . $e->getMessage(), null, $e); - } catch (Wootook_Core_Exception_Database_StatementError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not save data: ' . $e->getMessage(), null, $e); - } - } - - return $this; - } - - protected function _delete() - { - $adapter = $this->getWriteConnection(); - if ($adapter === null) { - throw new Wootook_Core_Exception_DataAccessException('Could not delete data: no write connection configured.'); - } - $delete = $adapter - ->delete() - ->from($adapter->getTable($this->getTableName())) - ->where($this->getIdFieldName(), $this->getId()) - ->limit(1); - - try { - $statement = $adapter->prepare($delete); - $statement->execute(); - } catch (Wootook_Core_Exception_Database_AdapterError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not delete data: ' . $e->getMessage(), null, $e); - } catch (Wootook_Core_Exception_Database_StatementError $e) { - throw new Wootook_Core_Exception_DataAccessException('Could not delete data: ' . $e->getMessage(), null, $e); - } - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Core/Mvc/Model/EntityInterface.php b/src/application/code/core/Wootook/Core/Mvc/Model/EntityInterface.php deleted file mode 100644 index e512a5d..0000000 --- a/src/application/code/core/Wootook/Core/Mvc/Model/EntityInterface.php +++ /dev/null @@ -1,47 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * Enter description here ... - * @author Greg - * - */ -interface Wootook_Core_Mvc_Model_EntityInterface -{ - public function getId(); - public function setId($id); - - public function getIdFieldName(); - public function setIdFieldName($fieldName); - - public function getTableName(); - public function setTableName($tableName); -} diff --git a/src/application/code/core/Wootook/Core/Resource/EntityCollection.php b/src/application/code/core/Wootook/Core/Resource/EntityCollection.php deleted file mode 100644 index 0f0d29b..0000000 --- a/src/application/code/core/Wootook/Core/Resource/EntityCollection.php +++ /dev/null @@ -1,268 +0,0 @@ -setReadConnection($connection); - - $this->_construct(); - } - - abstract protected function _construct(); - - protected function _init($entityTable, $entityClass) - { - $this->_entityTable = $entityTable; - $this->_entityClass = $entityClass; - } - - public function getSelect() - { - if ($this->_select === null) { - $this->_select = $this->getReadConnection() - ->select() - ->from(array('main_table' => $this->getReadConnection()->getTable($this->_entityTable))); - - $this->_prepareSelect($this->_select); - } - - return $this->_select; - } - - public function _prepareSelect(Wootook_Core_Database_Sql_Select $select) - { - } - - /** - * - * @return Wootook_Core_Database_Orm_DataMapper - */ - public function getDataMapper() - { - if ($this->_dataMapper === null) { - $this->_dataMapper = new Wootook_Core_Database_Orm_DataMapper(); - } - return $this->_dataMapper; - } - - /** - * @return Wootook_Core_Database_Adapter_Adapter - */ - public function getReadConnection() - { - return $this->_connection; - } - - public function setReadConnection($connection) - { - if ($connection instanceof Wootook_Core_Database_Adapter_Pdo_Mysql) { - $this->_connection = $connection; - } else if (is_string($connection)) { - $this->_connection = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection($connection); - } else { - throw new Wootook_Core_Exception_RuntimeException( - 'First parameter should be either a database connection object or a string identifier.'); - } - - return $this; - } - - final public function load() - { - $this->_beforeLoad(); - $this->_load(); - $this->_afterLoad(); - - return $this; - } - - protected function _beforeLoad() - { - Wootook::dispatchEvent('resource.collection.before-load', array('model' => $this)); - - if ($this->_eventPrefix !== null && $this->_eventObject !== null) { - Wootook::dispatchEvent($this->_eventPrefix . '.before-load', array($this->_eventObject => $this)); - } - - return $this; - } - - protected function _afterLoad() - { - Wootook::dispatchEvent('resource.collection.after-load', array('model' => $this)); - - if ($this->_eventPrefix !== null && $this->_eventObject !== null) { - Wootook::dispatchEvent($this->_eventPrefix . '.after-load', array($this->_eventObject => $this)); - } - - return $this; - } - - protected function _load() - { - $select = clone $this->getSelect(); - - if ($this->_pageSize !== null) { - if ($this->_curPage !== null) { - $select->limit($this->_pageSize, ($this->_curPage - 1) * $this->_pageSize); - } else { - $select->limit($this->_pageSize); - } - } - - $statement = $select->prepare(); - - $args = func_get_args(); - $statement->execute(array_shift($args)); - - $this->_items = array(); - if (func_num_args() > 1) { - $reflection = new ReflectionClass(array_shift($args)); - } else { - $reflection = new ReflectionClass($this->_entityClass); - } - - while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { - $item = $reflection->newInstanceArgs(); - $item->getDataMapper()->decode($item, $row); - - $this->_items[] = $item; - } - - return $this; - } - - public function getSize($maintainGrouping = array()) - { - $clone = clone $this->_select; - $clone->reset(Wootook_Core_Database_Sql_Select::COLUMNS); - if (empty($maintainGrouping)) { - $clone->reset(Wootook_Core_Database_Sql_Select::GROUP); - } else { - $groupingFields = $clone->getPart(Wootook_Core_Database_Sql_Select::GROUP); - $clone->reset(Wootook_Core_Database_Sql_Select::GROUP); - foreach ($groupingFields as $field) { - if (in_array($field, $maintainGrouping)) { - $clone->group($field); - } - } - } - $clone->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')); - - $database = $this->getReadConnection(); - $statement = $database->prepare($clone); - - $statement->execute(); - $count = $statement->fetchColumn(); - $statement->closeCursor(); - - return $count; - } - - public function count() - { - return count($this->_items); - } - - public function current() - { - return current($this->_items); - } - - public function next() - { - next($this->_items); - - return $this; - } - - public function rewind() - { - reset($this->_items); - - return $this; - } - - public function key() - { - return key($this->_items); - } - - public function valid() - { - return current($this->_items) !== false; - } - - public function getFirstItem() - { - if (count($this->_items) > 0) { - return $this->_items[0]; - } - return null; - } - - public function getLastItem() - { - $size = count($this->_items); - if ($size > 0) { - return $this->_items[$size - 1]; - } - return null; - } - - public function addOrderBy($field, $type = 'ASC') - { - $this->getSelect()->order($field, $type); - - return $this; - } - - public function addFieldToFilter($field, $value = null) - { - $this->getSelect()->where($field, $value); - - return $this; - } - - public function setPage($curPage, $pageSize) - { - $this->setCurPage($curPage)->setPageSize($pageSize); - - return $this; - } - - public function setCurPage($curPage) - { - $this->_curPage = $curPage; - - return $this; - } - - public function setPageSize($pageSize) - { - $this->_pageSize = $pageSize; - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Core/Setup/Exception/RuntimeException.php b/src/application/code/core/Wootook/Core/Setup/Exception/RuntimeException.php deleted file mode 100644 index 29a8002..0000000 --- a/src/application/code/core/Wootook/Core/Setup/Exception/RuntimeException.php +++ /dev/null @@ -1,7 +0,0 @@ -_setupConnection = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection($connection); - } else { - $this->_setupConnection = $connection; - } - - return $this; - } - - /** - * - * Enter description here ... - * @return Wootook_Core_Database_Adapter_Pdo_Mysql - */ - public function getSetupConnection() - { - if ($this->_setupConnection === null) { - $this->setSetupConnection('default'); - } - return $this->_setupConnection; - } - - public function getTableName($tableName) - { - return $this->getSetupConnection()->getTable($tableName); - } - - public function query($statement) - { - try { - if (!$this->getSetupConnection()->query($statement)) { - $info = $this->getSetupConnection()->errorInfo(); - throw new Wootook_Core_Setup_Exception_RuntimeException( - Wootook::__('Query failed: SQLSTATE %s: %s.', $info[1], $info[2])); - } - } catch (PDOException $e) { - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - throw new Wootook_Core_Setup_Exception_RuntimeException($e->getMessage(), null, $e); - } - } - - public function grant($tableName, $connectionName, $perms = null) - { - $hostname = Wootook::getConfig("database/{$connectionName}/params/hostname"); - $username = Wootook::getConfig("database/{$connectionName}/params/username"); - $database = Wootook::getConfig("database/{$connectionName}/params/database"); - $password = Wootook::getConfig("database/{$connectionName}/params/password"); - - if ($perms === null) { - $perms = 'ALL PRIVILEGES'; - } else if (is_array($perms)) { - $perms = implode(' ', $perms); - } - - $sql =<<getTable($tableName)} -TO '{$username}@{$hostname}' IDENTIFIED BY '$password' -SQL_EOF; - - $this->getSetupConnection()->query($sql); - - return $this; - } - - public function revoke($tableName, $connectionName, $perms = null) - { - $hostname = Wootook::getConfig("database/{$connectionName}/params/hostname"); - $username = Wootook::getConfig("database/{$connectionName}/params/username"); - $database = Wootook::getConfig("database/{$connectionName}/params/database"); - $password = Wootook::getConfig("database/{$connectionName}/params/password"); - - if ($perms === null) { - $perms = 'ALL PRIVILEGES'; - } else if (is_array($perms)) { - $perms = implode(' ', $perms); - } - - $sql =<<getTable($tableName)} -FROM '{$username}@{$hostname}' -SQL_EOF; - - $this->getSetupConnection()->query($sql); - - return $this; - } - - public function run($script) - { - include $script; - } - - public function getConfig($path = null) - { - return Wootook::getConfig($path); - } - - public function getWebsiteConfig($path = null, $websiteId = null) - { - return Wootook::getWebsiteConfig($path, $websiteId); - } - - public function getGameConfig($path = null, $gameId = null) - { - return Wootook::getGameConfig($path, $gameId); - } -} diff --git a/src/application/code/core/Wootook/Core/Singleton.php b/src/application/code/core/Wootook/Core/Singleton.php deleted file mode 100644 index c136e82..0000000 --- a/src/application/code/core/Wootook/Core/Singleton.php +++ /dev/null @@ -1,40 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * Enter description here ... - * @author Greg - * - */ -interface Wootook_Core_Singleton -{ - public static function getSingleton(); -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/configs/module.php b/src/application/code/core/Wootook/Core/configs/module.php deleted file mode 100644 index 9b01f6a..0000000 --- a/src/application/code/core/Wootook/Core/configs/module.php +++ /dev/null @@ -1,33 +0,0 @@ - array( - 'Wootook_Core' => array( - 'version' => '1.5.0' - ) - ), - 'global' => array( - 'models' => array( - 'core' => array( - 'namespace' => 'Warner_Core_Model_', - 'connection' => array( - 'read' => 'core_read', - 'write' => 'core_write', - 'setup' => 'core_setup', - ) - ) - ), - 'blocks' => array( - 'core' => array( - 'namespace' => 'Warner_Core_Block_' - ) - ) - ), - 'frontend' => array( - 'routes' => array( - 'core' => array( - 'modules' => array( - 'core' => 'Wootook_Core' - ) - ) - ) - ) - ); \ No newline at end of file diff --git a/src/application/code/core/Wootook/Core/install/mysql5/install-1.5.0.php b/src/application/code/core/Wootook/Core/install/mysql5/install-1.5.0.php deleted file mode 100644 index 44fd985..0000000 --- a/src/application/code/core/Wootook/Core/install/mysql5/install-1.5.0.php +++ /dev/null @@ -1,208 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -$this->setSetupConnection('core_setup'); - -$sql = <<getTableName('core_website')} ( - `website_id` TINYINT UNSIGNED NOT NULL, - `code` VARCHAR(64) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `sort_order` TINYINT UNSIGNED NOT NULL, - `default_group_id` TINYINT UNSIGNED NOT NULL, - `is_default` BOOL NOT NULL, - `is_staging` BOOL NOT NULL, - `is_active` BOOL NOT NULL, - PRIMARY KEY (`website_id`), - UNIQUE (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game_group')} ( - `group_id` TINYINT UNSIGNED NOT NULL, - `website_id` TINYINT UNSIGNED NOT NULL, - `code` VARCHAR(64) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `sort_order` TINYINT UNSIGNED NOT NULL, - `is_default` BOOL NOT NULL, - PRIMARY KEY (`group_id`), - INDEX (`website_id`), - UNIQUE (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game')} ( - `game_id` SMALLINT UNSIGNED NOT NULL, - `group_id` TINYINT UNSIGNED NOT NULL, - `website_id` TINYINT UNSIGNED NOT NULL, - `code` VARCHAR(64) NOT NULL, - `name` VARCHAR(255) NOT NULL, - `sort_order` TINYINT UNSIGNED NOT NULL, - `is_default` BOOL NOT NULL, - `is_staging` BOOL NOT NULL, - `is_active` BOOL NOT NULL, - PRIMARY KEY (`group_id`), - INDEX (`website_id`), - UNIQUE (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_website')} (`website_id`, `code`, `name`, `sort_order`, `default_group_id`, `is_default`, `is_staging`, `is_active`) -VALUES -(0, "admin", "Administration", 0, 0, 0, 0, 1), -(1, "default", "Default Website", 1, 1, 1, 0, 1); -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game_group')} (`group_id`, `website_id`, `code`, `name`, `sort_order`, `is_default`) -VALUES -(0, 0, "admin", "Administration", 0, 0), -(1, 1, "default", "Default Group", 1, 1); -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game')} (`game_id`, `group_id`, `website_id`, `code`, `name`, `sort_order`, `is_default`, `is_staging`, `is_active`) -VALUES -(0, 0, 0, "admin", "Administration", 0, 0, 0, 1), -(1, 1, 1, "default", "Default Game", 1, 1, 0, 1); -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_config')} ( - `website_id` TINYINT UNSIGNED NOT NULL, - `game_id` TINYINT UNSIGNED NOT NULL, - `config_path` VARCHAR(64) NOT NULL, - `config_value` VARCHAR(255) NOT NULL, - PRIMARY KEY (`website_id`, `game_id`, `config_path`), - INDEX (`website_id`), - INDEX (`game_id`), - INDEX (`config_path`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_config')} (`website_id`, `game_id`, `config_path`, `config_value`) VALUES - (1, 1, 'resources/base-income/metal', '20'), - (1, 1, 'resources/base-income/cristal', '10'), - (1, 1, 'resources/base-income/deuterium', '0'), - (1, 1, 'resources/base-income/energy', '0'), - - (1, 1, 'planet/initial/fields', '163'), - - (1, 1, 'resources/initial/metal', '500'), - (1, 1, 'resources/initial/cristal', '500'), - (1, 1, 'resources/initial/deuterium', '0'), - (1, 1, 'resources/initial/energy', '0'), - - (1, 1, 'game/general/name', 'Wootook'), - (1, 1, 'game/general/boards-url', 'http://wootook.org/board/'), - (1, 1, 'game/general/extra-url-title', 'Wootook!'), - (1, 1, 'game/general/extra-url', 'http://wootook.org/'), - (1, 1, 'game/general/active', '1'), - (1, 1, 'game/general/closing-message', 'Le jeu est clos pour le moment.'), - (1, 1, 'game/general/locale', 'fr_FR'), - - (1, 1, 'game/resource/multiplier', '1000'), - (1, 1, 'game/speed/general', '2500'), - (1, 1, 'game/speed/fleet', '2500'), - - (1, 1, 'game/debris/metal-percent', '30'), - (1, 1, 'game/debris/cristal-percent', '30'), - (1, 1, 'game/debris/deuterium-percent', '0'), - (1, 1, 'game/debris/energy-percent', '0'), - - (1, 1, 'game/debris/fleet', '1'), - (1, 1, 'game/debris/defense', '0'), - - (1, 1, 'game/noob-protection/active', '0'), - (1, 1, 'game/noob-protection/points-cap', '5000'), - (1, 1, 'game/noob-protection/multiplier', '5'), - --- (0, 0, 'web/cookie/name', '__wtk'), --- (0, 0, 'web/cookie/time', '2592000'), --- (0, 0, 'web/cookie/domain', ''), --- (0, 0, 'web/cookie/path', ''), - - (1, 1, 'web/cookie/name', '__wtk_1_1'), - --- (0, 0, 'web/session/time', '900'), --- (0, 0, 'web/session/domain', '.wootook.org'), --- (0, 0, 'web/session/path', '/'), - - (0, 0, 'engine/options/bbcode', '1'), - (0, 0, 'engine/options/ga', '1'), - (0, 0, 'engine/options/announces', '0'), - (0, 0, 'engine/options/retailer', '0'), - (0, 0, 'engine/options/notes', '0'), - (0, 0, 'engine/options/chat', '0'), - (0, 0, 'engine/options/banner', '0'), - (0, 0, 'engine/options/vacation-min-time', '172800'), - - (0, 0, 'game/news/active', '0'), - (0, 0, 'game/news/content', 'Bienvenue sur le nouveau serveur de jeu Wootook!'), - - (0, 0, 'engine/ban/duration', '86400'), - - (0, 0, 'engine/bot/active', '0'), - (0, 0, 'engine/bot/name', 'Woot'), - (0, 0, 'engine/bot/email', 'contact@wootook.org'); -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('errors')} ( - `error_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, - `error_sender` VARCHAR(32) NOT NULL, - `error_time` TIMESTAMP NOT NULL, - `error_type` VARCHAR(32) NOT NULL DEFAULT 'unknown', - `error_text` TEXT, - PRIMARY KEY (`error_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -SQL_EOF; - -$this->query($sql); diff --git a/src/application/code/core/Wootook/Core/install/mysql5/uninstall-1.5.0.php b/src/application/code/core/Wootook/Core/install/mysql5/uninstall-1.5.0.php deleted file mode 100644 index 2b0aad2..0000000 --- a/src/application/code/core/Wootook/Core/install/mysql5/uninstall-1.5.0.php +++ /dev/null @@ -1,73 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * - Neither the name of Grégory PLANCHAT nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing One.Platform. - * - */ - -$this->setSetupConnection('core_setup'); - -$sql = <<getTableName('core_website')}; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game_group')}; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_game')}; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('core_config')}; -SQL_EOF; - -$this->query($sql); - -$sql = <<getTableName('errors')}; -SQL_EOF; - -$this->query($sql); diff --git a/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List.php b/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List.php deleted file mode 100644 index 770fcbb..0000000 --- a/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List.php +++ /dev/null @@ -1,77 +0,0 @@ -_fleetCollection === null) { - $player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - $this->_fleetCollection = $player->getVisibleFleets(); - } - return $this->_fleetCollection; - } - - public function setItemTemplate($template) - { - $this->_itemTemplate = $template; - - return $this; - } - - public function getItemTemplate() - { - return $this->_itemTemplate; - } - - public function setItemBlockType($blockType) - { - $this->_itemBlockType = $blockType; - - return $this; - } - - public function getItemBlockType() - { - return $this->_itemBlockType; - } - - public function getItemBlock($fleet) - { - $blockName = $this->getNameInLayout() . ".item({$fleet->getId()})"; - - return $this->getLayout() - ->createBlock($this->getItemBlockType(), $blockName) - ->setTemplate($this->getItemTemplate()) - ->setFleetItem($fleet); - } - - public function prepareLayout() - { - parent::prepareLayout(); - - $this->_initChildBlocks(); - - return $this; - } - - public function _initChildBlocks() - { - $parentBlock = $this->getLayout() - ->createBlock('core/concat', $this->getNameInLayout() . '.item-list') - ; - $this->setPartial('item-list', $parentBlock); - - foreach ($this->getFleetCollection()->load() as $fleet) { - $block = $this->getItemBlock($fleet); - $parentBlock->setPartial($block->getNameInLayout(), $block); - } - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List/Item.php b/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List/Item.php deleted file mode 100644 index cd1cffc..0000000 --- a/src/application/code/core/Wootook/Empire/Block/Overview/Fleet/List/Item.php +++ /dev/null @@ -1,153 +0,0 @@ -_currentPlayer == null) { - $this->_currentPlayer = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - } - return $this->_currentPlayer; - } - - /** - * @return Wootook_Player_Resource_Entity_Collection - */ - public function getFleetOwnerCollection() - { - if ($this->_ownerCollection == null) { - $this->_ownerCollection = $this->getFleetItem()->getOwnerCollection(); - } - return $this->_ownerCollection; - } - - /** - * @return Wootook_Player_Resource_Entity_Collection - */ - public function getFleetOwnerUsernames() - { - $usernameList = array(); - foreach ($this->getFleetOwnerCollection()->load() as $owner) { - $usernameList[] = $owner->getUsername(); - } - return $usernameList; - } - - public function setFleetItem(Wootook_Empire_Model_Fleet $fleetItem) - { - $this->_fleet = $fleetItem; - - return $this; - } - - /** - * @return Wootook_Empire_Model_Fleet - */ - public function getFleetItem() - { - return $this->_fleet; - } - - public function getStartTime() - { - return $this->getFleetItem()->getStartTime(); - } - - public function getActionTime() - { - return $this->getFleetItem()->getActionTime(); - } - - public function getArrivalTime() - { - return $this->getFleetItem()->getArrivalTime(); - } - - public function isOwner() - { - return $this->getFleetItem()->isOwnedBy($this->getPlayer()); - } - - public function getRowClass() - { - return $this->getFleetItem()->getRowClass($this->getPlayer()); - } - - public function getOriginPlanet() - { - return $this->getFleetItem()->getOriginPlanet(); - } - - public function getOriginPlayer() - { - return $this->getOriginPlanet()->getPlayer(); - } - - public function getOriginPlayerName() - { - $player = $this->getOriginPlanet()->getPlayer(); - - if ($player !== null) { - return $player->getUsername(); - } - return null; - } - - public function getOriginPlanetName() - { - return $this->getOriginPlanetName(); - } - - public function getOriginPlanetCoords() - { - return $this->getOriginPlanetCoords(); - } - - public function getDestinationPlanet() - { - return $this->getFleetItem()->getDestinationPlanet(); - } - - public function getDestinationPlayer() - { - return $this->getDestinationPlanet()->getPlayer(); - } - - public function getDestinationPlayerName() - { - $player = $this->getDestinationPlanet()->getPlayer(); - - if ($player !== null) { - return $player->getUsername(); - } - return null; - } - - public function getDestinationPlanetName() - { - return $this->getDestinationPlanetName(); - } - - public function getDestinationPlanetCoords() - { - return $this->getDestinationPlanetCoords(); - } - - public function getMissionLabel() - { - return $this->getFleetItem()->getMissionLabel(); - } - - public function isMission($type) - { - return $this->getFleetItem()->isMission($type); - } -} diff --git a/src/application/code/core/Wootook/Empire/Block/Planet/Overview.php b/src/application/code/core/Wootook/Empire/Block/Planet/Overview.php deleted file mode 100644 index f24f5dc..0000000 --- a/src/application/code/core/Wootook/Empire/Block/Planet/Overview.php +++ /dev/null @@ -1,40 +0,0 @@ -getPlayer(); - } - - /** - * - * @return Wootook_Empire_Model_Planet - */ - public function getPlanet() - { - if ($this->_planet === null) { - $this->_planet = $this->getPlayer()->getCurrentPlanet(); - } - return $this->_planet; - } - - public function getPlanetName() - { - return $this->getPlanet()->getName(); - } - - public function getPlanetCoords() - { - return $this->getPlanet()->getCoords(); - } - - public function getPlanetImage() - { - return $this->getPlanet()->getImage(); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Controller/BuildingsController.php b/src/application/code/core/Wootook/Empire/Controller/BuildingsController.php deleted file mode 100644 index 6a5234b..0000000 --- a/src/application/code/core/Wootook/Empire/Controller/BuildingsController.php +++ /dev/null @@ -1,43 +0,0 @@ -loadLayout('planet.buildings'); - $this->renderLayout(); - } - - public function buildAction() - { - if (!is_numeric($buildingId = $this->getRequest()->getParam('id'))) { - $this->_redirect('*/*/view'); - return; - } - - $this->getCurrentPlanet()->appendBuildingQueue($buildingId); - $this->getCurrentPlanet()->save(); - - $this->_redirect('*/*/'); - } - - public function cancelAction() - { - if (!is_numeric($buildingId = $this->getRequest()->getParam('id'))) { - $this->_redirect('*/*/view'); - return; - } - - $this->getCurrentPlanet()->dequeueBuilding($buildingId); - $this->getCurrentPlanet()->save(); - - $this->_redirect('*/*/'); - } -} diff --git a/src/application/code/core/Wootook/Empire/Exception.php b/src/application/code/core/Wootook/Empire/Exception.php deleted file mode 100644 index e2bd909..0000000 --- a/src/application/code/core/Wootook/Empire/Exception.php +++ /dev/null @@ -1,3 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Exception/Planet.php b/src/application/code/core/Wootook/Empire/Exception/Planet.php deleted file mode 100644 index 36c2cf2..0000000 --- a/src/application/code/core/Wootook/Empire/Exception/Planet.php +++ /dev/null @@ -1,7 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Helper/Config/Labels.php b/src/application/code/core/Wootook/Empire/Helper/Config/Labels.php deleted file mode 100644 index 94297a2..0000000 --- a/src/application/code/core/Wootook/Empire/Helper/Config/Labels.php +++ /dev/null @@ -1,51 +0,0 @@ -_initData("locale/{$locale}/labels"); - return $this; - } - - protected function _load() - { - // NOP - return $this; - } - - protected function _save() - { - // NOP - return $this; - } - - protected function _delete() - { - // NOP - return $this; - } -} diff --git a/src/application/code/core/Wootook/Empire/Model/Galaxy/Position.php b/src/application/code/core/Wootook/Empire/Model/Galaxy/Position.php deleted file mode 100644 index 2ce4b24..0000000 --- a/src/application/code/core/Wootook/Empire/Model/Galaxy/Position.php +++ /dev/null @@ -1,11 +0,0 @@ -_tableName = 'galaxy'; - $this->_idFieldNames = array('id_planet'); - } -} diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/PluginLoader.php b/src/application/code/core/Wootook/Empire/Model/Planet/PluginLoader.php deleted file mode 100644 index d3cc37b..0000000 --- a/src/application/code/core/Wootook/Empire/Model/Planet/PluginLoader.php +++ /dev/null @@ -1,31 +0,0 @@ -_currentPlayer = $currentPlayer; - $this->_currentPlanet = $currentPlanet; - - $this->registerNamespace('Legacies_Empire_Model_Planet_Building_'); - } - - protected function _load($className, $useSingleton, Array $constructorParams = array()) - { - $reflection = new ReflectionClass($className); - if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) { - $method = $reflection->getMethod('getSingleton'); - $method->invoke(); - } - - try { - return $reflection->newInstance($this->_currentPlanet, $this->_currentPlayer); - } catch (ReflectionException $e) { - return null; - } - } -} diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/QueueInterface.php b/src/application/code/core/Wootook/Empire/Model/Planet/QueueInterface.php deleted file mode 100644 index 7bd2c42..0000000 --- a/src/application/code/core/Wootook/Empire/Model/Planet/QueueInterface.php +++ /dev/null @@ -1,9 +0,0 @@ -getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE)); - } - - public function getActualSpeed(Wootook_Player_Model_Entity $player) - { - return $this->getBaseSpeed($player) * $this->getSpeedMultiplier($player); - } - - public function getActualConsumption(Wootook_Player_Model_Entity $player, $speed) - { - return $this->getBaseConsumption($player) * ($speed / 100) * $this->getSpeedMultiplier($player); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php b/src/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php deleted file mode 100644 index dc9863a..0000000 --- a/src/application/code/core/Wootook/Empire/Model/Planet/ShipInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -_init('fleets', 'Wootook_Empire_Model_Fleet'); - } - - public function addPlanetToFilter(Wootook_Empire_Model_Planet $planet, $time = null) - { - if ($time === null) { - $time = new Wootook_Core_DateTime(); - } - $this->addFieldToFilter(null, array( - array('and' => array( - array('eq' => array('field' => 'fleet_start_galaxy', 'value' => $planet->getGalaxy())), - array('eq' => array('field' => 'fleet_start_system', 'value' => $planet->getSystem())), - array('eq' => array('field' => 'fleet_start_planet', 'value' => $planet->getPosition())), - array('eq' => array('field' => 'fleet_start_type', 'value' => $planet->getType())), - //array('date' => array('field' => 'fleet_start_time', 'value' => array('to' => $time))), - )), - array('and' => array( - array('eq' => array('field' => 'fleet_end_galaxy', 'value' => $planet->getGalaxy())), - array('eq' => array('field' => 'fleet_end_system', 'value' => $planet->getSystem())), - array('eq' => array('field' => 'fleet_end_planet', 'value' => $planet->getPosition())), - array('eq' => array('field' => 'fleet_end_type', 'value' => $planet->getType())), - //array('date' => array('field' => 'fleet_end_time', 'value' => array('to' => $time))), - )) - )); - - return $this; - } - - public function addIsVisibleToFilter(Wootook_Player_Model_Entity $player, $time = null) - { - if ($time === null) { - $time = new Wootook_Core_DateTime(); - } - $this->addFieldToFilter(null, array( - array('and' => array( - array('eq' => array('field' => 'fleet_owner', 'value' => $player->getId())), - array('date' => array('field' => 'fleet_start_time', 'value' => array('to' => $time))), - )), - array('and' => array( - array('eq' => array('field' => 'fleet_owner', 'value' => $player->getId())), - array('date' => array('field' => 'fleet_end_time', 'value' => array('to' => $time))), - )) - )); - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Empire/Resource/Planet/Collection.php b/src/application/code/core/Wootook/Empire/Resource/Planet/Collection.php deleted file mode 100644 index fc3e8ee..0000000 --- a/src/application/code/core/Wootook/Empire/Resource/Planet/Collection.php +++ /dev/null @@ -1,64 +0,0 @@ -_init('planets', 'Wootook_Empire_Model_Planet'); - } - - public function addPlayerToFilter(Wootook_Player_Model_Entity $player) - { - $this->addFieldToFilter('id_owner', $player->getId()); - - return $this; - } - - public function addGalaxyToFilter($galaxy) - { - $this->addFieldToFilter('galaxy', $galaxy); - - return $this; - } - - public function addSystemToFilter($system) - { - $this->addFieldToFilter('system', $system); - - return $this; - } - - public function addPositionToFilter($position) - { - $this->addFieldToFilter('planet', $position); - - return $this; - } - - public function addTypeToFilter($type) - { - $this->addFieldToFilter('planet_type', $type); - - return $this; - } - - public function addCoordsToFilter($galaxy, $system = null, $position = null, $type = null) - { - $this->addGalaxyToFilter($galaxy); - - if ($system !== null) { - $this->addSystemToFilter($system); - - if ($position !== null) { - $this->addPositionToFilter($position); - - if ($type !== null) { - $this->addTypeToFilter($type); - } - } - } - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Player/Block/TopBar.php b/src/application/code/core/Wootook/Player/Block/TopBar.php deleted file mode 100644 index 9b7adaf..0000000 --- a/src/application/code/core/Wootook/Player/Block/TopBar.php +++ /dev/null @@ -1,37 +0,0 @@ -getSession()->isLoggedIn(); - } - - public function getPlayer() - { - return $this->getSession()->getPlayer(); - } - - public function getPlayerCount() - { - $collection = new Wootook_Player_Resource_Entity_Collection($this->getPlayer()->getReadConnection()); - $collection->addAuthlevelToFilter(array(LEVEL_ADMIN), true); - - return $collection->getSize(); - } - - public function getOnlinePlayerCount() - { - $collection = new Wootook_Player_Resource_Entity_Collection($this->getPlayer()->getReadConnection()); - $collection->addAuthlevelToFilter(array(LEVEL_ADMIN), true); - $collection->addIsOnlineToFilter(); - - return $collection->getSize(); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Controller/AccountController.php b/src/application/code/core/Wootook/Player/Controller/AccountController.php deleted file mode 100644 index 824a20d..0000000 --- a/src/application/code/core/Wootook/Player/Controller/AccountController.php +++ /dev/null @@ -1,235 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * Enter description here ... - * @author Greg - * - */ -class Wootook_Player_Controller_AccountController - extends Wootook_Core_Mvc_Controller_Action -{ - public function loginAction() - { - $session = new Wootook_Player_Model_Session(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - $this->loadLayout('player.login'); - $this->_prepareLayoutMessages(Wootook_Player_Model_Entity::SESSION_KEY); - $this->renderLayout(); - } - - public function loginPostAction() - { - $request = $this->getRequest(); - - if (!$request->isPost()) { - $this->_redirect('*/*/login'); - return; - } - - if ($request->getPost('username') === null || $request->getPost('password') === null) { - $this->_redirect('*/*/login'); - return; - } - - $session = new Wootook_Player_Model_Session(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - $session->login($request->getPost('username'), $request->getPost('password'), (bool) $request->getPost('rememberme')); - - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } else { - $this->_redirect('*/*/login'); - return; - } - } - - public function logoutAction() - { - $session = Wootook_Player_Model_Session::getSingleton(); - if ($session->isLoggedIn()) { - $session->logout(); - } else { - $this->_redirect('*/*/login'); - return; - } - - $this->_redirect(''); - } - - public function newAction() - { - $session = new Wootook_Player_Model_Session(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - $this->loadLayout('player.registration'); - $this->_prepareLayoutMessages(Wootook_Player_Model_Entity::SESSION_KEY); - $this->renderLayout(); - } - - public function newPostAction() - { - $session = Wootook_Player_Model_Session::getSingleton(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - $request = $this->getRequest(); - - if ($request->getPost('password') != $request->getPost('password_confirm')) { - $session->addError(Wootook::__('Passwords does not match. Please check your input.')); - $this->_redirect('*/*/new'); - return; - } - - if ($request->getPost('email') != $request->getPost('email_confirm')) { - $session->addError(Wootook::__('Both emails does not match. Please check your input.')); - $this->_redirect('*/*/new'); - return; - } - - try { - $user = Wootook_Player_Model_Entity::register($request->getPost('username'), $request->getPost('email'), $request->getPost('password')); - } catch (Wootook_Empire_Exception_RuntimeException $e) { - $session->addError(Wootook::__('Could not create user: %s', $e->getMessage())); - $this->_redirect('*/*/new'); - return; - } - - if (!$user || !$user->getId()) { - $session->addError(Wootook::__('Could not create user. Please contact the game administrator for more information.')); - $this->_redirect('*/*/new'); - return; - } - - $session->setLoggedIn($user); - if ($request->getPost('planet_name') != '') { - $user->getHomePlanet()->setName($request->getPost('planet_name'))->save(); - } else { - $user->getHomePlanet()->setName(Wootook::__('Planet'))->save(); - } - - $this->_redirect('*/overview'); - } - - public function lostPasswordAction() - { - $session = new Wootook_Player_Model_Session(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - $this->loadLayout('player.lost-password'); - $this->_prepareLayoutMessages(Wootook_Player_Model_Entity::SESSION_KEY); - $this->renderLayout(); - } - - /** - * Send new password by mail - */ - public function lostPasswordPostAction() - { - $session = new Wootook_Player_Model_Session(); - if ($session->isLoggedIn()) { - $this->_redirect('*/overview'); - return; - } - - if (!$this->getRequest()->isPost()) { - $this->_redirect('*/*/lost-password'); - return; - } - - $email = $this->getRequest()->getPost('email'); - $username = $this->getRequest()->getPost('username'); - - $player = new Wootook_Player_Model_Entity(); - $player->loadByEmail($email); - - if (!$player->getId() || strtolower($player->getUsername()) != strtolower(trim($username))) { - $session->addError(Wootook::__('The information you entered could not be found.')); - $this->_redirect('*/*/lost-password'); - return; - } - - $chars = array( - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', - 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', - 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', '2', '3', '4', '5', '6', '7', '8', '9' - ); - - shuffle($chars); - $passwordChars = array_slice($chars, 0, 10); - $newPassword = implode($passwordChars); - - $player->setPassword($newPassword)->save(); - - try { - $mailer = new Wootook_Core_Email(); - $mailer->send( - array($player->getEmail() => $player->getUsername()), - array('contact@wootook.org' => 'Wootook'), - Wootook::__('Your new password'), - Wootook::__('Your new password is %s', $newPassword)); - } catch (Wootook_Core_Exception_RuntimeException $e) { - Wootook_Player_Model_Session::getSingleton() - ->addError($e->getMessage()); - - $this->_redirect('*/*/lost-password'); - return; - } - - $this->_redirect('*/*/login'); - } - - public function editAction() - { - } - - public function optionsAction() - { - } -} diff --git a/src/application/code/core/Wootook/Player/Controller/OverviewController.php b/src/application/code/core/Wootook/Player/Controller/OverviewController.php deleted file mode 100644 index 97db0cf..0000000 --- a/src/application/code/core/Wootook/Player/Controller/OverviewController.php +++ /dev/null @@ -1,12 +0,0 @@ -loadLayout('player.overview'); - $this->_prepareLayoutMessages(Wootook_Player_Model_Entity::SESSION_KEY); - $this->renderLayout(); - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Exception.php b/src/application/code/core/Wootook/Player/Exception.php deleted file mode 100644 index 6a51351..0000000 --- a/src/application/code/core/Wootook/Player/Exception.php +++ /dev/null @@ -1,3 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Exception/RuntimeException.php b/src/application/code/core/Wootook/Player/Exception/RuntimeException.php deleted file mode 100644 index e270f3f..0000000 --- a/src/application/code/core/Wootook/Player/Exception/RuntimeException.php +++ /dev/null @@ -1,25 +0,0 @@ -= 50300) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - $this->_previous = $previous; - } - } - - public function __call($method, $params) - { - if (strtolower($method) == 'getprevious') { - return $this->_previous; - } - } -} \ No newline at end of file diff --git a/src/application/code/core/Wootook/Player/Exception/Session.php b/src/application/code/core/Wootook/Player/Exception/Session.php deleted file mode 100644 index b546e5d..0000000 --- a/src/application/code/core/Wootook/Player/Exception/Session.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('username'); - } - - public function getEmail() - { - return $this->getData('email'); - } - - public function loadByEmail($email) - { - return $this->load($email, 'email'); - } - - public function setPassword($newPassword) - { - return $this->setData('password', $this->hash($newPassword)); - } - - public static function hash($password, $salt = null) - { - if ($salt === null) { - return call_user_func(self::$hashCallback, ($password)); - } - - return call_user_func(self::$hashCallback, ($password . $salt)); - } - - protected function _init() - { - $this->setIdFieldName('id'); - $this->setTableName('users'); - - $this->getDataMapper() - ->addRule('onlinetime', 'date-time') - ->addRule('urlaubs_until', 'date-time') - ->addRule('register_time', 'date-time') - ; - } - - public function updateActivity() - { - $this - ->setData('current_page', $_SERVER['REQUEST_URI']) - ->setData('user_lastip', $_SERVER['REMOTE_ADDR']) - ->setData('user_agent', $_SERVER['HTTP_USER_AGENT']) - ->setData('onlinetime', new Wootook_Core_DateTime()) - ->save() - ; - return $this; - } - - public static function register($username, $email, $password) - { - try { - $request = Wootook::getRequest(); - $player = new self(array( - 'username' => $username, - 'password' => md5($password), - 'email' => $email, - 'email_2' => $email, - - 'register_time' => new Wootook_Core_DateTime(), - 'onlinetime' => new Wootook_Core_DateTime(), - 'ip_at_reg' => $request->getServer('REMOTE_ADDR'), - 'user_lastip' => $request->getServer('REMOTE_ADDR'), - 'user_agent' => $request->getServer('HTTP_USER_AGENT') - )); - - //$player->getWriteConnection()->beginTransaction(); - - $player->save(); - - $select = Wootook_Empire_Model_Planet::searchMostFreeSystems(); - $select->limit(1); - - try { - $statement = $select->prepare(); - if (!$statement->execute()) { - throw new Wootook_Empire_Exception_RuntimeException('No more planet to colonize!'); // Oops, no more free place - } - } catch (Wootook_Core_Exception_Database_Error $e) { - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - //$this->getWriteConnection()->rollback(); - return null; - } - - $systemInfo = $statement->fetch(); - if ($systemInfo['count'] >= Wootook::getGameConfig('engine/universe/positions')) { - throw new Wootook_Empire_Exception_RuntimeException('No more planet to colonize!'); // Oops, no more free place - } - - $collection = new Wootook_Empire_Resource_Planet_Collection($player->getReadConnection()); - $collection->addTypeToFilter(Wootook_Empire_Model_Planet::TYPE_PLANET) - ->addFieldToFilter('galaxy', $systemInfo['galaxy']) - ->addFieldToFilter('system', $systemInfo['system']) - ; - - $positions = range(1, Wootook::getGameConfig('engine/universe/positions')); - foreach ($collection as $planet) { - $key = array_search($planet->getData('position'), $positions); - if ($key !== false) { - unset($positions[$key]); - } - } - $key = array_rand($positions, 1); - $finalPosition = $positions[$key]; - - $planet = $player->createNewPlanet( - $systemInfo['galaxy'], - $systemInfo['system'], - $finalPosition, - Wootook_Empire_Model_Planet::TYPE_PLANET, - Wootook::__('Planet'), - Wootook::getGameConfig('resource/initial/fields') - ); - - $player - ->setData('id_planet', $planet->getId()) - ->setData('current_planet', $planet->getId()) - ->setData('galaxy', $planet->getGalaxy()) - ->setData('system', $planet->getSystem()) - ->setData('planet', $planet->getPosition()) - ; - - Wootook::dispatchEvent('player.init', array( - 'player' => $player - )); - - $player->save(); - } catch (Wootook_Core_Exception_DataAccessException $e) { - //$player->getWriteConnection()->rollback(); - $session = Wootook_Core_Model_Session::factory(Wootook_Player_Model_Entity::SESSION_KEY); - - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - $session->addError($e->getMessage()); - return null; - } catch (Wootook_Empire_Exception_RuntimeException $e) { - //$player->getWriteConnection()->rollback(); - $session = Wootook_Core_Model_Session::factory(Wootook_Player_Model_Entity::SESSION_KEY); - - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - $session->addError($e->getMessage()); - return null; - } - //$player->getWriteConnection()->commit(); - - return $player; - } - - public function createNewPlanet($galaxy, $system, $position, $type, $name, $size = null) - { - if ($size === null) { - $size = Wootook::getGameConfig('planet/initial/fields'); - } - if ($size === null) { - $size = 200; - } - - $now = new Wootook_Core_DateTime(); - $planet = new Wootook_Empire_Model_Planet(array(), $this); - $planet - ->setData('name', $name) - ->setData('galaxy', $galaxy) - ->setData('system', $system) - ->setData('planet', $position) - ->setData('planet_type', $type) - ->setData('field_max', $size) - ->setData('diameter', pow($size, 2) + mt_rand(0, $size * $position)) - ->setData('field_current', 0) - ->setData('last_update', $now) - ->setData('b_tech', $now) - ->setData('b_hangar', $now) - ->setData('b_building', $now) - ; - - $resourceList = Wootook_Empire_Helper_Config_Resources::getSingleton(); - $resourceConfig = Wootook::getGameConfig('resources/initial'); - foreach ($resourceList as $resource => $resourceData) { - if ($resourceData['field'] === null || !isset($resourceConfig[$resource])) { - continue; - } - $planet->setData($resourceData['field'], $resourceConfig[$resource]); - } - - $resourceConfig = Wootook::getGameConfig('resources/base-income'); - foreach ($resourceList as $resource => $resourceData) { - if ($resourceData['production_field'] === null || !isset($resourceConfig[$resource])) { - continue; - } - $planet->setData($resourceData['production_field'], $resourceConfig[$resource]); - } - - $planet->updateStorages($now); - $planet->updateBuildingQueue($now); - $planet->updateResourceProduction($now); - $planet->updateResources($now); - - $planet->save(); - - if ($planet->isPlanet()) { - $galaxy = new Wootook_Empire_Model_Galaxy_Position(); - $galaxy - ->setData('galaxy', $planet->getGalaxy()) - ->setData('system', $planet->getSystem()) - ->setData('planet', $planet->getPosition()) - ->setData('id_planet', $planet->getId()) - ->save() - ; - } - - Wootook::dispatchEvent('planet.init', array( - 'planet' => $planet, - 'player' => $this - )); - - $planet->save(); - - return $planet; - } - - /** - * - * Enter description here ... - * @param int|Wootook_Empire_Model_Planet $planet - */ - public function updateCurrentPlanet($planet) - { - if (!$planet instanceof Wootook_Empire_Model_Planet) { - $planetCollection = $this->_preparePlanetCollection()->where('id=:id'); - - $planetCollection->load(array( - 'id' => $planet, - 'user' => $this->getId() - )); - - if ($planetCollection->count() !== 1) { - return $this; - } - - $planet = $planetCollection->current(); - } - - if ($planet->getPlayerId() != $this->getId() || $planet->isDestroyed()) { - return $this; - } - - $this->setData('current_planet', $planet->getId())->save(); - - return $this; - } - - /** - * - * Enter description here ... - * @param Wootook_Empire_Model_Planet $planet - */ - public function setHomePlanet(Wootook_Empire_Model_Planet $planet) - { - if ($planet->getPlayerId() != $this->getId() || $planet->isDestroyed()) { - return $this; - } - - $this->setData('id_planet', $planet->getId()); - $this->_homePlanet = $planet; - - return $this; - } - - /** - * - * Enter description here ... - * @param Wootook_Empire_Model_Planet $planet - */ - public function setCurrentPlanet(Wootook_Empire_Model_Planet $planet) - { - if ($planet->getPlayerId() != $this->getId() || $planet->isDestroyed()) { - return $this; - } - - $this->setData('current_planet', $planet->getId()); - $this->_currentPlanet = $planet; - - return $this; - } - - /** - * - * Enter description here ... - * @return Wootook_Empire_Model_Planet - */ - public function getHomePlanet() - { - if ($this->_homePlanet === null) { - $planetId = $this->getData('id_planet'); - if (!$planetId) { - return null; - } - - $planet = Wootook_Empire_Model_Planet::factory($planetId); - - if ($planet->getPlayerId() != $this->getId() || $planet->isDestroyed()) { - return null; - } - - $this->_homePlanet = $planet; - } - - return $planet; - } - - /** - * - * Enter description here ... - * @return Wootook_Empire_Model_Planet - */ - public function getCurrentPlanet() - { - if ($this->_currentPlanet === null) { - $planetId = $this->getData('current_planet'); - - if (!$planetId) { - $this->_currentPlanet = $this->getHomePlanet(); - if ($this->_currentPlanet === null) { - return null; - } - $this->setData('current_planet', $this->_currentPlanet->getId())->save(); - - return $this->_currentPlanet; - } - - $planet = Wootook_Empire_Model_Planet::factory($planetId); - - if ($planet->getPlayerId() != $this->getId() || $planet->isDestroyed()) { - $this->_currentPlanet = $this->getHomePlanet(); - $this->setData('current_planet', $this->_currentPlanet->getId())->save(); - - return $this->_currentPlanet; - } - - $this->_currentPlanet = $planet; - } - - return $this->_currentPlanet; - } - - protected function _preparePlanetCollection() - { - $planetCollection = new Wootook_Empire_Resource_Planet_Collection($this->getReadConnection()); - $planetCollection->addPlayerToFilter($this); - - $order = ($this->getData('planet_sort_order') == 1) ? 'DESC' : 'ASC'; - - switch ($this->getData('planet_sort')) { - case self::PLANET_SORT_POSITION: - $planetCollection - ->addOrderBy('galaxy', $order) - ->addOrderBy('system', $order) - ->addOrderBy('planet', $order) - ->addOrderBy('planet_type', $order) - ; - break; - - case self::PLANET_SORT_NAME: - $planetCollection->addOrderBy('name', $order); - break; - - case self::PLANET_SORT_DATE: - default: - $planetCollection->addOrderBy('id', $order); - break; - } - return $planetCollection; - } - - public function getPlanetCollection(Array $typeFilter = array()) - { - $planetCollection = $this->_preparePlanetCollection(); - - if (!empty($typeFilter)) { - $planetCollection->addFieldToFilter('planet_type', array(array('in' => $typeFilter))); - } - - return $planetCollection; - } - - protected function _prepareFleetCollection($collection) - { - $collection->addFieldToFilter('fleet_owner', $this->getId()); - - return $this; - } - - /** - * Returns all the flying fleets owned by the player - * - * @return Wootook_Empire_Resource_Fleet_Collection - */ - public function getFleets() - { - $collection = new Wootook_Empire_Resource_Fleet_Collection($this->getReadConnection()); - - $this->_prepareFleetCollection($collection); - - return $collection; - } - - /** - * Counts all the flying fleets owned by the player - * - * @return mixed - */ - public function getFleetCount() - { - return $this->getFleets()->getSize(); - } - - /** - * Returns all the visible fleets - * - * @param null $time - * @return Wootook_Empire_Resource_Fleet_Collection - */ - public function getVisibleFleets($time = null) - { - $collection = new Wootook_Empire_Resource_Fleet_Collection($this->getReadConnection()); - - if ($time === null) { - $time = new Wootook_Core_DateTime(); - } - $collection->addIsVisibleToFilter($this, $time); - - return $collection; - } - - /** - * Returns all the visible fleets - * - * @param null $time - * @return Wootook_Empire_Resource_Fleet_Collection - * @deprecated - * @alias getVisibleFleets - */ - public function getFleetCollection($time = null) - { - return $this->getVisibleFleets($time); - } - - public function getElement($elementId) - { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); - - return $this->getData($fields[$elementId]); - } - - public function setElement($elementId, $level) - { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); - - return $this->setData($fields[$elementId], $level); - } - - public function hasElement($elementId, $levelRequired = 0) - { - $fields = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); - - return $this->hasData($fields[$elementId]) && Math::comp($this->getElement($elementId), $levelRequired) > 0; - } - - public function getSkinPath($default = null) - { - if ($path = $this->getData('dpath')) { - return $path; - } - return $default; - } - - public function setSkinPath($path) - { - $this->setData('dpath', $path); - - return $this; - } - - public function checkPassword($password) - { - if (self::hash($password) == $this->getData('password')) { - return true; - } - return false; - } - - public function getNewMessagesCount() - { - $messageCollection = new Wootook_Player_Resource_Message_Collection($this->getReadConnection()); - $messageCollection->addPlayerToFilter($this)->addUnreadToFilter(); - - $newMessages = null; - if (($count = $messageCollection->getSize()) > 0) { - return $count; - } - return null; - } - - public static function layoutPrepareAfterListener($eventData) - { - $player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - if ($player === null || !$player->getId() || !in_array($player->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - return; - } - - if (!isset($eventData['layout']) || !$eventData['layout'] instanceof Wootook_Core_Model_Layout) { - return; - } - $layout = $eventData['layout']; - $navigation = $layout->getBlock('navigation'); - - if ($navigation === null) { - return; - } - - if (!defined('IN_ADMIN')) { - $navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/overview.php', array(), array('admin')); - } else { - $navigation->addLink('tools/back', 'Go back to the game', 'Go back to the game', 'overview.php', array(), array('admin')); - } - } - - public function isBanned() - { - return $this->getData('bana') ? true : false; - } - - public function isVacation() - { - return $this->getData('urlaubs_modus') ? true : false; - } - - public function getVacationEndDate() - { - return $this->getData('urlaubs_until'); - } - - public function getLastLoginDate() - { - return $this->getData('onlinetime'); - } - - public function setVacation($active = true) - { - $this->setData('urlaubs_modus', $active); - - foreach ($this->getPlanetCollection() as $planet) { - $planet->updateResources(); - $planet->updateResourceProduction(); - $planet->save(); - } - - if ($active) { - $this->setData('urlaubs_until', time() + Wootook::getConfig('engine/options/vacation-min-time')); - } else { - $this->setData('urlaubs_until', null); - } - $this->save(); - - return $this; - } - - public function isAuthorized($levels = array(LEVEL_ADMIN)) - { - if (!is_array($levels)) { - $levels = array($levels); - } - - if (in_array($this->getData('authlevel'), $levels)) { - return true; - } - return false; - } -} diff --git a/src/application/code/core/Wootook/Player/Model/Session.php b/src/application/code/core/Wootook/Player/Model/Session.php deleted file mode 100644 index 9ae226c..0000000 --- a/src/application/code/core/Wootook/Player/Model/Session.php +++ /dev/null @@ -1,205 +0,0 @@ -getData('player_id'); - } - - public function setPlayer(Wootook_Player_Model_Entity $player) - { - $this->_player = $player; - $this->setData('player_id', $player->getId()); - - return $this; - } - - /** - * - * Enter description here ... - * @return Wootook_Player_Model_Entity - */ - public function getPlayer() - { - if ($this->_player === null) { - $this->_player = new Wootook_Player_Model_Entity(); - - try { - if ($this->hasData('player_id')) { - $id = intval($this->getData('player_id')); - } else if (Wootook::getRequest() !== null && - ($cookieData = Wootook::getRequest()->getCookie($this->_player->getCookieName())) !== null && - is_array($cookieData)) { - - $adapter = $this->_player->getReadConnection(); - $select = $adapter->select(array('user' => $adapter->getTable('users'))); - - $select - ->column('id') - ->where('id', isset($cookieData['id']) ? intval($cookieData['id']) : 0) - ->where(new Wootook_Core_Database_Sql_Placeholder_Expression( - ':key=CONCAT((@salt:=MID(:key, 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))', - array('key' => isset($cookieData['key']) ? $adapter->quote($cookieData['key']) : null))) - ; - try { - $statement = $adapter->prepare($select); - if (!$statement->execute($cookieData) || $statement->rowCount() <= 0) { - throw new Wootook_Player_Exception_Session('Your session has expired, please login.'); - } - - $id = $statement->fetchColumn(); - } catch (Wootook_Core_Exception_Database_AdapterError $e) { - throw new Wootook_Core_Exception_DataAccessException('Session error.', null, $e); - } catch (Wootook_Core_Exception_Database_StatementError $e) { - throw new Wootook_Core_Exception_DataAccessException('Session error.', null, $e); - } - } else { - //throw new Wootook_Player_Exception_Session('Your session has expired, please login.'); - return $this->_player; - } - } catch (Wootook_Player_Exception_Session $e) { - $this->addError($e->getMessage()); - return $this->_player; - } - - try { - $this->_player->load($id); - } catch (Wootook_Core_Exception_DataAccessException $e) { - $this->addError('Session error.'); - return $this->_player; - } - $this->_player->updateActivity(); - } - return $this->_player; - } - - public function isLoggedIn() - { - if ($this->getPlayerId()) { - return true; - } - return false; - } - - public function logout() - { - $this->clearData(); - - return $this; - } - - public function login($username, $password, $remember = false) - { - try { - if ($this->_player === null) { - $this->_player = new Wootook_Player_Model_Entity(); - } - - if ($this->_player->getId()) { - return $this->_player; - } - $adapter = $this->_player->getReadConnection(); - $select = $adapter->select(array('user' => $adapter->getTable($this->_player->getTableName()))); - - $passwordHash = $this->_player->hash($password); - $select - ->column(array( - 'id' => 'user.id', - 'username' => 'user.username', - 'password_hash' => 'user.password', - 'is_banned' => 'user.banaday', - 'login_rememberme' => new Wootook_Core_Database_Sql_Placeholder_Expression('CONCAT((@salt:=MID(MD5(RAND()), 0, 4)), SHA1(CONCAT(user.username, user.password, @salt)))'), - 'login_success' => new Wootook_Core_Database_Sql_Placeholder_Expression("(CASE WHEN user.password={$adapter->quote($passwordHash)} THEN 1 ELSE 0 END)") - )) - ->where(new Wootook_Core_Database_Sql_Placeholder_Expression('user.username=:username', array('username' => $username))); - - $statement = $adapter->prepare($select); - if (!$statement->execute()) { - $this->addError(Wootook::__('No such user.')); - return $this->_player; - } - } catch (Wootook_Core_Exception_Database_StatementError $e) { - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - $this->addError(Wootook::__('No such user.')); - return $this->_player; - } catch (Wootook_Core_Exception_DataAccessException $e) { - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - $this->addError(Wootook::__('No such user.')); - return $this->_player; - } - - $login = $statement->fetch(); - - if (intval($login['login_success']) == 1) { - $this->_player->load($login['id']); - - if ($login['is_banned'] != 0) { - if ($login['is_banned'] <= time()) { - $this->_player->setData('banaday', 0) - ->setData('bana', 0) - ->setData('urlaubs_modus', 0) - ->setData('urlaubs_until', null) - ->save() - ; - } else { - $this->addError(Wootook::__('You were banned, please contact admin for more information.')); - return $this->_player; - } - } - - if (isset($_POST["rememberme"]) && Wootook::getResponse() !== null) { - Wootook::getResponse()->setCookie( - $this->_player->getCookieName(), - array('id' => $this->_player->getId(), 'key' => $login['login_rememberme']), - $this->_player->getCookieLifetime(), - $this->_player->getCookiePath(), - $this->_player->getCookieDomain() - ); - } - - $this->setLoggedIn($this->_player); - return $this->_player; - } - - $this->addError(Wootook::__('Your username or credential is invalid, please check your input.')); - return $this->_player; - } - - public function setLoggedIn(Wootook_Player_Model_Entity $player) - { - $player->updateActivity(); - - $this->setData('player_id', intval($player->getId())); - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Player/Mvc/Controller/Registered.php b/src/application/code/core/Wootook/Player/Mvc/Controller/Registered.php deleted file mode 100644 index 3374acf..0000000 --- a/src/application/code/core/Wootook/Player/Mvc/Controller/Registered.php +++ /dev/null @@ -1,32 +0,0 @@ -getSession()->getPlayer(); - } - - public function getCurrentPlanet() - { - return $this->getPlayer()->getCurrentPlanet(); - } - - public function preDispatch() - { - if (!$this->getSession()->isLoggedIn()) { - $this->_redirectLogin(); - } - } - - protected function _redirectLogin() - { - return $this->_redirect('player/account/login'); - } -} diff --git a/src/application/code/core/Wootook/Player/Resource/Entity/Collection.php b/src/application/code/core/Wootook/Player/Resource/Entity/Collection.php deleted file mode 100644 index 3e2c1bc..0000000 --- a/src/application/code/core/Wootook/Player/Resource/Entity/Collection.php +++ /dev/null @@ -1,37 +0,0 @@ -_init('users', 'Wootook_Player_Model_Entity'); - } - - public function addAuthlevelToFilter(Array $levels, $exclude = false) - { - if ($exclude === true) { - $this->addFieldToFilter('authlevel', array(array('nin' => $levels))); - } else { - $this->addFieldToFilter('authlevel', array(array('in' => $levels))); - } - - return $this; - } - - public function addIsOnlineToFilter($onlineTime = 900) - { - $onlineTime = (int) $onlineTime; - - $date = new Wootook_Core_DateTime(); - $date->sub($onlineTime, Wootook_Core_DateTime::TIMESTAMP); - - if ($onlineTime > 0) { - $this->addFieldToFilter('onlinetime', array(array( - Wootook_Core_Database_Sql_Select::OPERATOR_DATE => array('from' => $date) - ))); - } - - return $this; - } -} diff --git a/src/application/code/core/Wootook/Player/Resource/Message/Collection.php b/src/application/code/core/Wootook/Player/Resource/Message/Collection.php deleted file mode 100644 index e6d9198..0000000 --- a/src/application/code/core/Wootook/Player/Resource/Message/Collection.php +++ /dev/null @@ -1,24 +0,0 @@ -_init('messages', 'Wootook_Player_Model_Message'); - } - - public function addPlayerToFilter(Wootook_Player_Model_Entity $player) - { - $this->addFieldToFilter('message_owner', $player->getId()); - - return $this; - } - - public function addUnreadToFilter() - { - $this->addFieldToFilter('message_read_at', array(array('lteq' => 0))); - - return $this; - } -} diff --git a/src/application/code/libraries/Wildfire/Stream.php b/src/application/code/libraries/Wildfire/Stream.php deleted file mode 100644 index 9966a44..0000000 --- a/src/application/code/libraries/Wildfire/Stream.php +++ /dev/null @@ -1,1753 +0,0 @@ - - * @license http://www.opensource.org/licenses/bsd-license.php - * @package FirePHPCore - */ - - -/** - * Sends the given data to the FirePHP Firefox Extension. - * The data can be displayed in the Firebug Console or in the - * "Server" request tab. - * - * For more information see: http://www.firephp.org/ - * - * @copyright Copyright (C) 2007-2009 Christoph Dorn - * @author Christoph Dorn - * @license http://www.opensource.org/licenses/bsd-license.php - * @package FirePHPCore - */ -class Wildfire_Stream { - - /** - * FirePHP version - * - * @var string - */ - const VERSION = '0.3'; // @pinf replace '0.3' with '%%package.version%%' - - /** - * Firebug LOG level - * - * Logs a message to firebug console. - * - * @var string - */ - const LOG = 'LOG'; - - /** - * Firebug INFO level - * - * Logs a message to firebug console and displays an info icon before the message. - * - * @var string - */ - const INFO = 'INFO'; - - /** - * Firebug WARN level - * - * Logs a message to firebug console, displays an warning icon before the message and colors the line turquoise. - * - * @var string - */ - const WARN = 'WARN'; - - /** - * Firebug ERROR level - * - * Logs a message to firebug console, displays an error icon before the message and colors the line yellow. Also increments the firebug error count. - * - * @var string - */ - const ERROR = 'ERROR'; - - /** - * Dumps a variable to firebug's server panel - * - * @var string - */ - const DUMP = 'DUMP'; - - /** - * Displays a stack trace in firebug console - * - * @var string - */ - const TRACE = 'TRACE'; - - /** - * Displays an exception in firebug console - * - * Increments the firebug error count. - * - * @var string - */ - const EXCEPTION = 'EXCEPTION'; - - /** - * Displays an table in firebug console - * - * @var string - */ - const TABLE = 'TABLE'; - - /** - * Starts a group in firebug console - * - * @var string - */ - const GROUP_START = 'GROUP_START'; - - /** - * Ends a group in firebug console - * - * @var string - */ - const GROUP_END = 'GROUP_END'; - - /** - * Singleton instance of FirePHP - * - * @var FirePHP - */ - protected static $instance = null; - - /** - * Flag whether we are logging from within the exception handler - * - * @var boolean - */ - protected $inExceptionHandler = false; - - /** - * Flag whether to throw PHP errors that have been converted to ErrorExceptions - * - * @var boolean - */ - protected $throwErrorExceptions = true; - - /** - * Flag whether to convert PHP assertion errors to Exceptions - * - * @var boolean - */ - protected $convertAssertionErrorsToExceptions = true; - - /** - * Flag whether to throw PHP assertion errors that have been converted to Exceptions - * - * @var boolean - */ - protected $throwAssertionExceptions = false; - - /** - * Wildfire protocol message index - * - * @var int - */ - protected $messageIndex = 1; - - /** - * Options for the library - * - * @var array - */ - protected $options = array('maxDepth' => 10, - 'maxObjectDepth' => 5, - 'maxArrayDepth' => 5, - 'useNativeJsonEncode' => true, - 'includeLineNumbers' => true); - - /** - * Filters used to exclude object members when encoding - * - * @var array - */ - protected $objectFilters = array( - 'firephp' => array('objectStack', 'instance', 'json_objectStack'), - 'firephp_test_class' => array('objectStack', 'instance', 'json_objectStack') - ); - - /** - * A stack of objects used to detect recursion during object encoding - * - * @var object - */ - protected $objectStack = array(); - - /** - * Flag to enable/disable logging - * - * @var boolean - */ - protected $enabled = true; - - /** - * The insight console to log to if applicable - * - * @var object - */ - protected $logToInsightConsole = null; - - /** - * When the object gets serialized only include specific object members. - * - * @return array - */ - public function __sleep() - { - return array('options','objectFilters','enabled'); - } - - /** - * Gets singleton instance of FirePHP - * - * @param boolean $AutoCreate - * @return FirePHP - */ - public static function getInstance($AutoCreate = false) - { - if ($AutoCreate===true && !self::$instance) { - self::init(); - } - return self::$instance; - } - - /** - * Creates FirePHP object and stores it for singleton access - * - * @return FirePHP - */ - public static function init() - { - return self::setInstance(new self()); - } - - /** - * Set the instance of the FirePHP singleton - * - * @param FirePHP $instance The FirePHP object instance - * @return FirePHP - */ - public static function setInstance($instance) - { - return self::$instance = $instance; - } - - /** - * Set an Insight console to direct all logging calls to - * - * @param object $console The console object to log to - * @return void - */ - public function setLogToInsightConsole($console) - { - if(is_string($console)) { - if(get_class($this)!='FirePHP_Insight' && !is_subclass_of($this, 'FirePHP_Insight')) { - throw new Exception('FirePHP instance not an instance or subclass of FirePHP_Insight!'); - } - $this->logToInsightConsole = $this->to('request')->console($console); - } else { - $this->logToInsightConsole = $console; - } - } - - /** - * Enable and disable logging to Firebug - * - * @param boolean $Enabled TRUE to enable, FALSE to disable - * @return void - */ - public function setEnabled($Enabled) - { - $this->enabled = $Enabled; - } - - /** - * Check if logging is enabled - * - * @return boolean TRUE if enabled - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Specify a filter to be used when encoding an object - * - * Filters are used to exclude object members. - * - * @param string $Class The class name of the object - * @param array $Filter An array of members to exclude - * @return void - */ - public function setObjectFilter($Class, $Filter) - { - $this->objectFilters[strtolower($Class)] = $Filter; - } - - /** - * Set some options for the library - * - * Options: - * - maxDepth: The maximum depth to traverse (default: 10) - * - maxObjectDepth: The maximum depth to traverse objects (default: 5) - * - maxArrayDepth: The maximum depth to traverse arrays (default: 5) - * - useNativeJsonEncode: If true will use json_encode() (default: true) - * - includeLineNumbers: If true will include line numbers and filenames (default: true) - * - * @param array $Options The options to be set - * @return void - */ - public function setOptions($Options) - { - $this->options = array_merge($this->options,$Options); - } - - /** - * Get options from the library - * - * @return array The currently set options - */ - public function getOptions() - { - return $this->options; - } - - /** - * Set an option for the library - * - * @param string $Name - * @param mixed $Value - * @throws Exception - * @return void - */ - public function setOption($Name, $Value) - { - if (!isset($this->options[$Name])) { - throw $this->newException('Unknown option: ' . $Name); - } - $this->options[$Name] = $Value; - } - - /** - * Get an option from the library - * - * @param string $Name - * @throws Exception - * @return mixed - */ - public function getOption($Name) - { - if (!isset($this->options[$Name])) { - throw $this->newException('Unknown option: ' . $Name); - } - return $this->options[$Name]; - } - - /** - * Register FirePHP as your error handler - * - * Will throw exceptions for each php error. - * - * @return mixed Returns a string containing the previously defined error handler (if any) - */ - public function registerErrorHandler($throwErrorExceptions = false) - { - //NOTE: The following errors will not be caught by this error handler: - // E_ERROR, E_PARSE, E_CORE_ERROR, - // E_CORE_WARNING, E_COMPILE_ERROR, - // E_COMPILE_WARNING, E_STRICT - - $this->throwErrorExceptions = $throwErrorExceptions; - - return set_error_handler(array($this,'errorHandler')); - } - - /** - * FirePHP's error handler - * - * Throws exception for each php error that will occur. - * - * @param int $errno - * @param string $errstr - * @param string $errfile - * @param int $errline - * @param array $errcontext - */ - public function errorHandler($errno, $errstr, $errfile, $errline, $errcontext) - { - // Don't throw exception if error reporting is switched off - if (error_reporting() == 0) { - return; - } - // Only throw exceptions for errors we are asking for - if (error_reporting() & $errno) { - - $exception = new ErrorException($errstr, 0, $errno, $errfile, $errline); - if ($this->throwErrorExceptions) { - throw $exception; - } else { - $this->fb($exception); - } - } - } - - /** - * Register FirePHP as your exception handler - * - * @return mixed Returns the name of the previously defined exception handler, - * or NULL on error. - * If no previous handler was defined, NULL is also returned. - */ - public function registerExceptionHandler() - { - return set_exception_handler(array($this,'exceptionHandler')); - } - - /** - * FirePHP's exception handler - * - * Logs all exceptions to your firebug console and then stops the script. - * - * @param Exception $Exception - * @throws Exception - */ - function exceptionHandler($Exception) - { - - $this->inExceptionHandler = true; - - header('HTTP/1.1 500 Internal Server Error'); - - try { - $this->fb($Exception); - } catch (Exception $e) { - echo 'We had an exception: ' . $e; - } - $this->inExceptionHandler = false; - } - - /** - * Register FirePHP driver as your assert callback - * - * @param boolean $convertAssertionErrorsToExceptions - * @param boolean $throwAssertionExceptions - * @return mixed Returns the original setting or FALSE on errors - */ - public function registerAssertionHandler($convertAssertionErrorsToExceptions = true, $throwAssertionExceptions = false) - { - $this->convertAssertionErrorsToExceptions = $convertAssertionErrorsToExceptions; - $this->throwAssertionExceptions = $throwAssertionExceptions; - - if ($throwAssertionExceptions && !$convertAssertionErrorsToExceptions) { - throw $this->newException('Cannot throw assertion exceptions as assertion errors are not being converted to exceptions!'); - } - - return assert_options(ASSERT_CALLBACK, array($this, 'assertionHandler')); - } - - /** - * FirePHP's assertion handler - * - * Logs all assertions to your firebug console and then stops the script. - * - * @param string $file File source of assertion - * @param int $line Line source of assertion - * @param mixed $code Assertion code - */ - public function assertionHandler($file, $line, $code) - { - if ($this->convertAssertionErrorsToExceptions) { - - $exception = new ErrorException('Assertion Failed - Code[ '.$code.' ]', 0, null, $file, $line); - - if ($this->throwAssertionExceptions) { - throw $exception; - } else { - $this->fb($exception); - } - - } else { - $this->fb($code, 'Assertion Failed', FirePHP::ERROR, array('File'=>$file,'Line'=>$line)); - } - } - - /** - * Start a group for following messages. - * - * Options: - * Collapsed: [true|false] - * Color: [#RRGGBB|ColorName] - * - * @param string $Name - * @param array $Options OPTIONAL Instructions on how to log the group - * @return true - * @throws Exception - */ - public function group($Name, $Options = null) - { - - if (!$Name) { - throw $this->newException('You must specify a label for the group!'); - } - - if ($Options) { - if (!is_array($Options)) { - throw $this->newException('Options must be defined as an array!'); - } - if (array_key_exists('Collapsed', $Options)) { - $Options['Collapsed'] = ($Options['Collapsed'])?'true':'false'; - } - } - - return $this->fb(null, $Name, FirePHP::GROUP_START, $Options); - } - - /** - * Ends a group you have started before - * - * @return true - * @throws Exception - */ - public function groupEnd() - { - return $this->fb(null, null, FirePHP::GROUP_END); - } - - /** - * Log object with label to firebug console - * - * @see FirePHP::LOG - * @param mixes $Object - * @param string $Label - * @return true - * @throws Exception - */ - public function log($Object, $Label = null, $Options = array()) - { - return $this->fb($Object, $Label, FirePHP::LOG, $Options); - } - - /** - * Log object with label to firebug console - * - * @see FirePHP::INFO - * @param mixes $Object - * @param string $Label - * @return true - * @throws Exception - */ - public function info($Object, $Label = null, $Options = array()) - { - return $this->fb($Object, $Label, FirePHP::INFO, $Options); - } - - /** - * Log object with label to firebug console - * - * @see FirePHP::WARN - * @param mixes $Object - * @param string $Label - * @return true - * @throws Exception - */ - public function warn($Object, $Label = null, $Options = array()) - { - return $this->fb($Object, $Label, FirePHP::WARN, $Options); - } - - /** - * Log object with label to firebug console - * - * @see FirePHP::ERROR - * @param mixes $Object - * @param string $Label - * @return true - * @throws Exception - */ - public function error($Object, $Label = null, $Options = array()) - { - return $this->fb($Object, $Label, FirePHP::ERROR, $Options); - } - - /** - * Dumps key and variable to firebug server panel - * - * @see FirePHP::DUMP - * @param string $Key - * @param mixed $Variable - * @return true - * @throws Exception - */ - public function dump($Key, $Variable, $Options = array()) - { - if (!is_string($Key)) { - throw $this->newException('Key passed to dump() is not a string'); - } - if (strlen($Key)>100) { - throw $this->newException('Key passed to dump() is longer than 100 characters'); - } - if (!preg_match_all('/^[a-zA-Z0-9-_\.:]*$/', $Key, $m)) { - throw $this->newException('Key passed to dump() contains invalid characters [a-zA-Z0-9-_\.:]'); - } - return $this->fb($Variable, $Key, FirePHP::DUMP, $Options); - } - - /** - * Log a trace in the firebug console - * - * @see FirePHP::TRACE - * @param string $Label - * @return true - * @throws Exception - */ - public function trace($Label) - { - return $this->fb($Label, FirePHP::TRACE); - } - - /** - * Log a table in the firebug console - * - * @see FirePHP::TABLE - * @param string $Label - * @param string $Table - * @return true - * @throws Exception - */ - public function table($Label, $Table, $Options = array()) - { - return $this->fb($Table, $Label, FirePHP::TABLE, $Options); - } - - /** - * Insight API wrapper - * - * @see Insight_Helper::to() - */ - public static function to() - { - $instance = self::getInstance(); - if (!method_exists($instance, "_to")) { - throw new Exception("FirePHP::to() implementation not loaded"); - } - $args = func_get_args(); - return call_user_func_array(array($instance, '_to'), $args); - } - - /** - * Insight API wrapper - * - * @see Insight_Helper::plugin() - */ - public static function plugin() - { - $instance = self::getInstance(); - if (!method_exists($instance, "_plugin")) { - throw new Exception("FirePHP::plugin() implementation not loaded"); - } - $args = func_get_args(); - return call_user_func_array(array($instance, '_plugin'), $args); - } - - /** - * Check if FirePHP is installed on client - * - * @return boolean - */ - public function detectClientExtension() - { - // Check if FirePHP is installed on client via User-Agent header - if (@preg_match_all('/\sFirePHP\/([\.\d]*)\s?/si',$this->getUserAgent(),$m) && - version_compare($m[1][0],'0.0.6','>=')) { - return true; - } else - // Check if FirePHP is installed on client via X-FirePHP-Version header - if (@preg_match_all('/^([\.\d]*)$/si',$this->getRequestHeader("X-FirePHP-Version"),$m) && - version_compare($m[1][0],'0.0.6','>=')) { - return true; - } - return false; - } - - /** - * Log varible to Firebug - * - * @see http://www.firephp.org/Wiki/Reference/Fb - * @param mixed $Object The variable to be logged - * @return true Return TRUE if message was added to headers, FALSE otherwise - * @throws Exception - */ - public function fb($Object) - { - if($this instanceof FirePHP_Insight && method_exists($this, '_logUpgradeClientMessage')) { - if(!FirePHP_Insight::$upgradeClientMessageLogged) { // avoid infinite recursion as _logUpgradeClientMessage() logs a message - $this->_logUpgradeClientMessage(); - } - } - - static $insightGroupStack = array(); - - if (!$this->getEnabled()) { - return false; - } - - if ($this->headersSent($filename, $linenum)) { - // If we are logging from within the exception handler we cannot throw another exception - if ($this->inExceptionHandler) { - // Simply echo the error out to the page - echo '
FirePHP ERROR: Headers already sent in '.$filename.' on line '.$linenum.'. Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive.
'; - } else { - throw $this->newException('Headers already sent in '.$filename.' on line '.$linenum.'. Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive.'); - } - } - - $Type = null; - $Label = null; - $Options = array(); - - if (func_num_args()==1) { - } else - if (func_num_args()==2) { - switch(func_get_arg(1)) { - case self::LOG: - case self::INFO: - case self::WARN: - case self::ERROR: - case self::DUMP: - case self::TRACE: - case self::EXCEPTION: - case self::TABLE: - case self::GROUP_START: - case self::GROUP_END: - $Type = func_get_arg(1); - break; - default: - $Label = func_get_arg(1); - break; - } - } else - if (func_num_args()==3) { - $Type = func_get_arg(2); - $Label = func_get_arg(1); - } else - if (func_num_args()==4) { - $Type = func_get_arg(2); - $Label = func_get_arg(1); - $Options = func_get_arg(3); - } else { - throw $this->newException('Wrong number of arguments to fb() function!'); - } - - if($this->logToInsightConsole!==null && (get_class($this)=='FirePHP_Insight' || is_subclass_of($this, 'FirePHP_Insight'))) { - $msg = $this->logToInsightConsole; - if ($Object instanceof Exception) { - $Type = self::EXCEPTION; - } - if($Label && $Type!=self::TABLE && $Type!=self::GROUP_START) { - $msg = $msg->label($Label); - } - switch($Type) { - case self::DUMP: - case self::LOG: - return $msg->log($Object); - case self::INFO: - return $msg->info($Object); - case self::WARN: - return $msg->warn($Object); - case self::ERROR: - return $msg->error($Object); - case self::TRACE: - return $msg->trace($Object); - case self::EXCEPTION: - return $this->plugin('engine')->handleException($Object, $msg); - case self::TABLE: - if (isset($Object[0]) && !is_string($Object[0]) && $Label) { - $Object = array($Label, $Object); - } - return $msg->table($Object[0], array_slice($Object[1],1), $Object[1][0]); - case self::GROUP_START: - $insightGroupStack[] = $msg->group(md5($Label))->open(); - return $msg->log($Label); - case self::GROUP_END: - if(count($insightGroupStack)==0) { - throw new Error('Too many groupEnd() as opposed to group() calls!'); - } - $group = array_pop($insightGroupStack); - return $group->close(); - default: - return $msg->log($Object); - } - } - - if (!$this->detectClientExtension()) { - return false; - } - - $meta = array(); - $skipFinalObjectEncode = false; - - if ($Object instanceof Exception) { - - $meta['file'] = $this->_escapeTraceFile($Object->getFile()); - $meta['line'] = $Object->getLine(); - - $trace = $Object->getTrace(); - if ($Object instanceof ErrorException - && isset($trace[0]['function']) - && $trace[0]['function']=='errorHandler' - && isset($trace[0]['class']) - && $trace[0]['class']=='FirePHP') { - - $severity = false; - switch($Object->getSeverity()) { - case E_WARNING: $severity = 'E_WARNING'; break; - case E_NOTICE: $severity = 'E_NOTICE'; break; - case E_USER_ERROR: $severity = 'E_USER_ERROR'; break; - case E_USER_WARNING: $severity = 'E_USER_WARNING'; break; - case E_USER_NOTICE: $severity = 'E_USER_NOTICE'; break; - case E_STRICT: $severity = 'E_STRICT'; break; - case E_RECOVERABLE_ERROR: $severity = 'E_RECOVERABLE_ERROR'; break; - case E_DEPRECATED: $severity = 'E_DEPRECATED'; break; - case E_USER_DEPRECATED: $severity = 'E_USER_DEPRECATED'; break; - } - - $Object = array('Class'=>get_class($Object), - 'Message'=>$severity.': '.$Object->getMessage(), - 'File'=>$this->_escapeTraceFile($Object->getFile()), - 'Line'=>$Object->getLine(), - 'Type'=>'trigger', - 'Trace'=>$this->_escapeTrace(array_splice($trace,2))); - $skipFinalObjectEncode = true; - } else { - $Object = array('Class'=>get_class($Object), - 'Message'=>$Object->getMessage(), - 'File'=>$this->_escapeTraceFile($Object->getFile()), - 'Line'=>$Object->getLine(), - 'Type'=>'throw', - 'Trace'=>$this->_escapeTrace($trace)); - $skipFinalObjectEncode = true; - } - $Type = self::EXCEPTION; - - } else - if ($Type==self::TRACE) { - - $trace = debug_backtrace(); - if (!$trace) return false; - for( $i=0 ; $i_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php' - || substr($this->_standardizePath($trace[$i]['file']),-29,29)=='FirePHPCore/FirePHP.class.php')) { - /* Skip - FB::trace(), FB::send(), $firephp->trace(), $firephp->fb() */ - } else - if (isset($trace[$i]['class']) - && isset($trace[$i+1]['file']) - && $trace[$i]['class']=='FirePHP' - && substr($this->_standardizePath($trace[$i+1]['file']),-18,18)=='FirePHPCore/fb.php') { - /* Skip fb() */ - } else - if ($trace[$i]['function']=='fb' - || $trace[$i]['function']=='trace' - || $trace[$i]['function']=='send') { - - $Object = array('Class'=>isset($trace[$i]['class'])?$trace[$i]['class']:'', - 'Type'=>isset($trace[$i]['type'])?$trace[$i]['type']:'', - 'Function'=>isset($trace[$i]['function'])?$trace[$i]['function']:'', - 'Message'=>$trace[$i]['args'][0], - 'File'=>isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):'', - 'Line'=>isset($trace[$i]['line'])?$trace[$i]['line']:'', - 'Args'=>isset($trace[$i]['args'])?$this->encodeObject($trace[$i]['args']):'', - 'Trace'=>$this->_escapeTrace(array_splice($trace,$i+1))); - - $skipFinalObjectEncode = true; - $meta['file'] = isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):''; - $meta['line'] = isset($trace[$i]['line'])?$trace[$i]['line']:''; - break; - } - } - - } else - if ($Type==self::TABLE) { - - if (isset($Object[0]) && is_string($Object[0])) { - $Object[1] = $this->encodeTable($Object[1]); - } else { - $Object = $this->encodeTable($Object); - } - - $skipFinalObjectEncode = true; - - } else - if ($Type==self::GROUP_START) { - - if (!$Label) { - throw $this->newException('You must specify a label for the group!'); - } - - } else { - if ($Type===null) { - $Type = self::LOG; - } - } - - if ($this->options['includeLineNumbers']) { - if (!isset($meta['file']) || !isset($meta['line'])) { - - $trace = debug_backtrace(); - for( $i=0 ; $trace && $i_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php' - || substr($this->_standardizePath($trace[$i]['file']),-29,29)=='FirePHPCore/FirePHP.class.php')) { - /* Skip - FB::trace(), FB::send(), $firephp->trace(), $firephp->fb() */ - } else - if (isset($trace[$i]['class']) - && isset($trace[$i+1]['file']) - && $trace[$i]['class']=='FirePHP' - && substr($this->_standardizePath($trace[$i+1]['file']),-18,18)=='FirePHPCore/fb.php') { - /* Skip fb() */ - } else - if (isset($trace[$i]['file']) - && substr($this->_standardizePath($trace[$i]['file']),-18,18)=='FirePHPCore/fb.php') { - /* Skip FB::fb() */ - } else { - $meta['file'] = isset($trace[$i]['file'])?$this->_escapeTraceFile($trace[$i]['file']):''; - $meta['line'] = isset($trace[$i]['line'])?$trace[$i]['line']:''; - break; - } - } - } - } else { - unset($meta['file']); - unset($meta['line']); - } - - $this->setHeader('X-Wf-Protocol-1','http://meta.wildfirehq.org/Protocol/JsonStream/0.2'); - $this->setHeader('X-Wf-1-Plugin-1','http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/'.self::VERSION); - - $structure_index = 1; - if ($Type==self::DUMP) { - $structure_index = 2; - $this->setHeader('X-Wf-1-Structure-2','http://meta.firephp.org/Wildfire/Structure/FirePHP/Dump/0.1'); - } else { - $this->setHeader('X-Wf-1-Structure-1','http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'); - } - - if ($Type==self::DUMP) { - $msg = '{"'.$Label.'":'.$this->jsonEncode($Object, $skipFinalObjectEncode).'}'; - } else { - $msg_meta = $Options; - $msg_meta['Type'] = $Type; - if ($Label!==null) { - $msg_meta['Label'] = $Label; - } - if (isset($meta['file']) && !isset($msg_meta['File'])) { - $msg_meta['File'] = $meta['file']; - } - if (isset($meta['line']) && !isset($msg_meta['Line'])) { - $msg_meta['Line'] = $meta['line']; - } - $msg = '['.$this->jsonEncode($msg_meta).','.$this->jsonEncode($Object, $skipFinalObjectEncode).']'; - } - - $parts = explode("\n",chunk_split($msg, 5000, "\n")); - - for( $i=0 ; $i2) { - // Message needs to be split into multiple parts - $this->setHeader('X-Wf-1-'.$structure_index.'-'.'1-'.$this->messageIndex, - (($i==0)?strlen($msg):'') - . '|' . $part . '|' - . (($isetHeader('X-Wf-1-'.$structure_index.'-'.'1-'.$this->messageIndex, - strlen($part) . '|' . $part . '|'); - } - - $this->messageIndex++; - - if ($this->messageIndex > 99999) { - throw $this->newException('Maximum number (99,999) of messages reached!'); - } - } - } - - $this->setHeader('X-Wf-1-Index',$this->messageIndex-1); - - return true; - } - - /** - * Standardizes path for windows systems. - * - * @param string $Path - * @return string - */ - protected function _standardizePath($Path) - { - return preg_replace('/\\\\+/','/',$Path); - } - - /** - * Escape trace path for windows systems - * - * @param array $Trace - * @return array - */ - protected function _escapeTrace($Trace) - { - if (!$Trace) return $Trace; - for( $i=0 ; $i_escapeTraceFile($Trace[$i]['file']); - } - if (isset($Trace[$i]['args'])) { - $Trace[$i]['args'] = $this->encodeObject($Trace[$i]['args']); - } - } - return $Trace; - } - - /** - * Escape file information of trace for windows systems - * - * @param string $File - * @return string - */ - protected function _escapeTraceFile($File) - { - /* Check if we have a windows filepath */ - if (strpos($File,'\\')) { - /* First strip down to single \ */ - - $file = preg_replace('/\\\\+/','\\',$File); - - return $file; - } - return $File; - } - - /** - * Check if headers have already been sent - * - * @param string $Filename - * @param integer $Linenum - */ - protected function headersSent(&$Filename, &$Linenum) - { - return headers_sent($Filename, $Linenum); - } - - /** - * Send header - * - * @param string $Name - * @param string $Value - */ - protected function setHeader($Name, $Value) - { - return header($Name.': '.$Value); - } - - /** - * Get user agent - * - * @return string|false - */ - protected function getUserAgent() - { - if (!isset($_SERVER['HTTP_USER_AGENT'])) return false; - return $_SERVER['HTTP_USER_AGENT']; - } - - /** - * Get all request headers - * - * @return array - */ - public static function getAllRequestHeaders() { - static $_cached_headers = false; - if($_cached_headers!==false) { - return $_cached_headers; - } - $headers = array(); - if(function_exists('getallheaders')) { - foreach( getallheaders() as $name => $value ) { - $headers[strtolower($name)] = $value; - } - } else { - foreach($_SERVER as $name => $value) { - if(substr($name, 0, 5) == 'HTTP_') { - $headers[strtolower(str_replace(' ', '-', str_replace('_', ' ', substr($name, 5))))] = $value; - } - } - } - return $_cached_headers = $headers; - } - - /** - * Get a request header - * - * @return string|false - */ - protected function getRequestHeader($Name) - { - $headers = self::getAllRequestHeaders(); - if (isset($headers[strtolower($Name)])) { - return $headers[strtolower($Name)]; - } - return false; - } - - /** - * Returns a new exception - * - * @param string $Message - * @return Exception - */ - protected function newException($Message) - { - return new Exception($Message); - } - - /** - * Encode an object into a JSON string - * - * Uses PHP's jeson_encode() if available - * - * @param object $Object The object to be encoded - * @return string The JSON string - */ - public function jsonEncode($Object, $skipObjectEncode = false) - { - if (!$skipObjectEncode) { - $Object = $this->encodeObject($Object); - } - - if (function_exists('json_encode') - && $this->options['useNativeJsonEncode']!=false) { - - return json_encode($Object); - } else { - return $this->json_encode($Object); - } - } - - /** - * Encodes a table by encoding each row and column with encodeObject() - * - * @param array $Table The table to be encoded - * @return array - */ - protected function encodeTable($Table) - { - - if (!$Table) return $Table; - - $new_table = array(); - foreach($Table as $row) { - - if (is_array($row)) { - $new_row = array(); - - foreach($row as $item) { - $new_row[] = $this->encodeObject($item); - } - - $new_table[] = $new_row; - } - } - - return $new_table; - } - - /** - * Encodes an object including members with - * protected and private visibility - * - * @param Object $Object The object to be encoded - * @param int $Depth The current traversal depth - * @return array All members of the object - */ - protected function encodeObject($Object, $ObjectDepth = 1, $ArrayDepth = 1, $MaxDepth = 1) - { - if ($MaxDepth > $this->options['maxDepth']) { - return '** Max Depth ('.$this->options['maxDepth'].') **'; - } - - $return = array(); - - if (is_resource($Object)) { - - return '** '.(string)$Object.' **'; - - } else - if (is_object($Object)) { - - if ($ObjectDepth > $this->options['maxObjectDepth']) { - return '** Max Object Depth ('.$this->options['maxObjectDepth'].') **'; - } - - foreach ($this->objectStack as $refVal) { - if ($refVal === $Object) { - return '** Recursion ('.get_class($Object).') **'; - } - } - array_push($this->objectStack, $Object); - - $return['__className'] = $class = get_class($Object); - $class_lower = strtolower($class); - - $reflectionClass = new ReflectionClass($class); - $properties = array(); - foreach( $reflectionClass->getProperties() as $property) { - $properties[$property->getName()] = $property; - } - - $members = (array)$Object; - - foreach( $properties as $plain_name => $property ) { - - $name = $raw_name = $plain_name; - if ($property->isStatic()) { - $name = 'static:'.$name; - } - if ($property->isPublic()) { - $name = 'public:'.$name; - } else - if ($property->isPrivate()) { - $name = 'private:'.$name; - $raw_name = "\0".$class."\0".$raw_name; - } else - if ($property->isProtected()) { - $name = 'protected:'.$name; - $raw_name = "\0".'*'."\0".$raw_name; - } - - if (!(isset($this->objectFilters[$class_lower]) - && is_array($this->objectFilters[$class_lower]) - && in_array($plain_name,$this->objectFilters[$class_lower]))) { - - if (array_key_exists($raw_name,$members) - && !$property->isStatic()) { - - $return[$name] = $this->encodeObject($members[$raw_name], $ObjectDepth + 1, 1, $MaxDepth + 1); - - } else { - if (method_exists($property,'setAccessible')) { - $property->setAccessible(true); - $return[$name] = $this->encodeObject($property->getValue($Object), $ObjectDepth + 1, 1, $MaxDepth + 1); - } else - if ($property->isPublic()) { - $return[$name] = $this->encodeObject($property->getValue($Object), $ObjectDepth + 1, 1, $MaxDepth + 1); - } else { - $return[$name] = '** Need PHP 5.3 to get value **'; - } - } - } else { - $return[$name] = '** Excluded by Filter **'; - } - } - - // Include all members that are not defined in the class - // but exist in the object - foreach( $members as $raw_name => $value ) { - - $name = $raw_name; - - if ($name{0} == "\0") { - $parts = explode("\0", $name); - $name = $parts[2]; - } - - $plain_name = $name; - - if (!isset($properties[$name])) { - $name = 'undeclared:'.$name; - - if (!(isset($this->objectFilters[$class_lower]) - && is_array($this->objectFilters[$class_lower]) - && in_array($plain_name,$this->objectFilters[$class_lower]))) { - - $return[$name] = $this->encodeObject($value, $ObjectDepth + 1, 1, $MaxDepth + 1); - } else { - $return[$name] = '** Excluded by Filter **'; - } - } - } - - array_pop($this->objectStack); - - } elseif (is_array($Object)) { - - if ($ArrayDepth > $this->options['maxArrayDepth']) { - return '** Max Array Depth ('.$this->options['maxArrayDepth'].') **'; - } - - foreach ($Object as $key => $val) { - - // Encoding the $GLOBALS PHP array causes an infinite loop - // if the recursion is not reset here as it contains - // a reference to itself. This is the only way I have come up - // with to stop infinite recursion in this case. - if ($key=='GLOBALS' - && is_array($val) - && array_key_exists('GLOBALS',$val)) { - $val['GLOBALS'] = '** Recursion (GLOBALS) **'; - } - - $return[$key] = $this->encodeObject($val, 1, $ArrayDepth + 1, $MaxDepth + 1); - } - } else { - if (self::is_utf8($Object)) { - return $Object; - } else { - return utf8_encode($Object); - } - } - return $return; - } - - /** - * Returns true if $string is valid UTF-8 and false otherwise. - * - * @param mixed $str String to be tested - * @return boolean - */ - protected static function is_utf8($str) - { - if(function_exists('mb_detect_encoding')) { - return (mb_detect_encoding($str) == 'UTF-8'); - } - $c=0; $b=0; - $bits=0; - $len=strlen($str); - for($i=0; $i<$len; $i++){ - $c=ord($str[$i]); - if ($c > 128){ - if (($c >= 254)) return false; - elseif ($c >= 252) $bits=6; - elseif ($c >= 248) $bits=5; - elseif ($c >= 240) $bits=4; - elseif ($c >= 224) $bits=3; - elseif ($c >= 192) $bits=2; - else return false; - if (($i+$bits) > $len) return false; - while($bits > 1){ - $i++; - $b=ord($str[$i]); - if ($b < 128 || $b > 191) return false; - $bits--; - } - } - } - return true; - } - - /** - * Converts to and from JSON format. - * - * JSON (JavaScript Object Notation) is a lightweight data-interchange - * format. It is easy for humans to read and write. It is easy for machines - * to parse and generate. It is based on a subset of the JavaScript - * Programming Language, Standard ECMA-262 3rd Edition - December 1999. - * This feature can also be found in Python. JSON is a text format that is - * completely language independent but uses conventions that are familiar - * to programmers of the C-family of languages, including C, C++, C#, Java, - * JavaScript, Perl, TCL, and many others. These properties make JSON an - * ideal data-interchange language. - * - * This package provides a simple encoder and decoder for JSON notation. It - * is intended for use with client-side Javascript applications that make - * use of HTTPRequest to perform server communication functions - data can - * be encoded into JSON notation for use in a client-side javascript, or - * decoded from incoming Javascript requests. JSON format is native to - * Javascript, and can be directly eval()'ed with no further parsing - * overhead - * - * All strings should be in ASCII or UTF-8 format! - * - * LICENSE: Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: Redistributions of source code must retain the - * above copyright notice, this list of conditions and the following - * disclaimer. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE - * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * @category - * @package Services_JSON - * @author Michal Migurski - * @author Matt Knapp - * @author Brett Stimmerman - * @author Christoph Dorn - * @copyright 2005 Michal Migurski - * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - */ - - - /** - * Keep a list of objects as we descend into the array so we can detect recursion. - */ - private $json_objectStack = array(); - - - /** - * convert a string from one UTF-8 char to one UTF-16 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf8 UTF-8 character - * @return string UTF-16 character - * @access private - */ - private function json_utf82utf16($utf8) - { - // oh please oh please oh please oh please oh please - if (function_exists('mb_convert_encoding')) { - return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); - } - - switch(strlen($utf8)) { - case 1: - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return $utf8; - - case 2: - // return a UTF-16 character from a 2-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x07 & (ord($utf8{0}) >> 2)) - . chr((0xC0 & (ord($utf8{0}) << 6)) - | (0x3F & ord($utf8{1}))); - - case 3: - // return a UTF-16 character from a 3-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr((0xF0 & (ord($utf8{0}) << 4)) - | (0x0F & (ord($utf8{1}) >> 2))) - . chr((0xC0 & (ord($utf8{1}) << 6)) - | (0x7F & ord($utf8{2}))); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * encodes an arbitrary variable into JSON format - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - private function json_encode($var) - { - - if (is_object($var)) { - if (in_array($var,$this->json_objectStack)) { - return '"** Recursion **"'; - } - } - - switch (gettype($var)) { - case 'boolean': - return $var ? 'true' : 'false'; - - case 'NULL': - return 'null'; - - case 'integer': - return (int) $var; - - case 'double': - case 'float': - return (float) $var; - - case 'string': - // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT - $ascii = ''; - $strlen_var = strlen($var); - - /* - * Iterate over every character in the string, - * escaping with a slash or encoding to UTF-8 where necessary - */ - for ($c = 0; $c < $strlen_var; ++$c) { - - $ord_var_c = ord($var{$c}); - - switch (true) { - case $ord_var_c == 0x08: - $ascii .= '\b'; - break; - case $ord_var_c == 0x09: - $ascii .= '\t'; - break; - case $ord_var_c == 0x0A: - $ascii .= '\n'; - break; - case $ord_var_c == 0x0C: - $ascii .= '\f'; - break; - case $ord_var_c == 0x0D: - $ascii .= '\r'; - break; - - case $ord_var_c == 0x22: - case $ord_var_c == 0x2F: - case $ord_var_c == 0x5C: - // double quote, slash, slosh - $ascii .= '\\'.$var{$c}; - break; - - case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): - // characters U-00000000 - U-0000007F (same as ASCII) - $ascii .= $var{$c}; - break; - - case (($ord_var_c & 0xE0) == 0xC0): - // characters U-00000080 - U-000007FF, mask 110XXXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, ord($var{$c + 1})); - $c += 1; - $utf16 = $this->json_utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF0) == 0xE0): - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2})); - $c += 2; - $utf16 = $this->json_utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF8) == 0xF0): - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3})); - $c += 3; - $utf16 = $this->json_utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFC) == 0xF8): - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4})); - $c += 4; - $utf16 = $this->json_utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFE) == 0xFC): - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4}), - ord($var{$c + 5})); - $c += 5; - $utf16 = $this->json_utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - } - } - - return '"'.$ascii.'"'; - - case 'array': - /* - * As per JSON spec if any array key is not an integer - * we must treat the the whole array as an object. We - * also try to catch a sparsely populated associative - * array with numeric keys here because some JS engines - * will create an array with empty indexes up to - * max_index which can cause memory issues and because - * the keys, which may be relevant, will be remapped - * otherwise. - * - * As per the ECMA and JSON specification an object may - * have any string as a property. Unfortunately due to - * a hole in the ECMA specification if the key is a - * ECMA reserved word or starts with a digit the - * parameter is only accessible using ECMAScript's - * bracket notation. - */ - - // treat as a JSON object - if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { - - $this->json_objectStack[] = $var; - - $properties = array_map(array($this, 'json_name_value'), - array_keys($var), - array_values($var)); - - array_pop($this->json_objectStack); - - foreach($properties as $property) { - if ($property instanceof Exception) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - } - - $this->json_objectStack[] = $var; - - // treat it like a regular array - $elements = array_map(array($this, 'json_encode'), $var); - - array_pop($this->json_objectStack); - - foreach($elements as $element) { - if ($element instanceof Exception) { - return $element; - } - } - - return '[' . join(',', $elements) . ']'; - - case 'object': - $vars = self::encodeObject($var); - - $this->json_objectStack[] = $var; - - $properties = array_map(array($this, 'json_name_value'), - array_keys($vars), - array_values($vars)); - - array_pop($this->json_objectStack); - - foreach($properties as $property) { - if ($property instanceof Exception) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - - default: - return null; - } - } - - /** - * array-walking function for use in generating JSON-formatted name-value pairs - * - * @param string $name name of key to use - * @param mixed $value reference to an array element to be encoded - * - * @return string JSON-formatted name-value pair, like '"name":value' - * @access private - */ - private function json_name_value($name, $value) - { - // Encoding the $GLOBALS PHP array causes an infinite loop - // if the recursion is not reset here as it contains - // a reference to itself. This is the only way I have come up - // with to stop infinite recursion in this case. - if ($name=='GLOBALS' - && is_array($value) - && array_key_exists('GLOBALS',$value)) { - $value['GLOBALS'] = '** Recursion **'; - } - - $encoded_value = $this->json_encode($value); - - if ($encoded_value instanceof Exception) { - return $encoded_value; - } - - return $this->json_encode(strval($name)) . ':' . $encoded_value; - } -} diff --git a/src/application/code/local/.placeholder b/src/application/code/local/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/src/application/configs/local.php.sample b/src/application/configs/local.php.sample deleted file mode 100644 index 94fa83f..0000000 --- a/src/application/configs/local.php.sample +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'resource' => array( - 'database' => array( - 'default' => array( - 'engine' => 'mysql', - 'options' => array( - ), - 'params' => array( - 'hostname' => 'localhost', - 'username' => 'root', - 'password' => '', - 'database' => 'db_wootook' - ), - 'table_prefix' => 'wtk_', - ), - ), - ), - ), - 'backend' => array( - 'web' => array( - 'url' => array( - 'base' => 'http://testing.wootook.org/', - 'skin' => 'http://testing.wootook.org/skin/', - 'js' => 'http://testing.wootook.org/js/', - 'css' => 'http://testing.wootook.org/css/', - ), - 'session' => array( - 'time' => 900, - 'domain' => 'testing.wootook.org', - 'path' => '/' - ) - ), - 'system' => array( - 'path' => array( - 'base' => ROOT_PATH, - 'skin' => ROOT_PATH . 'skin' . DIRECTORY_SEPARATOR, - ), - 'date' => array( - 'timezone' => 'Europe/Paris' - ), - ), - ), - 'frontend' => array( - 'web' => array( - 'url' => array( - 'base' => 'http://testing.wootook.org/', - 'skin' => 'http://testing.wootook.org/skin/', - 'js' => 'http://testing.wootook.org/js/', - 'css' => 'http://testing.wootook.org/css/', - ), - 'session' => array( - 'time' => 900, - 'domain' => 'testing.wootook.org', - 'path' => '/' - ) - ), - 'system' => array( - 'path' => array( - 'base' => ROOT_PATH, - 'skin' => ROOT_PATH . 'skin' . DIRECTORY_SEPARATOR, - ), - 'date' => array( - 'timezone' => 'Europe/Paris' - ), - ), - 'engine' => array( - 'storyline' => array( - 'universe' => 'legacies', - 'episode' => 'default', - ), - 'core' => array( - 'use_large_numbers' => true - ), - 'universe' => array( - 'galaxies' => 3, - 'systems' => 100, - 'positions' => 15 - ), - 'combat' => array( - 'allow_spy_drone_attacks' => true - ) - ), - ) - ); \ No newline at end of file diff --git a/src/application/configs/system.php b/src/application/configs/system.php deleted file mode 100644 index 8246cb4..0000000 --- a/src/application/configs/system.php +++ /dev/null @@ -1,72 +0,0 @@ - array( - 'resource' => array( - 'database' => array( - 'default' => array( - 'engine' => 'pdo_mysql', - 'options' => array( - ), - 'params' => array( - 'hostname' => 'localhost', - 'username' => 'root', - 'password' => '', - 'database' => 'db_wootook' - ), - 'table_prefix' => 'wtk_', - ), - 'core_setup' => array( - 'use' => 'default' - ), - 'core_read' => array( - 'use' => 'default' - ), - 'core_write' => array( - 'use' => 'default' - ), - ) - ) - ), - 'default' => array( - 'engine' => array( - 'core' => array( - 'use_large_numbers' => true, - ), - 'universe' => array( - 'galaxies' => 3, - 'systems' => 100, - 'positions' => 15, - ), - 'combat' => array( - 'allow_spy_drone_attacks' => true, - ) - ), - 'system' => array( - 'date' => array( - 'timezone' => 'Europe/Paris' - ), - ), - 'game' => array( - 'speed' => array( - 'general' => 1000, - 'ships' => 1000 - ), - 'home' => array( - 'title' => 'Welcome on Wootook!', - 'formated-welcome-text' => '

Wootook make you an emperor.

Conquer outer space and master other players on Wootook.

' - ) - ) - ), - 'frontend' => array( - 'layout' => array( - 'page' => 'page.xml', - 'player' => 'player.xml', - 'empire' => 'empire.xml' - ), - ), - 'backend' => array( - 'layout' => array( - 'page' => 'page.xml', - 'admin' => 'admin.php' - ), - ) - ); diff --git a/src/application/design/backend/base/default/layouts/admin.php b/src/application/design/backend/base/default/layouts/admin.php deleted file mode 100644 index ddac4e8..0000000 --- a/src/application/design/backend/base/default/layouts/admin.php +++ /dev/null @@ -1,283 +0,0 @@ - array( - 'update' => array('1column'), - 'reference' => array( - 'header' => array( - 'children' => array( - 'navigation' => array( - 'type' => 'core/html.navigation', - 'template' => 'page/html/navigation.phtml', - 'actions' => array( - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'system', - 'title' => 'System' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'system/overview', - 'label' => 'Overview', - 'title' => 'Overview', - 'uri' => 'admin/overview.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'system/settings', - 'label' => 'Settings', - 'title' => 'Settings', - 'uri' => 'admin/settings.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'system/reset-universe', - 'label' => 'Reset Universe', - 'title' => 'Reset Universe', - 'uri' => 'admin/XNovaResetUnivers.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'players', - 'title' => 'Player Accounts' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/list', - 'label' => 'List', - 'title' => 'List', - 'uri' => 'admin/userlist.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/password-recovery', - 'label' => 'Change a password', - 'title' => 'Change a password', - 'uri' => 'admin/md5changepass.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/search', - 'label' => 'Search', - 'title' => 'Search', - 'uri' => 'admin/paneladmina.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/multi-account-alerts', - 'label' => 'Multi account alerts', - 'title' => 'Multi account alerts', - 'uri' => 'admin/multi.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/declared-multi-account', - 'label' => 'Declared multi accounts', - 'title' => 'Declared multi accounts', - 'uri' => 'admin/declare_list.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/add-resources', - 'label' => 'Add Resources', - 'title' => 'Add Resources', - 'uri' => 'admin/add_money.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/messages', - 'label' => 'Private messages management', - 'title' => 'Private messages management', - 'uri' => 'admin/messagelist.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/chat', - 'label' => 'Manage Chat', - 'title' => 'Manage Chat', - 'uri' => 'chat.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/ban', - 'label' => 'Ban Player', - 'title' => 'Ban Player', - 'uri' => 'admin/banned.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'players/unban', - 'label' => 'Unban Player', - 'title' => 'Unban Player', - 'uri' => 'admin/unbanned.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'empire', - 'title' => 'Empires' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'empire/planet-list', - 'label' => 'Planet List', - 'title' => 'Planet List', - 'uri' => 'admin/planetlist.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'empire/moon-list', - 'label' => 'Moon List', - 'title' => 'Moon List', - 'uri' => 'admin/moonlist.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'empire/add-moon', - 'label' => 'Add a moon', - 'title' => 'Add a moon', - 'uri' => 'admin/add_moon.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'empire/planet-activity', - 'label' => 'Planet Activity', - 'title' => 'Planet Activity', - 'uri' => 'admin/activeplanet.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'empire/fleet-list', - 'label' => 'Fleet list', - 'title' => 'Fleet list', - 'uri' => 'admin/ShowFlyingFleets.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'tools', - 'title' => 'Tools' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/phpinfo', - 'label' => 'PHP Info', - 'title' => 'PHP Info', - 'uri' => 'variables.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/stats', - 'label' => 'Stats updater', - 'title' => 'Stats updater', - 'uri' => 'statbuilder.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/errors', - 'label' => 'Error reporting', - 'title' => 'Error reporting', - 'uri' => 'errors.php' - ) - ), - array( - 'method' => 'addExternalLink', - 'params' => array( - 'name' => 'tools/help', - 'label' => 'Need help?', - 'title' => 'Need help?', - 'url' => 'http://wootook.org/board/' - ) - ) - ) - ) - ) - ) - ) - ), - 'admin.grid' => array( - 'update' => array('admin'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'grid.container' => array( - 'type' => 'admin/grid.container', - 'template' => 'grid/container.phtml', - 'children' => array( - 'mass-actions' => array( - 'type' => 'admin/grid.mass-actions', - 'template' => 'grid/view.phtml', - ), - 'grid' => array( - 'type' => 'admin/grid.view', - 'template' => 'grid/view.phtml', - ) - ) - ) - ) - ) - ) - ), - 'admin.user.grid' => array( - 'update' => array('admin.grid'), - 'reference' => array( - 'grid' => array( - 'actions' => array( - array( - 'method' => 'addColumn', - 'params' => array( - 'name' => 'index', - 'type' => 'indexer', - 'config' => array() - ) - ) - ) - ) - ) - ) - ); diff --git a/src/application/design/backend/base/default/layouts/admin.xml b/src/application/design/backend/base/default/layouts/admin.xml deleted file mode 100644 index 18fde20..0000000 --- a/src/application/design/backend/base/default/layouts/admin.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - system - System - - - players - Player Accounts - - - - - diff --git a/src/application/design/backend/base/default/layouts/page.xml b/src/application/design/backend/base/default/layouts/page.xml deleted file mode 100644 index 6becaf2..0000000 --- a/src/application/design/backend/base/default/layouts/page.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - page/2columns-left.phtml - - - - - - - - - - page/2columns-right.phtml - - - - - - - - - - page/3columns.phtml - - - - - - - - - - css/base.css - - - css/deprecated/default.css - - - css/deprecated/formate.css - - - scripts/jquery/jquery-1.6.4.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/application/design/backend/base/default/scripts/deprecated/admin/overview_body.tpl b/src/application/design/backend/base/default/scripts/deprecated/admin/overview_body.tpl deleted file mode 100644 index f9220f0..0000000 --- a/src/application/design/backend/base/default/scripts/deprecated/admin/overview_body.tpl +++ /dev/null @@ -1,35 +0,0 @@ -

__('Overview')?>

- - - - - - - - -
__('General information')?>
__('Your version:')?>getData('version')?>__('Latest version avalaiable at Wootook.org')?>
- - - - - - - - - - - - - - - - - - - - - getData('adm_ov_data_table')?> - - - -
__('Online players')?>
getData('adm_ul_id')?>getData('adm_ul_name')?>getData('adm_ul_adip')?>getData('adm_ov_ally')?>getData('adm_ov_point')?>getData('adm_ov_activ')?>getData('usr_email')?>getData('xp_raid')?>getData('xp_min')?>getData('lang_vacancy')?>getData('banned_lang')?>getData('usr_current_planet')?>getData('usr_current_page')?>
getData('adm_ov_count')?>: getData('adm_ov_data_count')?>
diff --git a/src/application/design/backend/base/default/scripts/grid/container.phtml b/src/application/design/backend/base/default/scripts/grid/container.phtml deleted file mode 100644 index 7898192..0000000 --- a/src/application/design/backend/base/default/scripts/grid/container.phtml +++ /dev/null @@ -1 +0,0 @@ -a diff --git a/src/application/design/backend/base/default/scripts/page/1column.phtml b/src/application/design/backend/base/default/scripts/page/1column.phtml deleted file mode 100644 index ffaa1c8..0000000 --- a/src/application/design/backend/base/default/scripts/page/1column.phtml +++ /dev/null @@ -1,15 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
- content->render()?> -
-
- - diff --git a/src/application/design/backend/base/default/scripts/page/2columns-left.phtml b/src/application/design/backend/base/default/scripts/page/2columns-left.phtml deleted file mode 100644 index 2a5d895..0000000 --- a/src/application/design/backend/base/default/scripts/page/2columns-left.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
- left->render()?> -
-
- content->render()?> -
-
- - diff --git a/src/application/design/backend/base/default/scripts/page/2columns-right.phtml b/src/application/design/backend/base/default/scripts/page/2columns-right.phtml deleted file mode 100644 index 95fd758..0000000 --- a/src/application/design/backend/base/default/scripts/page/2columns-right.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
- content->render()?> -
-
- left->render()?> -
-
- - diff --git a/src/application/design/backend/base/default/scripts/page/3columns.phtml b/src/application/design/backend/base/default/scripts/page/3columns.phtml deleted file mode 100644 index 0611279..0000000 --- a/src/application/design/backend/base/default/scripts/page/3columns.phtml +++ /dev/null @@ -1,21 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
- left->render()?> -
-
- content->render()?> -
-
- left->render()?> -
-
- - diff --git a/src/application/design/backend/base/default/scripts/page/html/navigation.phtml b/src/application/design/backend/base/default/scripts/page/html/navigation.phtml deleted file mode 100644 index 612ee09..0000000 --- a/src/application/design/backend/base/default/scripts/page/html/navigation.phtml +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/src/application/design/backend/base/default/scripts/page/html/navigation/node.phtml b/src/application/design/backend/base/default/scripts/page/html/navigation/node.phtml deleted file mode 100644 index 266fae4..0000000 --- a/src/application/design/backend/base/default/scripts/page/html/navigation/node.phtml +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/src/application/design/frontend/base/default/layouts/empire.xml b/src/application/design/frontend/base/default/layouts/empire.xml deleted file mode 100644 index f18da5b..0000000 --- a/src/application/design/frontend/base/default/layouts/empire.xml +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - planet - Planet - - - universe - Universe - - - account - My Account - - - tools - Tools - - - community - Community - - - planet/overview - Overview - Overview - player/overview - - - planet/buildings - Buildings - Buildings - empire/buildings - - - planet/research-lab - Research Lab - Research Lab - legacies-empire/research-lab - - - planet/shipyard - Shipyard - Shipyard - legacies-empire/shipyard - - - planet/defenses - Defenses - Defenses - legacies-empire/defense - - - universe/galaxy - Check out the Galaxy - Check out the Galaxy - galaxy.php - - - universe/fleet - Send a Fleet - Send a Fleet - fleet.php - - - universe/retailer - Retailer - Retailer - marchand.php - - - universe/records - All Records - All Records - records.php - - - universe/statistics - My Stats - My Stats - stat.php - - - universe/search-player - Search a Player - Search a Player - search.php - - - universe/empire - Empire - Empire - imperium.php - - - account/alliance - My Alliance - My Alliance - alliance.php - - - account/messages - My Messages - My Messages - messages.php - - - account/resources - My Resources Production - My Resources Production - resources.php - - - account/tech-tree - Technology Tree - Technology Tree - techtree.php - - - tools/notes - Note Pad - Note Pad - notes.php - - - tools/options - Account Options - Account Options - options.php - - - tools/logout - Log Out - Log Out - player/account/logout - - - community/board - Forum board - Forum board - http://wootook.org/board/ - - - community/chat - Chat - Chat - chat.php - - - community/announcement - Announcements - Announcements - annonce.php - - - community/multi - Declare Multi-account - Declare Multi-account - delclare_multi.php - - - community/rules - Rules - Rules - rules.php - - - community/contact - Contact Admin - Contact Admin - contact.php - - - community/banned - Banned Players - Banned Players - banned.php - - - - - - - - - - - - - - - - - - - - - - - overview - - - - - - - - - - player/overview/fleet/item.phtml - - - empire/overview.fleet.list.item - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - empire/planet/buildings/queue/item.phtml - - - empire/planet.buildings.queue.item - - - - - - empire/planet/buildings/item.phtml - - - empire/planet.buildings.item - - - - - - - - - - - - - empire/planet/shipyard/queue/item.phtml - - - legacies-empire/planet.shipyard.queue.item - - - - - - empire/planet/shipyard/item.phtml - - - legacies-empire/planet.shipyard.item - - - - - - - - - - - - - - - - - - - - - - - empire/planet/research-lab/queue/item.phtml - - - legacies-empire/planet.research-lab.queue.item - - - - - - empire/planet/research-lab/item.phtml - - - legacies-empire/planet.research-lab.item - - - - - diff --git a/src/application/design/frontend/base/default/layouts/page.xml b/src/application/design/frontend/base/default/layouts/page.xml deleted file mode 100644 index b2975e7..0000000 --- a/src/application/design/frontend/base/default/layouts/page.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - page/2columns-left.phtml - - - - - - - - - - page/2columns-right.phtml - - - - - - - - - - page/3columns.phtml - - - - - - - - - - css/deprecated/default.css - - - css/deprecated/formate.css - - - css/base.css - - - scripts/jquery/jquery-1.6.4.js - - - Wootook! - - - - - - - - - - - public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Not Found - - - - - - - - - - home - - - public-form - - - - - - Welcome - - - - - - - - diff --git a/src/application/design/frontend/base/default/layouts/player.xml b/src/application/design/frontend/base/default/layouts/player.xml deleted file mode 100644 index 16bd812..0000000 --- a/src/application/design/frontend/base/default/layouts/player.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - login - - - public-form - - - - - - Log in - - - - - - - - - - - - - - - registration - - - public-form - - - - - - Register - - - - - - - - - - - - - - - lost-password - - - public-form - - - - - - Lost your password? - - - - - - - - diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws.tpl b/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws.tpl deleted file mode 100644 index b557fbf..0000000 --- a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws.tpl +++ /dev/null @@ -1,71 +0,0 @@ -
- - -getData('list')?> - - -
getData('Configure_laws')?>
- -
- -
- - - - - - - - - - - -
getData('Range_make')?>
getData('Range_name')?>
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
getData('Law_leyends')?>
getData('Alliance_dissolve')?>
getData('Expel_users')?>
getData('See_the_requests')?>
getData('See_the_list_members')?>
getData('Check_the_requests')?>
getData('Alliance_admin')?>
getData('See_the_online_list_member')?>
getData('Make_a_circular_message')?>
getData('Left_hand_text')?>
getData('Return_to_overview')?>
-
diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_head.tpl b/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_head.tpl deleted file mode 100644 index 9afc37c..0000000 --- a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_head.tpl +++ /dev/null @@ -1,15 +0,0 @@ -
-
- - - getData('Range_name')?> - - - - - - - - - - diff --git a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_row.tpl b/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_row.tpl deleted file mode 100644 index e1c8f57..0000000 --- a/src/application/design/frontend/base/default/scripts/deprecated/alliance_admin_laws_row.tpl +++ /dev/null @@ -1,21 +0,0 @@ - - - getData('a') > 0):?> - - <?php echo $this->__('Remove rank')?> - - - - - getData('r0')?> - getData('r1')?> - getData('r2')?> - getData('r3')?> - getData('r4')?> - getData('r5')?> - getData('r6')?> - getData('r7')?> - getData('r8')?> - getData('r9')?> - - \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/buildings.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/buildings.phtml deleted file mode 100644 index e2e2580..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/buildings.phtml +++ /dev/null @@ -1,28 +0,0 @@ -
-

__('Buildings')?>

- getPartial('item-list.items')->render()?> -
-
- \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/buildings/item.phtml deleted file mode 100644 index 1d3fb40..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/item.phtml +++ /dev/null @@ -1,36 +0,0 @@ - -
-
-

escape($this->getName())?>

-

__('Level %d', $this->renderNumber($this->getLevel()))?>

-
-
- - isBuildable()):?> -
-

__('Resources Needed')?>

-
- - - -
-

getDescription()?>

-
    - getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?> -
  • - getResourceName($resourceId)?> - renderNumber($resourceConfig->getData('value'))?> - hasData('requirement')):?> - (renderNumber($resourceConfig->getData('requirement'))?>) - - (renderNumber($resourceConfig->getData('overflow'))?>) - -
  • - -
-

__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), true))?> -

-
-
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue.phtml deleted file mode 100644 index 0549d6c..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue.phtml +++ /dev/null @@ -1,6 +0,0 @@ -isEmpty()):?> -
-

__('Work in progress')?>

-renderPartial('item-list') ?> -
- diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue/item.phtml deleted file mode 100644 index 827f75f..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/buildings/queue/item.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
-

- - escape($this->getName())?> (renderNumber($this->getItemQueuedLevel())?>) -

-

__('Lasts %s', $this->renderTime($this->getBuildingRemainingTime()))?>

- -
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab.phtml deleted file mode 100644 index d5a743a..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab.phtml +++ /dev/null @@ -1,19 +0,0 @@ -
-

__('Research Laboratory')?>

- getPartial('item-list.items')->render()?> -
-
- \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml deleted file mode 100644 index 552f840..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/item.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -
-
-

escape($this->getName())?>

-

__('Level %d', $this->renderNumber($this->getLevel()))?>

-
-
- - -
-

getDescription()?>

-
    - getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?> -
  • - getResourceName($resourceId)?> - renderNumber($resourceConfig->getData('value'))?> - hasData('requirement')):?> - (renderNumber($resourceConfig->getData('requirement'))?>) - - (renderNumber($resourceConfig->getData('overflow'))?>) - -
  • - -
-

__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), false))?> -

-
-
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml deleted file mode 100644 index ac60627..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/research-lab/queue/item.phtml +++ /dev/null @@ -1,11 +0,0 @@ - -
-

- - escape($this->getName())?> (renderNumber($this->getItemQueuedLevel())?>) -

-

__('Lasts %s', $this->renderTime($this->getBuildingRemainingTime()))?>

- -
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml deleted file mode 100644 index 6b75a1a..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard.phtml +++ /dev/null @@ -1,31 +0,0 @@ -
-

__('Shipyard')?>

- - getPartial('item-list.items')->render()?> - - -
- -
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml deleted file mode 100644 index ec6e2b0..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/item.phtml +++ /dev/null @@ -1,35 +0,0 @@ - -
-
-

escape($this->getName())?>

-

__('Class %s', $this->escape($this->getClass()))?>

-

__('Current count: %s', $this->renderNumber($this->getQty()))?>

-
-
- -
-

- -
- -
-

getDescription()?>

-
    - getResourcesConfigForQty(1) as $resourceId => $resourceConfig):?> -
  • - getResourceName($resourceId)?> - renderNumber($resourceConfig->getData('value'))?> - hasData('requirement')):?> - (renderNumber($resourceConfig->getData('requirement'))?>) - - (renderNumber($resourceConfig->getData('overflow'))?>) - -
  • - -
-

__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?> -

-
-
diff --git a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml b/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml deleted file mode 100644 index 5592945..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/planet/shipyard/queue/item.phtml +++ /dev/null @@ -1,8 +0,0 @@ - -
-

- - escape($this->getName())?> (renderNumber($this->getItemQueuedQty())?>) -

-

__('Lasts %s', $this->renderTime($this->getBuildingRemainingTime()))?>

-
diff --git a/src/application/design/frontend/base/default/scripts/empire/topnav.phtml b/src/application/design/frontend/base/default/scripts/empire/topnav.phtml deleted file mode 100644 index cd3877b..0000000 --- a/src/application/design/frontend/base/default/scripts/empire/topnav.phtml +++ /dev/null @@ -1,95 +0,0 @@ -getCurrentPlanet();?> -
-
-getPlanetCollection() as $planet):?> - getId() != $currentPlanet->getId()):?> - - -
-

escape($planet->getName())?>

-
- getMoon()) !== null): ?> - - - - - - - -
-

[escape($planet->getCoords())?>]

-
- - -
-
-
-
-
-
- <?php echo $this->__('Metal')?> -

- getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?> - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> - - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?> - -

-
-
- <?php echo $this->__('Cristal')?> -

- getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?> - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> - - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?> - -

-
-
- <?php echo $this->__('Deuterium')?> -

- getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?> - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> - - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?> - -

-
-
- <?php echo $this->__('Energy')?> -

- getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?> - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> - - renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?> - -

-
-
- <?php echo $this->__('Messages')?> -

- getCurrentPlayer()->getNewMessagesCount()) > 1):?> - __('%1$d messages.', $count)?> - - __('1 message.')?> - - __('No message.')?> - -

-
-
-
diff --git a/src/application/design/frontend/base/default/scripts/page/1column.phtml b/src/application/design/frontend/base/default/scripts/page/1column.phtml deleted file mode 100644 index ffaa1c8..0000000 --- a/src/application/design/frontend/base/default/scripts/page/1column.phtml +++ /dev/null @@ -1,15 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
- content->render()?> -
-
- - diff --git a/src/application/design/frontend/base/default/scripts/page/2columns-left.phtml b/src/application/design/frontend/base/default/scripts/page/2columns-left.phtml deleted file mode 100644 index c2a4134..0000000 --- a/src/application/design/frontend/base/default/scripts/page/2columns-left.phtml +++ /dev/null @@ -1,21 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
-
- left->render()?> -
-
- content->render()?> -
-
-
-
- - diff --git a/src/application/design/frontend/base/default/scripts/page/2columns-right.phtml b/src/application/design/frontend/base/default/scripts/page/2columns-right.phtml deleted file mode 100644 index 946e2c1..0000000 --- a/src/application/design/frontend/base/default/scripts/page/2columns-right.phtml +++ /dev/null @@ -1,21 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
-
- content->render()?> -
-
- left->render()?> -
-
-
-
- - diff --git a/src/application/design/frontend/base/default/scripts/page/3columns.phtml b/src/application/design/frontend/base/default/scripts/page/3columns.phtml deleted file mode 100644 index 1b1248a..0000000 --- a/src/application/design/frontend/base/default/scripts/page/3columns.phtml +++ /dev/null @@ -1,24 +0,0 @@ - - - head->render()?> - - getBodyClasses()):?> class="escape($classes)?>"> -
-
- header->render()?> -
-
-
- left->render()?> -
-
- content->render()?> -
-
- left->render()?> -
-
-
-
- - diff --git a/src/application/design/frontend/base/default/scripts/page/html/head.phtml b/src/application/design/frontend/base/default/scripts/page/html/head.phtml deleted file mode 100644 index cb74234..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/head.phtml +++ /dev/null @@ -1,34 +0,0 @@ -<?php echo $this->escape($this->getTitle())?> - -getCss() as $css):?> - - -getInlineCss() as $css):?> - - - -getJs() as $js):?> - - -getSkinJs() as $js):?> - - -getInlineJs() as $js):?> - - - \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/page/html/home.phtml b/src/application/design/frontend/base/default/scripts/page/html/home.phtml deleted file mode 100644 index 2970804..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/home.phtml +++ /dev/null @@ -1,7 +0,0 @@ - -getLayout()->getMessagesBlock()->renderGroupedHtml()?> -
-

getTitle()?>

-

getFormatedWelcomeText()?>

- -
diff --git a/src/application/design/frontend/base/default/scripts/page/html/message.phtml b/src/application/design/frontend/base/default/scripts/page/html/message.phtml deleted file mode 100644 index 1f3c4c9..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/message.phtml +++ /dev/null @@ -1,4 +0,0 @@ -
-

escape($this->getData('title'))?>

-

escape($this->getData('message'))?>

-
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/page/html/navigation.phtml b/src/application/design/frontend/base/default/scripts/page/html/navigation.phtml deleted file mode 100644 index 612ee09..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/navigation.phtml +++ /dev/null @@ -1,28 +0,0 @@ - diff --git a/src/application/design/frontend/base/default/scripts/page/html/navigation/link.phtml b/src/application/design/frontend/base/default/scripts/page/html/navigation/link.phtml deleted file mode 100644 index 4fa6fc8..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/navigation/link.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - getAttributes() as $attributeName => $attributeValue):?> ="">escape($this->getLabel())?> - diff --git a/src/application/design/frontend/base/default/scripts/page/html/navigation/node.phtml b/src/application/design/frontend/base/default/scripts/page/html/navigation/node.phtml deleted file mode 100644 index 266fae4..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/navigation/node.phtml +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/page/html/no-route.phtml b/src/application/design/frontend/base/default/scripts/page/html/no-route.phtml deleted file mode 100644 index 9a65c8b..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/no-route.phtml +++ /dev/null @@ -1,5 +0,0 @@ -
-

__('Not found')?>

-

__('The page you requested could not be found, please check your input.')?>

-

__('Back to the home page.')?>

-
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/page/html/top-bar.phtml b/src/application/design/frontend/base/default/scripts/page/html/top-bar.phtml deleted file mode 100644 index 8fffea9..0000000 --- a/src/application/design/frontend/base/default/scripts/page/html/top-bar.phtml +++ /dev/null @@ -1,14 +0,0 @@ -
-
- isLoggedIn()):?> - - __('Register')?> - __('There are %d registered players', $this->getPlayerCount())?> - - __('Logged in as %s', $this->escape($this->getPlayer()->getUsername()))?> - __('Logout')?> - __('Back to the game')?> - - __('There are %d online players', $this->getOnlinePlayerCount())?> -
-
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/player/login.phtml b/src/application/design/frontend/base/default/scripts/player/login.phtml deleted file mode 100644 index c4222de..0000000 --- a/src/application/design/frontend/base/default/scripts/player/login.phtml +++ /dev/null @@ -1,24 +0,0 @@ -getLayout()->getMessagesBlock()->renderGroupedHtml()?> -
-
- __('Login')?> -

- - -

-

- - -

-

- - -

-

- __('I have lost my password.')?> -

-
-

- -

-
diff --git a/src/application/design/frontend/base/default/scripts/player/lost-password.phtml b/src/application/design/frontend/base/default/scripts/player/lost-password.phtml deleted file mode 100644 index f44b287..0000000 --- a/src/application/design/frontend/base/default/scripts/player/lost-password.phtml +++ /dev/null @@ -1,17 +0,0 @@ -getLayout()->getMessagesBlock()->renderGroupedHtml()?> -
-
- __('Lost your password?')?> -

- - -

- -
-

- -

-
diff --git a/src/application/design/frontend/base/default/scripts/player/overview.phtml b/src/application/design/frontend/base/default/scripts/player/overview.phtml deleted file mode 100644 index 67eb785..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview.phtml +++ /dev/null @@ -1,11 +0,0 @@ -getLayout()->getMessagesBlock()->renderGroupedHtml()?> -
-

__('Overview')?>

-
- renderPartial('overview.left')?> -
-
- renderPartial('overview.center')?> -
-
-
diff --git a/src/application/design/frontend/base/default/scripts/player/overview/fleet/item.phtml b/src/application/design/frontend/base/default/scripts/player/overview/fleet/item.phtml deleted file mode 100644 index f66e128..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/fleet/item.phtml +++ /dev/null @@ -1,39 +0,0 @@ -
- renderDateTime($this->getStartTime())?> - renderDateTime($this->getActionTime())?> - renderDateTime($this->getArrivalTime())?> -
- getPlayer() ?> - isOwner() && ($this->isMission(Legacies_Empire::ID_MISSION_TRANSPORT) || $this->isMission(Legacies_Empire::ID_MISSION_STATION) || $this->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY))):?> - - __('An hostile fleet sent by %1$s, coming from %2$s[%3$s], reaches your planet %4$s[%5$s]. It has been sent with the mission: %6$s', - implode(', ', $this->getFleetOwnerUsernames()), - $this->getOriginPlanetName(), $this->getOriginPlanetCoords(), - $this->getDestinationPlanetName(), $this->getDestinationPlanetCoords(), - $this->getMissionLabel())?> - - isOwner() && ($this->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $this->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK) || $this->isMission(Legacies_Empire::ID_MISSION_DESTROY) || $this->isMission(Legacies_Empire::ID_MISSION_MISSILES) || $this->isMission(Legacies_Empire::ID_MISSION_SPY))):?> - - __('Your hostile fleet sent from %1$s[%2$s], reaches %3$s\'s planet %4$s[%5$s]. It has been sent with the mission: %6$s', - $this->getOriginPlanetName(), $this->getOriginPlanetCoords(), - implode(', ', $this->getFleetOwnerUsernames()), - $this->getDestinationPlanetName(), $this->getDestinationPlanetCoords(), - $this->getMissionLabel())?> - - isOwner()):?> - - __('Your peaceful fleet sent from %1$s[%2$s], reaches the planet %3$s[%4$s]. It has been sent with the mission: %5$s', - $this->getOriginPlanetName(), $this->getOriginPlanetCoords(), - $this->getDestinationPlanetName(), $this->getDestinationPlanetCoords(), - $this->getMissionLabel())?> - - - - __('A peaceful fleet sent by %1$s, coming from %2$s[%3$s], reaches the planet %4$s[%5$s]. It has been sent with the mission: %6$s', - implode(', ', $this->getFleetOwnerUsernames()), - $this->getOriginPlanetName(), $this->getOriginPlanetCoords(), - $this->getDestinationPlanetName(), $this->getDestinationPlanetCoords(), - $this->getMissionLabel())?> - -
-
diff --git a/src/application/design/frontend/base/default/scripts/player/overview/fleet/list.phtml b/src/application/design/frontend/base/default/scripts/player/overview/fleet/list.phtml deleted file mode 100644 index d5d0e4e..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/fleet/list.phtml +++ /dev/null @@ -1,9 +0,0 @@ -
-

__('Fleets') ?>

- getFleetCollection()?> - getSize() > 0): ?> - renderPartial('item-list')?> - -

__('There are currently no fleets.')?>

- -
diff --git a/src/application/design/frontend/base/default/scripts/player/overview/form/rename-planet.phtml b/src/application/design/frontend/base/default/scripts/player/overview/form/rename-planet.phtml deleted file mode 100644 index 94f0148..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/form/rename-planet.phtml +++ /dev/null @@ -1,16 +0,0 @@ -
-
- -

- - -

-

- - -

-

- -

-
-
\ No newline at end of file diff --git a/src/application/design/frontend/base/default/scripts/player/overview/planet/mini.phtml b/src/application/design/frontend/base/default/scripts/player/overview/planet/mini.phtml deleted file mode 100644 index c30fdda..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/planet/mini.phtml +++ /dev/null @@ -1,7 +0,0 @@ -
-

escape($this->getPlanetName())?>

-

escape($this->getPlanetCoords())?>

-

- -

-
diff --git a/src/application/design/frontend/base/default/scripts/player/overview/planet/view.phtml b/src/application/design/frontend/base/default/scripts/player/overview/planet/view.phtml deleted file mode 100644 index c4a724d..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/planet/view.phtml +++ /dev/null @@ -1 +0,0 @@ -renderPartial('planet-list') ?> diff --git a/src/application/design/frontend/base/default/scripts/player/overview/stats/mini.phtml b/src/application/design/frontend/base/default/scripts/player/overview/stats/mini.phtml deleted file mode 100644 index 6ca6d7d..0000000 --- a/src/application/design/frontend/base/default/scripts/player/overview/stats/mini.phtml +++ /dev/null @@ -1,8 +0,0 @@ -
-

__('Your statistics')?>

-
    - getPlayerStatData() as $stat): ?> -
  • - -
-
diff --git a/src/application/design/install/base/default/layouts/install.php b/src/application/design/install/base/default/layouts/install.php deleted file mode 100644 index 4778442..0000000 --- a/src/application/design/install/base/default/layouts/install.php +++ /dev/null @@ -1,165 +0,0 @@ - array( - 'update' => array('2columns-left'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'status' => array( - 'type' => 'core/template', - 'template' => 'status.phtml' - ) - ) - ) - ) - ), - - 'install.intro' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'intro.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 0 - ) - ) - ) - ) - ) - ), - - 'install.step.system' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'step/system.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 1 - ) - ) - ) - ) - ) - ), - - 'install.step.database' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'step/database.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 2 - ) - ) - ) - ) - ) - ), - - 'install.step.universe' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'step/universe.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 3 - ) - ) - ) - ) - ) - ), - - 'install.step.profile' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'step/profile.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 4 - ) - ) - ) - ) - ) - ), - - 'install.summary' => array( - 'update' => array('install'), - 'reference' => array( - 'content' => array( - 'children' => array( - 'overview' => array( - 'type' => 'core/template', - 'template' => 'summary.phtml' - ), - ) - ), - 'status' => array( - 'actions' => array( - array( - 'method' => 'setData', - 'params' => array( - 'key' => 'step', - 'value' => 5 - ) - ) - ) - ) - ) - ), - ); diff --git a/src/application/design/install/base/default/layouts/page.xml b/src/application/design/install/base/default/layouts/page.xml deleted file mode 100644 index e0837eb..0000000 --- a/src/application/design/install/base/default/layouts/page.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - page/2columns-left.phtml - - - - - - - - - - page/2columns-right.phtml - - - - - - - - - - page/3columns.phtml - - - - - - - - - - css/base.css - - - scripts/jquery/jquery-1.6.4.js - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/intro.phtml b/src/application/design/install/base/default/scripts/intro.phtml deleted file mode 100644 index 59beb4c..0000000 --- a/src/application/design/install/base/default/scripts/intro.phtml +++ /dev/null @@ -1,7 +0,0 @@ -
-

__('Welcome to the Wootook! installer')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -

__('This page will guide you through the installation proces of Wootook! the MMO game engine platform.')?>

-

__('Feel free to ask for help at any time at wootook.org.', 'http://wootook.org/board/')?>

-

-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/page/html/head.phtml b/src/application/design/install/base/default/scripts/page/html/head.phtml deleted file mode 100644 index b98b464..0000000 --- a/src/application/design/install/base/default/scripts/page/html/head.phtml +++ /dev/null @@ -1,26 +0,0 @@ -<?php echo $this->escape($this->getTitle())?> - -getCss() as $css):?> - - -getInlineCss() as $css):?> - - - -getJs() as $js):?> - - -getSkinJs() as $js):?> - - -getInlineJs() as $js):?> - - \ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/page/html/message.phtml b/src/application/design/install/base/default/scripts/page/html/message.phtml deleted file mode 100644 index 1f3c4c9..0000000 --- a/src/application/design/install/base/default/scripts/page/html/message.phtml +++ /dev/null @@ -1,4 +0,0 @@ -
-

escape($this->getData('title'))?>

-

escape($this->getData('message'))?>

-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/page/html/navigation/link.phtml b/src/application/design/install/base/default/scripts/page/html/navigation/link.phtml deleted file mode 100644 index 4fa6fc8..0000000 --- a/src/application/design/install/base/default/scripts/page/html/navigation/link.phtml +++ /dev/null @@ -1,3 +0,0 @@ - - getAttributes() as $attributeName => $attributeValue):?> ="">escape($this->getLabel())?> - diff --git a/src/application/design/install/base/default/scripts/status.phtml b/src/application/design/install/base/default/scripts/status.phtml deleted file mode 100644 index 89d29d3..0000000 --- a/src/application/design/install/base/default/scripts/status.phtml +++ /dev/null @@ -1,9 +0,0 @@ -
- getData('step')?> -

__('Welcome')?>

-

__('System')?>

-

__('Database')?>

-

__('Universe')?>

-

__('Admin profile')?>

-

__('Summary')?>

-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/step/database.phtml b/src/application/design/install/base/default/scripts/step/database.phtml deleted file mode 100644 index 7adaf52..0000000 --- a/src/application/design/install/base/default/scripts/step/database.phtml +++ /dev/null @@ -1,65 +0,0 @@ - -
-

__('Welcome to the Wootook! installer')?>

-

__('Database Config')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -
- -

- - -

-

- - -

-

- - -

-

- - -

-

- - -

-

- - -

-

- - -

-
-
-
- \ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/step/profile.phtml b/src/application/design/install/base/default/scripts/step/profile.phtml deleted file mode 100644 index b8cccf4..0000000 --- a/src/application/design/install/base/default/scripts/step/profile.phtml +++ /dev/null @@ -1,30 +0,0 @@ - -
-

__('Welcome to the Wootook! installer')?>

-

__('Admin Profile Config')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -
- -

- - -

-

- - -

-

- - -

-

- - -

-

- - -

-

-
-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/step/system.phtml b/src/application/design/install/base/default/scripts/step/system.phtml deleted file mode 100644 index 7978c32..0000000 --- a/src/application/design/install/base/default/scripts/step/system.phtml +++ /dev/null @@ -1,477 +0,0 @@ - -
-

__('Welcome to the Wootook! installer')?>

-

__('System Config')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -
- -

- - -

-

- - -

-

-
-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/step/universe.phtml b/src/application/design/install/base/default/scripts/step/universe.phtml deleted file mode 100644 index 9bcc975..0000000 --- a/src/application/design/install/base/default/scripts/step/universe.phtml +++ /dev/null @@ -1,37 +0,0 @@ - -
-

__('Welcome to the Wootook! installer')?>

-

__('Universe Config')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -
- -

- - -

-

- - -

-

- - -

-

- - getFormData('allow_spy_drone_attacks', true)):?>checked="checked" name="allow_spy_drone_attacks" value="1" /> -

-

- - - getFormData('use_large_numbers', true)):?>checked="checked" name="use_large_numbers" value="1" /> - - getFormData('use_large_numbers', false)):?>checked="checked" name="use_large_numbers" value="1" /> - __("'BC Math' extension is unavailable. This option will have no effect until the extension isn't active.")?> - -

-

- -

-
-
\ No newline at end of file diff --git a/src/application/design/install/base/default/scripts/summary.phtml b/src/application/design/install/base/default/scripts/summary.phtml deleted file mode 100644 index 662dfc3..0000000 --- a/src/application/design/install/base/default/scripts/summary.phtml +++ /dev/null @@ -1,7 +0,0 @@ -
-

__('Wootook! was successfully installed.')?>

- getLayout()->getMessagesblock()->renderGroupedHtml()?> -

__('You can now play at %s and tell your friends to come and play.', Wootook::getBaseUrl())?>

-

__('Feel free to ask for help at any time at wootook.org.', 'http://wootook.org/board/')?>

-

-
\ No newline at end of file diff --git a/src/application/gamedata/default/default/combat.php b/src/application/gamedata/default/default/combat.php deleted file mode 100644 index 8d931c7..0000000 --- a/src/application/gamedata/default/default/combat.php +++ /dev/null @@ -1 +0,0 @@ - array( - 'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'), - 'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block') - ) - ); \ No newline at end of file diff --git a/src/application/gamedata/default/default/prices.php b/src/application/gamedata/default/default/prices.php deleted file mode 100644 index dfd324f..0000000 --- a/src/application/gamedata/default/default/prices.php +++ /dev/null @@ -1,2 +0,0 @@ - array( - 'name' => 'Mine de métal', - 'description' => "

La mine de métal exploite les profondeurs géologiques à la recherche de ressources riches en métaux, puis les raffine et crée ensuite les alliages les plus solides.

Principales matières premières pour la construction de structures planétaires et de vaisseaux, les métaux permettent d'asseoir votre domination sur l'univers.

", - 'image' => 'medias/klore/images/building/metal-mine.jpg' - ), - - Legacies_Empire::ID_BUILDING_CRISTAL_MINE => array( - 'name' => 'Mine de cristal', - 'description' => "

La mine de cristal développe l'exploitation des minéraux entrant dans la comosition des systèmes électroniques.

Ces matériaux vous permettront d'augmenter la capacité de calculs de vos laboratoires ainsi que de ceux de vos systèmes de combat.

", - 'image' => 'medias/klore/images/building/cristal-mine.jpg' - ), - - Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => array( - 'name' => "Synthétiseur de deutérium", - 'description' => "

Le synthétiseur de deutérium permet d'exploiter les sources d'hydrogène lourd. Disponible en faible quantité sur les planètes telluriques et plus répandu sur les planètes géantes gazeuses, le deutérium et tritium composent votre principale source d'hydrogène lourd.

", - 'image' => 'medias/klore/images/building/deuterium-syntherizer.jpg' - ), - - Legacies_Empire::ID_BUILDING_SOLAR_PLANT => array( - 'name' => 'Centrale électrique solaire', - 'description' => "

La centrale électrique solaire est la source d'énergie la plus abordable.

", - 'image' => 'medias/klore/images/building/solar-plant.jpg' - ), - - Legacies_Empire::ID_BUILDING_FUSION_REACTOR => array( - 'name' => 'Réacteur à fusion nucléaire', - 'description' => "

Fruit de longues décénnies de recherche, le réacteur à fusion nucléaire est désormais une source d'énergie rentable.

Nourrie par l'énergie engendrée par la fusion des isotopes d'hydrogène, cette centrale génère plus d'énergie que toutes les autres sources d'énergie. La contrepartie à cette surgénération d'énergie, est son côut en deutérium.

", - 'image' => 'medias/klore/images/building/fusion-reactor.jpg' - ), - - Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY => array( - 'name' => 'Usine de robots', - 'description' => "

L'usine de robots permet à votre empire de se développer plus rapidement en accélarant la fabrication et l'évolution de vos structures.

", - 'image' => 'medias/klore/images/building/robotic-factory.jpg' - ), - - Legacies_Empire::ID_BUILDING_NANITE_FACTORY => array( - 'name' => 'Usine de nanites', - 'description' => "

Fruit de la recherche des nano-technologies, l'usine de nanites produit en masse nano-robots capable de s'assembler pour former vos futures structures.

", - 'image' => 'medias/klore/images/building/nanite-factory.jpg' - ), - - Legacies_Empire::ID_BUILDING_SHIPYARD => array( - 'name' => 'Chantier spatial', - 'description' => "

Elément central de la construction de vaisseaux spaciaux et de systèmes de défenses, le chantier spatial permettra à votre empire de s'étendre et d'asseaoir sa suprématie.

", - 'image' => 'medias/klore/images/building/shipyard.jpg' - ), - - Legacies_Empire::ID_BUILDING_METAL_STORAGE => array( - 'name' => 'Hangar de métal', - 'description' => '', - 'image' => 'medias/klore/images/building/metal-storage.jpg' - ), - - Legacies_Empire::ID_BUILDING_CRISTAL_STORAGE => array( - 'name' => 'Hangar de cristal', - 'description' => '', - 'image' => 'medias/klore/images/building/cristal-storage.jpg' - ), - - Legacies_Empire::ID_BUILDING_DEUTERIUM_TANK => array( - 'name' => 'Réservoir de deutérium', - 'description' => '', - 'image' => 'medias/klore/images/building/deuterium-tank.jpg' - ), - - Legacies_Empire::ID_BUILDING_RESEARCH_LAB => array( - 'name' => 'Laboratoire de recherche', - 'description' => '', - 'image' => 'medias/klore/images/building/research-lab.jpg' - ), - - Legacies_Empire::ID_BUILDING_TERRAFORMER => array( - 'name' => 'Terraformeur', - 'description' => '', - 'image' => 'medias/klore/images/building/terraformer.jpg' - ), - - Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT => array( - 'name' => 'Dépôt de ravitaillement', - 'description' => '', - 'image' => 'medias/klore/images/building/alliance-depot.jpg' - ), - - Legacies_Empire::ID_BUILDING_MISSILE_SILO => array( - 'name' => 'Silo de missiles', - 'description' => '', - 'image' => 'medias/klore/images/building/missile-silo.jpg' - ), -// }}} - -// -// Moon buildings labels -// {{{ - Legacies_Empire::ID_BUILDING_LUNAR_BASE => array( - 'name' => 'Base lunaire', - 'description' => '', - 'image' => 'medias/klore/images/ship/lunar-base.jpg' - ), - - Legacies_Empire::ID_BUILDING_SENSOR_PHALANX => array( - 'name' => 'Phalange de capteur', - 'description' => '', - 'image' => 'medias/klore/images/ship/sensor-phalanx.jpg' - ), - - Legacies_Empire::ID_BUILDING_JUMP_GATE => array( - 'name' => 'Porte de saut spatial', - 'description' => '', - 'image' => 'medias/klore/images/ship/jump-gate.jpg' - ), -// }}} - -// -// Technologies labels -// {{{ - Legacies_Empire::ID_RESEARCH_ESPIONAGE_TECHNOLOGY => array( - 'name' => 'Techniques d\'espionnage', - 'description' => '', - 'image' => 'medias/klore/images/technology/espionnage.jpg' - ), - - Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY => array( - 'name' => 'Recherche informatique', - 'description' => '', - 'image' => 'medias/klore/images/technology/computer.jpg' - ), - - Legacies_Empire::ID_RESEARCH_WEAPON_TECHNOLOGY => array( - 'name' => 'Technologies d\'armements', - 'description' => '', - 'image' => 'medias/klore/images/technology/weaponry.jpg' - ), - - Legacies_Empire::ID_RESEARCH_SHIELDING_TECHNOLOGY => array( - 'name' => 'Boucliers énergétiques', - 'description' => '', - 'image' => 'medias/klore/images/technology/shielding.jpg' - ), - - Legacies_Empire::ID_RESEARCH_ARMOUR_TECHNOLOGY => array( - 'name' => 'Structures spatiales', - 'description' => '', - 'image' => 'medias/klore/images/technology/armour.jpg' - ), - - Legacies_Empire::ID_RESEARCH_ENERGY_TECHNOLOGY => array( - 'name' => 'Nouvelles énergies', - 'description' => '', - 'image' => 'medias/klore/images/technology/energy.jpg' - ), - - Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY => array( - 'name' => 'Technologie hyperespace', - 'description' => '', - 'image' => 'medias/klore/images/technology/hyperspace-technology.jpg' - ), - - Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE => array( - 'name' => 'Propulsion à combustion', - 'description' => '', - 'image' => 'medias/klore/images/technology/combustion-drive.jpg' - ), - - Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE => array( - 'name' => 'Propulsion à impulsion', - 'description' => '', - 'image' => 'medias/klore/images/technology/impulse-drive.jpg' - ), - - Legacies_Empire::ID_RESEARCH_HYPERSPACE_DRIVE => array( - 'name' => 'Propulsion hyperespace', - 'description' => '', - 'image' => 'medias/klore/images/technology/hyperspace-drive.jpg' - ), - - Legacies_Empire::ID_RESEARCH_LASER_TECHNOLOGY => array( - 'name' => 'Propriétés laser', - 'description' => '', - 'image' => 'medias/klore/images/technology/laser.jpg' - ), - - Legacies_Empire::ID_RESEARCH_ION_TECHNOLOGY => array( - 'name' => 'Propriétés des ions', - 'description' => '', - 'image' => 'medias/klore/images/technology/ion.jpg' - ), - - Legacies_Empire::ID_RESEARCH_PLASMA_TECHNOLOGY => array( - 'name' => 'Propriétés des plasma', - 'description' => '', - 'image' => 'medias/klore/images/technology/plasma.jpg' - ), - - Legacies_Empire::ID_RESEARCH_INTERGALACTIC_RESEARCH_NETWORK => array( - 'name' => 'Réseau de recherche intergalactique', - 'description' => '', - 'image' => 'medias/klore/images/technology/intergalactic-research-network.jpg' - ), - - Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY => array( - 'name' => 'Technologie expéditions', - 'description' => '', - 'image' => 'medias/klore/images/technology/expedition.jpg' - ), - - Legacies_Empire::ID_RESEARCH_ORE_MINING => array( - 'name' => 'Exploitation minière', - 'description' => '', - 'image' => 'medias/klore/images/technology/ore-mining.jpg' - ), - - Legacies_Empire::ID_RESEARCH_GRAVITON_TECHNOLOGY => array( - 'name' => 'Graviton', - 'description' => '', - 'image' => 'medias/klore/images/technology/graviton.jpg' - ), -// }}} - -// -// Fleets labels -// {{{ - Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT => array( - 'name' => 'Transporteur T5', - 'class' => 'Etalon', - 'description' => '', - 'image' => 'medias/klore/images/ship/light-transport.jpg' - ), - - Legacies_Empire::ID_SHIP_LARGE_TRANSPORT => array( - 'name' => 'Transporteur T25', - 'class' => 'Buffle', - 'description' => '', - 'image' => 'medias/klore/images/ship/large-transport.jpg' - ), - - Legacies_Empire::ID_SHIP_LIGHT_FIGHTER => array( - 'name' => 'Chasseur C50', - 'class' => 'Guêpe', - 'description' => '', - 'image' => 'medias/klore/images/ship/light-fighter.jpg' - ), - - Legacies_Empire::ID_SHIP_HEAVY_FIGHTER => array( - 'name' => 'Chasseur C150', - 'class' => 'Frelon', - 'description' => '', - 'image' => 'medias/klore/images/ship/heavy-fighter.jpg' - ), - - Legacies_Empire::ID_SHIP_CRUISER => array( - 'name' => 'Croiseur V400', - 'class' => 'Aigle', - 'description' => '', - 'image' => 'medias/klore/images/ship/cruiser.jpg' - ), - - Legacies_Empire::ID_SHIP_BATTLESHIP => array( - 'name' => 'Vaisseau de bataille V1000', - 'class' => 'Faucon', - 'description' => '', - 'image' => 'medias/klore/images/ship/battleship.jpg' - ), - - Legacies_Empire::ID_SHIP_COLONY_SHIP => array( - 'name' => 'Vaisseau de colonisation', - 'class' => 'Romulus', - 'description' => '', - 'image' => 'medias/klore/images/ship/colony-ship.jpg' - ), - - Legacies_Empire::ID_SHIP_RECYCLER => array( - 'name' => 'Recycleur', - 'class' => 'Goule', - 'description' => '', - 'image' => 'medias/klore/images/ship/recycler.jpg' - ), - - Legacies_Empire::ID_SHIP_SPY_DRONE => array( - 'name' => 'Sonde d\'espionnage', - 'class' => 'Moustique', - 'description' => '', - 'image' => 'medias/klore/images/ship/spy-drone.jpg' - ), - - Legacies_Empire::ID_SHIP_BOMBER => array( - 'name' => 'Bombarider', - 'class' => 'Vengeur', - 'description' => '', - 'image' => 'medias/klore/images/ship/bomber.jpg' - ), - - Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => array( - 'name' => 'Satellite solaire', - 'class' => 'Râ', - 'description' => '', - 'image' => 'medias/klore/images/ship/solar-satellite.jpg' - ), - - Legacies_Empire::ID_SHIP_DESTRUCTOR => array( - 'name' => 'Vaisseau de bataille V2000', - 'class' => 'Destructeur', - 'description' => '', - 'image' => 'medias/klore/images/ship/destructor.jpg' - ), - - Legacies_Empire::ID_SHIP_DEATH_STAR => array( - 'name' => 'Vaisseau mère M1', - 'class' => 'Vengeur', - 'description' => '', - 'image' => 'medias/klore/images/ship/death-star.jpg' - ), - - Legacies_Empire::ID_SHIP_BATTLECRUISER => array( - 'name' => 'Vaisseau de bataille V700', - 'class' => 'Dragon', - 'description' => '', - 'image' => 'medias/klore/images/ship/battlecruiser.jpg' - ), - - Legacies_Empire::ID_SHIP_SUPERNOVA => array( - 'name' => 'Vaisseau mère M5', - 'class' => 'Annihilateur', - 'description' => '', - 'image' => 'medias/klore/images/ship/supernova.jpg' - ), - - Legacies_Empire::ID_SHIP_ORE_MININER => array( - 'name' => 'Vaisseau d\'exploitation', - 'class' => 'Onyx', - 'description' => '', - 'image' => 'medias/klore/images/ship/ore-miner.jpg' - ), -// }}} - -// -// Defenses labels -// {{{ - Legacies_Empire::ID_DEFENSE_ROCKET_LAUNCHER => array( - 'name' => 'Lance-missiles balistiques', - 'class' => 'Défenseur', - 'description' => '', - 'image' => 'medias/klore/images/defense/rocket-launcher.jpg' - ), - - Legacies_Empire::ID_DEFENSE_LIGHT_LASER => array( - 'name' => 'Artillerie laser légère', - 'class' => 'Lux', - 'description' => '', - 'image' => 'medias/klore/images/defense/light-laser.jpg' - ), - - Legacies_Empire::ID_DEFENSE_HEAVY_LASER => array( - 'name' => 'Artillerie laser lourde', - 'class' => 'Seraphin', - 'description' => '', - 'image' => 'medias/klore/images/defense/heavy-laser.jpg' - ), - - Legacies_Empire::ID_DEFENSE_ION_CANNON => array( - 'name' => 'Canon à ions', - 'class' => 'Découpeur', - 'description' => '', - 'image' => 'medias/klore/images/defense/ion-canon.jpg' - ), - - Legacies_Empire::ID_DEFENSE_GAUSS_CANNON => array( - 'name' => 'Canon à effet Gauss', - 'class' => 'Polaris', - 'description' => '', - 'image' => 'medias/klore/images/defense/gauss-canon.jpg' - ), - - Legacies_Empire::ID_DEFENSE_PLASMA_TURRET => array( - 'name' => 'Canon à plasma', - 'class' => 'Infernal', - 'description' => '', - 'image' => 'medias/klore/images/defense/plasma-turret.jpg' - ), - - Legacies_Empire::ID_DEFENSE_SMALL_SHIELD_DOME => array( - 'name' => 'Dôme bouclier', - 'class' => 'Sphere', - 'description' => '', - 'image' => 'medias/klore/images/defense/small-shield-dome.jpg' - ), - - Legacies_Empire::ID_DEFENSE_LARGE_SHIELD_DOME => array( - 'name' => 'Grand bouclier planétaire', - 'class' => 'Gaia', - 'description' => '', - 'image' => 'medias/klore/images/defense/large-shield-dome.jpg' - ), -// }}} - -// -// Special defenses labels -// {{{ - Legacies_Empire::ID_SPECIAL_ANTIBALLISTIC_MISSILE => array( - 'name' => 'Missile anti-balistique', - 'description' => '', - 'image' => 'medias/klore/images/defense/antiballistic-missile.jpg' - ), - - Legacies_Empire::ID_SPECIAL_INTERPLANETARY_MISSILE => array( - 'name' => 'Missile stratégique', - 'description' => '', - 'image' => 'medias/klore/images/defense/interplanetary-missile.jpg' - ) -// }}} -); diff --git a/src/application/gamedata/legacies/default/modules.php b/src/application/gamedata/legacies/default/modules.php deleted file mode 100644 index b00c84f..0000000 --- a/src/application/gamedata/legacies/default/modules.php +++ /dev/null @@ -1,10 +0,0 @@ - array( - 'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'), - 'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block'), - 'player' => array('Wootook_Player_Block_' => 'Wootook/Player/Block'), - 'legacies-core' => array('Legacies_Core_Block_' => 'Legacies/Core/Block'), - 'legacies-empire' => array('Legacies_Empire_Block_' => 'Legacies/Empire/Block'), - 'legacies-stats' => array('Legacies_Stats_Block_' => 'Legacies/Stats/Block') - ) - ); diff --git a/src/application/gamedata/legacies/default/production.php b/src/application/gamedata/legacies/default/production.php deleted file mode 100644 index 545dcde..0000000 --- a/src/application/gamedata/legacies/default/production.php +++ /dev/null @@ -1,18 +0,0 @@ - 'Legacies_Empire_Model_Planet_Building_MetalMine', - Legacies_Empire::ID_BUILDING_CRISTAL_MINE => 'Legacies_Empire_Model_Planet_Building_CristalMine', - Legacies_Empire::ID_BUILDING_DEUTERIUM_SYNTHETISER => 'Legacies_Empire_Model_Planet_Building_DeuteriumSynthetiser', - Legacies_Empire::ID_BUILDING_SOLAR_PLANT => 'Legacies_Empire_Model_Planet_Building_SolarPlant', - Legacies_Empire::ID_BUILDING_FUSION_REACTOR => 'Legacies_Empire_Model_Planet_Building_FusionReactor', -// }}} - -// -// Ships production -// {{{ - Legacies_Empire::ID_SHIP_SOLAR_SATELLITE => 'Legacies_Empire_Model_Planet_Ship_SolarSatellite', - Legacies_Empire::ID_SHIP_SUPERNOVA => 'Legacies_Empire_Model_Planet_Ship_Supernova' -// }}} - ); diff --git a/src/application/gamedata/legacies/version.php b/src/application/gamedata/legacies/version.php deleted file mode 100644 index 1b6f705..0000000 --- a/src/application/gamedata/legacies/version.php +++ /dev/null @@ -1,4 +0,0 @@ - '1.5.0', - 'Legacies_Empire' => '1.5.0', -); \ No newline at end of file diff --git a/src/application/locale/fr_FR/Legacies.csv b/src/application/locale/fr_FR/Legacies.csv deleted file mode 100644 index a19064b..0000000 --- a/src/application/locale/fr_FR/Legacies.csv +++ /dev/null @@ -1,39 +0,0 @@ -"Your session has expired, please login.","Votre session a expiré, veuillez vous reconnecter." -"Your username or credential is invalid, please check your input.","Votre nom d'utilisateur ou votre mot de passe n'est pas valide, veuillez vérifier votre saisie." -"No such user.","Cet utilisateur n'existe pas." -"You were banned, please contact admin for more information.","Vous ont été banni, veuillez contacter l'admin pour plus d'informations." -"You have 1 unread message.","Vous avez un message non lu." -"You have 1 new message.","Vous avez un nouveau message." -"You have no new message.","Vous n'avez pas de nouveau message." -"You have %1$d new messages","Vous avez %1$d nouveaux messages" -"You have %1$d unread messages.","Vous avez %1$d messages non lus." -"You have ""%1$d"" unread messages.","Vous avez ""%1$d"" messages non lus." -"No message.","Aucun message" -"1 messages.","Un message" -"%1$d messages.","%1$d messages." -"instantaneous","instantanné" -"Attack","Attaquer" -"Transport","Transporter" -"Station","Stationner" -"Settle","Coloniser" -"Recycle","Recycler" -"Destroy","Détruire" -"Missiles Launch","Attaque de missiles" -"Expedition","Expédition" -"Unknown","Inconnu" -"Planet is already destroyed","La planète est déjà détruite" -"Password:","Mot de passe :" -"I want to destroy this planet","Je confirme vouloir détruire cette planète" -"New name","Nouveau nom" -"Idle.","Inactif." -"Cancel","Annuler" -"Work in progress","Travail en cours" -"Buildings","Bâtiments" -"Research Laboratory","Laboratoire de recherches" -"Shipyard","Chantier spatial" -"Build","Construire" -"Metal","Métal" -"Cristal","Cristal" -"Deuterium","Deutérium" -"Energy","Energie" -"Messages","Messages" diff --git a/src/application/locale/fr_FR/Wootook_Core.csv b/src/application/locale/fr_FR/Wootook_Core.csv deleted file mode 100644 index 98a6fbf..0000000 --- a/src/application/locale/fr_FR/Wootook_Core.csv +++ /dev/null @@ -1,156 +0,0 @@ -"Game is disabled.","Le jeu est clos." -"%1$d day(s) and %2$d hour(s)","%1$d jour(s) et %2$d heure(s)" -"%1$d hour(s), %2$d minute(s) and %3$d second(s)","%1$d heure(s), %2$d minute(s) et %3$d seconde(s)" -"%1$d minute(s) and %2$d second(s)","%1$d minute(s) et %2$d seconde(s)" -"%1$d second(s)","%1$d seconde(s)" -"%1$d per minute","%1$d par minute" -"instantaneous","instantanné" -"Attack","Attaquer" -"Transport","Transporter" -"Station","Stationner" -"Settle","Coloniser" -"Recycle","Recycler" -"Destroy","Detruire" -"Missiles Launch","Envoi de missiles" -"Expedition","Expédition" -"Unknown","Inconnu" -"Planet is already destroyed.","La planète a déjà été détruite." -"Could not delete planet until fleets aten't retuned.","Impossible de détruire la planète tant que toutes les flottes ne sont pas revenues." -"You can't destroy your home planet.","Vous ne pouvez pas détruire votre planète mère." -"No such user.","Cet utilisateur n'existe pas." -"You were banned, please contact admin for more information.","Vous avez été banni. Veuillez contacter l'administrateur pour plus d'informations." -"Your username or credential is invalid, please check your input.","Votre nom d'utilisateur ou votre mot de passe sont invalides, veuillez vérifier votre saisie." -"My %s message!","My %s message!" -"An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d","Une flotte hostile envoyée par %1$s et prevenant de %2$s atteint votre planète %3$d. Sa mission est : %4$d." -"Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d","Votre flotte hostile envoyée depuis %1$s, atteint la planète de %2$d : %3$d. Sa mission est : %4$d" -"Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d","Votre flotte envoyée depuis %2$s, atteint la planète %3$d. Sa mission est : %4$d" -"A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d","Une flotte pacifique envoyée par %1$s et venant de %2$s atteint votre palnète %3$d. Sa mission est : %4$d" -"I want to destroy this planet","Je veux détruire cette planète." -"New name:","Nouveau nom:" -"You have 1 unread message.","Vous avez un message non lu." -"You have %1$d unread messages.","Vous avez %1$d messages non lus." -"Idle.","Inactif." -"Level %d","Niveau %d" -"Current count: %s","Disponible : %s" -"Build max (%s)","Construire le max (%s)" -"Build next level (%s)","Construire au niveau %s" -"Building time: %s","Temps de construction : %s" -"Lasts %s","Il reste %s" -"Cancel","Annuler" -"Work in progress","En cours..." -"Buildings","Bâtiments" -"Research Laboratory","Laboratoire de recherche" -"Shipyard","Chantier spatial" -"Build","Build" -"Metal","Métal" -"Cristal","Cristal" -"Deuterium","Deutérium" -"Energy","Energie" -"Messages","Messages" -"1 message.","Un message." -"You have no new message.","Vous n'avez pas de nouveau message." -"No message.","Pas de message." -"Username","Nom d'utilisateur" -"Password","Mot de passe" -"Remember me","Se souvenir de moi" -"Log in!","Connexion!" -"I have lost my password.","J'ai perdu mon mot de passe." -"Register","Créer un compte" -"Boards","Forum" -"Contact","Contact" -"Welcome on %s!","Bienvenue sur %s!" -"%1$s make you an emperor. Conquer outer space and master other players on %1$s.","%1$s fait de vous un empereur. Parcourez l'espace sidéral et conquérez les territoires d'autres joueurs sur %1$s." -"Register now!","S'enregistrer maintenant!" -"Player count: ","Nombre de joueurs : " -"Latest player: ","Dernier inscrit : " -"Online players: ","Joueurs en ligne : " -"User data:","Votre compte :" -"Username:","Nom d'empire :" -"Email:","Email :" -"Confirm email:","Confirmez l'email :" -"Password:","Mot de passe :" -"Confirm password:","Confirmez le mot de passe :" -"Planet:","Planète :" -"Planet name:","Nom de votre planète :" -"Register!","S'enregistrer!" -"Welcome to the Wootook! installer","Bienvenue sur l'installation de Wootook!" -"This page will guide you through the installation proces of Wootook! the MMO game engine platform.","Cette page vous guidera à travers le processus d'installation de Wootook! la plateforme de jeux web MMO." -"Feel free to ask for help at any time at wootook.org.","Feel free to ask for help at any time at wootook.org." -"Next step","Etape suivante" -"Welcome","Bienvenue" -"System","Système" -"Database","Base de données" -"Universe","Univers" -"Admin profile","Profil administrateur" -"Summary","Finalisation" -"Database Config","Configuration de votre base de données" -"Database host address:","Adresse du serveur :" -"Database host port:","Port du serveur :" -"Database account name:","Compte utilisateur:" -"Database account password:","Mot de passe :" -"Database name:","Nom de la base de données :" -"Table name prefix:","Préfixe des noms des tables :" -"Test connection","Tester la connexion" -"Connection succeeded.","Connexion réussie." -"Connection error: ","Erreur de connexion : " -"Admin Profile Config","Configuration du compte administrateur" -"Root admin account name:","Nom d'utilisateur :" -"Root admin email:","Email du compte administrateur :" -"Root admin account password:","Mot de passe :" -"Root admin account password confirm:","Confirmez le mot de passe :" -"System Config","Configuration système" -"Base URL path for the game:","URL de base Base du jeu :" -"Game timezone:","Fuseau horaire du jeu :" -"Africa","Afrique" -"America","Amerique" -"Atlantic","Atlantique" -"Asia","Asie" -"Europe","Europe" -"Pacific","Pacifique" -"Universe Config","configuration de l'univers" -"Galaxies count:","Nombre de galaxies :" -"Systems count:","Nombre de systèmes solaires :" -"Positions in each system:","Nombre de planètes dans chaque système solaire :" -"Allow spy drone attacks","Autoriser la attaques de sondes d'espionnage" -"Activate large numbers handling","Activer la gestion des très grands nombres" -"'BC Math' extension is unavailable. This option will have no effect until the extension isn't active.","L'extension PHP 'BC Math' est indisponible sur votre machine. Cette option n'aura aucun effet tant que l'extension ne sera pas activée." -"Wootook! was successfully installed.","Wootook! a été correctmeent installé." -"You can now play at %s and tell your friends to come and play.","Vous pouvez maintenant jouer sur %s et dire à vos amis de venir." -"Feel free to ask for help at any time at wootook.org.","Feel free to ask for help at any time at wootook.org." -"Play!","Jouer!" -"Shipyard is required","Le chantier spatial est requis" -"In order to build ships you will need to build a shipyard building.","Pour construire des vaisseaux, vous devrez construire un chantier spatial." -"Research lab is required","Le laboratoire de recherche est requis" -"In order to do technological researches, you will need to build a research lab building.","Pour effectuer des recherches de nouvelles technologies, vous devrez construire un laboratoire de recherches." -"Unnamed","Sans nom" -"Name","Nom" -"Galaxy","Galaxie" -"System","Système" -"Planet","Planète" -"Debris","Débris" -"Moon","Lune" -"Reset","Réinitialiser" -"Save","Sauvegarder" -"The shortcut has been saved.","Le raccourci a été enregistré." -"The shortcut has been deleted","Le raccourdi a été supprimé" -"The shortcut has been updated.","Le raccourci a été mis à jour." -"Success","Succès" -"Colony","Colonie" -"Moon","Lune" -"Class %s","Classe %s" -"Build","Construire" -"Game data successfully initialized.","Game data successfully initialized." -"Passwords does not match.","Les mots de passe ne correpsondent pas." -"Both e-mails does not match.","Les emails ne correpsondent pas." -"Could not create user.","Impossible de créer le compte d'utilisateur." -"Could not set to vacation mode.","Impossible d'activer le mode vacances." -"You currently can't get to vacation mode, please check your flying fleets, and building queues.","You currently can't get to vacation mode, please check your flying fleets, and building queues." -"Password was not correct.","Le mot de passe est incorrect." -"Planet has been successfully destroyed.","LA planète a été détruite." -"Open the chat.","Ouvrir le chat." -"No root view declared.","Aucune vue racine n'est déclarée." -"Query failed: SQLSTATE %s: %s.","La requête a échoué : SQLSTATE %s: %s." -"Undefined method %s::%s.","La méthode %s::%s est inconnue." -"Ajax failure.","Erreur AJAX." -"Invalid security key.","code de sécurité invalide." -"Form data error.","données de formulaire erronnées." diff --git a/src/application/test/translate.csv b/src/application/test/translate.csv deleted file mode 100644 index a873711..0000000 --- a/src/application/test/translate.csv +++ /dev/null @@ -1,154 +0,0 @@ -"Game is disabled.","Le jeu est clos." -"%1$d day(s) and %2$d hour(s)","%1$d jour(s) et %2$d heure(s)" -"%1$d hour(s), %2$d minute(s) and %3$d second(s)","%1$d heure(s), %2$d minute(s) et %3$d seconde(s)" -"%1$d minute(s) and %2$d second(s)","%1$d minute(s) et %2$d seconde(s)" -"%1$d second(s)","%1$d seconde(s)" -"%1$d per minute","%1$d par minute" -"instantaneous","instantanné" -"Attack","Attaquer" -"Transport","Transporter" -"Station","Stationner" -"Settle","Coloniser" -"Recycle","Recycler" -"Destroy","Detruire" -"Missiles Launch","Envoi de missiles" -"Expedition","Expédition" -"Unknown","Inconnu" -"Planet is already destroyed.","La planète a déjà été détruite." -"Could not delete planet until fleets aten't retuned.","Impossible de détruire la planète tant que toutes les flottes ne sont pas revenues." -"You can't destroy your home planet.","Vous ne pouvez pas détruire votre planète mère." -"No such user.","Cet utilisateur n'existe pas." -"You were banned, please contact admin for more information.","Vous avez été banni. Veuillez contacter l'administrateur pour plus d'informations." -"Your username or credential is invalid, please check your input.","Votre nom d'utilisateur ou votre mot de passe sont invalides, veuillez vérifier votre saisie." -"My %s message!","My %s message!" -"An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d","Une flotte hostile envoyée par %1$s et prevenant de %2$s atteint votre planète %3$d. Sa mission est : %4$d." -"Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d","Votre flotte hostile envoyée depuis %1$s, atteint la planète de %2$d : %3$d. Sa mission est : %4$d" -"Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d","Votre flotte envoyée depuis %2$s, atteint la planète %3$d. Sa mission est : %4$d" -"A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d","Une flotte pacifique envoyée par %1$s et venant de %2$s atteint votre palnète %3$d. Sa mission est : %4$d" -"I want to destroy this planet","Je veux détruire cette planète." -"New name:","Nouveau nom:" -"You have 1 unread message.","Vous avez un message non lu." -"You have %1$d unread messages.","Vous avez %1$d messages non lus." -"Idle.","Inactif." -"Level %d","Niveau %d" -"Current count: %s","Quantité actuelle : %s" -"Build max (%s)","Construire le max (%s)" -"Build next level (%s)","Construire le niveau suivant (%s)" -"Building time: %s","Temps de construction : %s" -"Lasts %s","Il reste %s" -"Cancel","Annuler" -"Work in progress","En cours..." -"Buildings","Bâtiments" -"Research Laboratory","Laboratoire de recherche" -"Shipyard","Chantier spatial" -"Build","Build" -"Metal","Métal" -"Cristal","Cristal" -"Deuterium","Deutérium" -"Energy","Energie" -"Messages","Messages" -"1 message.","Un message." -"You have no new message.","Vous n'avez pas de nouveau message." -"No message.","Pas de message." -"Username","Nom d'utilisateur" -"Password","Mot de passe" -"Remember me","Se souvenir de moi" -"Log in!","Connexion!" -"I have lost my password.","J'ai perdu mon mot de passe." -"Register","Créer un compte" -"Boards","Forum" -"Contact","Contact" -"Welcome on %s!","Bienvenue sur %s!" -"%1$s make you an emperor. Conquer outer space and master other players on %1$s.","%1$s fait de vous un empereur. Parcourez l'espace sidéral et conquérez les territoires d'autres joueurs sur %1$s." -"Register now!","S'enregistrer maintenant!" -"Player count: ","Nombre de joueurs : " -"Latest player: ","Dernier inscrit : " -"Online players: ","Joueurs en ligne : " -"User data:","Votre compte :" -"Username:","Nom d'empire :" -"Email:","Email :" -"Confirm email:","Confirmez l'email :" -"Password:","Mot de passe :" -"Confirm password:","Confirmez le mot de passe :" -"Planet:","Planète :" -"Planet name:","Nom de votre planète :" -"Register!","S'enregistrer!" -"Welcome to the Wootook! installer","Bienvenue sur l'installation de Wootook!" -"This page will guide you through the installation proces of Wootook! the MMO game engine platform.","Cette page vous guidera à travers le processus d'installation de Wootook! la plateforme de jeux web MMO." -"Feel free to ask for help at any time at wootook.org.","Feel free to ask for help at any time at wootook.org." -"Next step","Etape suivante" -"Welcome","Bienvenue" -"System","Système" -"Database","Base de données" -"Universe","Univers" -"Admin profile","Compte Admin" -"Summary","Finalisation" -"Database Config","Configuration de votre base de données" -"Database host address:","Adresse du serveur :" -"Database host port:","Port du serveur :" -"Database account name:","Compte utilisateur:" -"Database account password:","Mot de passe :" -"Database name:","Nom de la base de données :" -"Table name prefix:","Préfixe des noms des tables :" -"Test connection","Tester la connexion" -"Connection succeeded.","Connexion réussie." -"Connection error: ","Erreur de connexion : " -"Admin Profile Config","Configuration du compte administrateur" -"Root admin account name:","Nom d'utilisateur :" -"Root admin email:","Email du compte administrateur :" -"Root admin account password:","Mot de passe :" -"Root admin account password confirm:","Confirmez le mot de passe :" -"System Config","Configuration système" -"Base URL path for the game:","URL de base Base du jeu :" -"Game timezone:","Fuseau horaire du jeu :" -"Africa","Afrique" -"America","Amerique" -"Atlantic","Atlantique" -"Asia","Asie" -"Europe","Europe" -"Pacific","Pacifique" -"Universe Config","configuration de l'univers" -"Galaxies count:","Nombre de galaxies :" -"Systems count:","Nombre de systèmes solaires :" -"Positions in each system:","Nombre de planètes dans chaque système solaire :" -"Allow spy drone attacks","Autoriser la attaques de sondes d'espionnage" -"Activate large numbers handling","Activer la gestion des très grands nombres" -"'BC Math' extension is unavailable. This option will have no effect until the extension isn't active.","L'extension PHP 'BC Math' est indisponible sur votre machine. Cette option n'aura aucun effet tant que l'extension ne sera pas activée." -"Wootook! was successfully installed.","Wootook! a été correctmeent installé." -"You can now play at %s and tell your friends to come and play.","Vous pouvez maintenant jouer sur %s et dire à vos amis de venir." -"Feel free to ask for help at any time at wootook.org.","Feel free to ask for help at any time at wootook.org." -"Play!","Jouer!" -"Shipyard is required","Le chantier spatial est requis" -"In order to build ships you will need to build a shipyard building.","Pour construire des vaisseaux, vous devrez construire un chantier spatial." -"Research lab is required","Le laboratoire de recherche est requis" -"In order to do technological researches, you will need to build a research lab building.","Pour effectuer des recherches de nouvelles technologies, vous devrez construire un laboratoire de recherches." -"Unnamed","Sans nom" -"Name","Nom" -"Galaxy","Galaxie" -"System","Système" -"Planet","Planète" -"Debris","Débris" -"Moon","Lune" -"Reset","Réinitialiser" -"Save","Sauvegarder" -"The shortcut has been saved.","Le raccourci a été enregistré." -"The shortcut has been deleted","Le raccourdi a été supprimé" -"The shortcut has been updated.","Le raccourci a été mis à jour." -"Success","Succès" -"Colony","Colonie" -"Moon","Lune" -"Game data successfully initialized.","Game data successfully initialized." -"Passwords does not match.","Les mots de passe ne correpsondent pas." -"Both e-mails does not match.","Les emails ne correpsondent pas." -"Could not create user.","Impossible de créer le compte d'utilisateur." -"Could not set to vacation mode.","Impossible d'activer le mode vacances." -"You currently can't get to vacation mode, please check your flying fleets, and building queues.","You currently can't get to vacation mode, please check your flying fleets, and building queues." -"Password was not correct.","Le mot de passe est incorrect." -"Planet has been successfully destroyed.","LA planète a été détruite." -"Open the chat.","Ouvrir le chat." -"No root view declared.","Aucune vue racine n'est déclarée." -"Query failed: SQLSTATE %s: %s.","La requête a échoué : SQLSTATE %s: %s." -"Undefined method %s::%s.","La méthode %s::%s est inconnue." -"Ajax failure.","Erreur AJAX." -"Invalid security key.","code de sécurité invalide." -"Form data error.","données de formulaire erronnées." diff --git a/src/application/test/translate2.txt b/src/application/test/translate2.txt deleted file mode 100644 index 6731a74..0000000 Binary files a/src/application/test/translate2.txt and /dev/null differ diff --git a/src/fleetback.php b/src/fleetback.php deleted file mode 100644 index 4075674..0000000 --- a/src/fleetback.php +++ /dev/null @@ -1,77 +0,0 @@ - -Website: http://project.galacticnova.vinilox.eu/ -Last revision: 13/07/11 - -*/ - -define('INSIDE' , true); -define('INSTALL' , false); -require_once dirname(__FILE__) .'/application/bootstrap.php'; -includeLang('fleet'); - -$BoxTitle = $lang['fl_error']; -$TxtColor = "red"; -$BoxMessage = $lang['fl_notback']; -if (isset($_POST['fleetid']) && is_numeric($_POST['fleetid'])) { - $fleetid = intval($_POST['fleetid']); - - $readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write'); - $FleetRow = $readAdapter->select() - ->from(array('fleet' => $readAdapter->getTable('fleets'))) - ->where('fleet_id', $fleetid) - ->prepare() - ->fetch() - ; - $i = 0; - - if ($FleetRow['fleet_owner'] == $user['id']) { - if ($FleetRow['fleet_mess'] == 0 || $FleetRow['fleet_mess'] == 2) { - if ($FleetRow['fleet_end_stay'] != 0) { - // Faut calculer le temps reel de retour - if ($FleetRow['fleet_start_time'] > time()) { - // On a pas encore entamé le stationnement - // Il faut calculer la parcelle de temps ecoulée depuis le lancement de la flotte - $CurrentFlyingTime = time() - $FleetRow['start_time']; - } else { - // On est deja en stationnement - // Il faut donc directement calculer la durée d'un vol aller ou retour - $CurrentFlyingTime = $FleetRow['fleet_start_time'] - $FleetRow['start_time']; - } - } else { - // C'est quoi le stationnement ?? - // On calcule sagement la parcelle de temps ecoulée depuis le depart - $CurrentFlyingTime = time() - $FleetRow['start_time']; - } - $ReturnFlyingTime = $CurrentFlyingTime + time(); - - $writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write'); - $writeAdapter->update() - ->into($writeAdapter->getTable('fleets')) - ->set('fleet_start_time', time()) - ->set('fleet_end_stay', 0) - ->set('fleet_end_time', $ReturnFlyingTime) - ->set('fleet_target_owner', $user->getId()) - ->set('fleet_mess', 1) - ->where('fleet_id', $fleetid) - ->execute() - ; - - $BoxTitle = $lang['fl_sback']; - $TxtColor = "lime"; - $BoxMessage = $lang['fl_isback']; - } elseif ($FleetRow['fleet_mess'] == 1) { - $BoxMessage = $lang['fl_notback']; - } - } else { - $BoxMessage = $lang['fl_onlyyours']; - } -} - -message ($BoxMessage, $BoxTitle, "fleet.". PHPEXT, 2); diff --git a/src/fleetshortcut.php b/src/fleetshortcut.php deleted file mode 100644 index 016de90..0000000 --- a/src/fleetshortcut.php +++ /dev/null @@ -1,208 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -define('INSIDE' , true); -define('INSTALL' , false); -require_once dirname(__FILE__) .'/application/bootstrap.php'; - - -$mode = isset($_GET['mode']) ? $_GET['mode'] : null; -$a = isset($_GET['a']) ? $_GET['a'] : null; - -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - -if ($mode) { - if ($_POST) { - //Pegamos el texto :P - if (!isset($_POST["n"]) || empty($_POST["n"])) { - $name = Wootook::__("Unnamed"); - } else { - $name = $_POST["n"]; - } - - if (($offset = strpos($name, "\n")) !== false) { - $name = substr($name, 0, $offset); - } - if (($offset = strpos($name, "\r")) !== false) { - $name = substr($name, 0, $offset); - } - if (($offset = strpos($name, ",")) !== false) { - $name = substr($name, 0, $offset); - } - $planetTypes = array( - Wootook_Empire_Model_Planet::TYPE_PLANET, - Wootook_Empire_Model_Planet::TYPE_DEBRIS, - Wootook_Empire_Model_Planet::TYPE_MOON - ); - - $r = array(); - $r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name); - $r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= Wootook::getGameConfig('engine/universe/galaxies')) ? intval($_POST['g']) : '1'; - $r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= Wootook::getGameConfig('engine/universe/systems')) ? intval($_POST['s']) : '1'; - $r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= Wootook::getGameConfig('engine/universe/positions')) ? intval($_POST['p']) : '1'; - $r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : '1'; - - $user['fleet_shortcut'] .= implode(",", $r); - $user->save(); - message(Wootook::__("The shortcut has been saved."), Wootook::__("Success"), "fleetshortcut.php"); - } - $page = "
- - - - "; - $page .= '
Nom [Galaxie/Système solaire/Planète]
- - - - - -
"; - //Muestra un (L) si el destino pertenece a luna, lo mismo para escombros - $page .= "
Effacer
'; -} else if ($a !== null) { - if ($_POST) { - //Armamos el array... - $scarray = explode("\r\n", $user['fleet_shortcut']); - if (isset($_POST["delete"])) { - unset($scarray[$a]); - $user['fleet_shortcut'] = implode("\r\n", $scarray); - doquery("UPDATE {{table}} SET fleet_shortcut={$db->quote($user['fleet_shortcut'])} WHERE id={$user['id']}", "users"); - message(Wootook::__("The shortcut has been deleted"), Wootook::__("Success"), "fleetshortcut.php"); - } else { - $r = explode(",", $scarray[$a]); - if (!isset($_POST["n"]) || empty($_POST["n"])) { - $name = $r[0]; - } else { - $name = $_POST["n"]; - } - - if (($offset = strpos($name, "\n")) !== false) { - $name = substr($name, 0, $offset); - } - if (($offset = strpos($name, "\r")) !== false) { - $name = substr($name, 0, $offset); - } - if (($offset = strpos($name, ",")) !== false) { - $name = substr($name, 0, $offset); - } - $planetTypes = array( - Wootook_Empire_Model_Planet::TYPE_PLANET, - Wootook_Empire_Model_Planet::TYPE_DEBRIS, - Wootook_Empire_Model_Planet::TYPE_MOON - ); - $r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name); - $r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= Wootook::getGameConfig('engine/universe/galaxies')) ? intval($_POST['g']) : $r[1]; - $r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= Wootook::getGameConfig('engine/universe/systems')) ? intval($_POST['s']) : $r[2]; - $r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= Wootook::getGameConfig('engine/universe/positions')) ? intval($_POST['p']) : $r[3]; - $r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : $r[4]; - - $scarray[$a] = implode(",", $r); - $user['fleet_shortcut'] = implode("\r\n", $scarray); - $user->save(); - message(Wootook::__("The shortcut has been updated."), Wootook::__("Success"), "fleetshortcut.php"); - } - } - - if ($user['fleet_shortcut']) { - - $scarray = explode("\r\n",$user['fleet_shortcut']); - $c = explode(',',$scarray[$a]); - - $page = "
- - - "; - //if($i==0){$page .= "";} - $page .= " - "; - - } else { - $page .= message("Le raccourcis a été enregistré !","Enregistrer","fleetshortcut.php"); - } - - $page .= '
Editer: {$c[0]} [{$c[1]}:{$c[2]}:{$c[3]}]
- - - - - - -
"; - $page .= "
Retour
'; - - -} else { - - $page = ' - - - '; - - if($user['fleet_shortcut']){ - /* - Dentro de fleet_shortcut, se pueden almacenar las diferentes direcciones - de acceso directo, el formato es el siguiente. - Nombre, Galaxia,Sistema,Planeta,Tipo - */ - $scarray = explode("\r\n",$user['fleet_shortcut']); - $i=$e=0; - foreach($scarray as $a => $b){ - if($b!=""){ - $c = explode(',',$b); - if($i==0){$page .= "";} - $page .= ""; - if($i==1){$page .= "";} - if($i==1){$i=0;}else{$i=1;} - } - - } - if($i==1){$page .= "";} - - }else{$page .= "";} - - $page .= '
Raccourcis(Ajout)
"; - $page .= "{$c[0]} {$c[1]}:{$c[2]}:{$c[3]}"; - //Muestra un (L) si el destino pertenece a luna, lo mismo para escombros - if($c[4]==2){$page .= " (E)";}elseif($c[4]==3){$page .= " (L)";} - $page .= "
Pas de Raccourcis
Retour
'; -} -display($page,"Shortcutmanager"); - -// Created by Perberos. All rights reversed (C) 2006 -?> diff --git a/src/floten3.php b/src/floten3.php deleted file mode 100644 index 23f3985..0000000 --- a/src/floten3.php +++ /dev/null @@ -1,508 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -define('INSIDE' , true); -define('INSTALL' , false); -require_once dirname(__FILE__) .'/application/bootstrap.php'; - -includeLang('fleet'); - -$session = Wootook::getSession('fleet'); - -$user = Wootook_Player_Model_Session::getSingleton()->getPlayer(); -$planet = $user->getCurrentPlanet(); - -$mission = isset($_POST['mission']) ? intval($_POST['mission']) : 0; -$galaxy = isset($session['galaxy']) ? $session['galaxy'] : 0; -$system = isset($session['system']) ? $session['system'] : 0; -$position = isset($session['position']) ? $session['position'] : 0; -$type = isset($session['type']) ? $session['type'] : 0; -$speed = isset($session['speed']) ? $session['speed'] : 10; - -$protection = Wootook::getGameConfig('game/noob-protection/active'); -$protectionPointsCap = Wootook::getGameConfig('game/noob-protection/points-cap'); -$protectionMultiplier = Wootook::getGameConfig('game/noob-protection/multiplier'); - -$readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection('core_read'); -$writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton() - ->getConnection('core_write'); - -if ($protectionPointsCap < 1) { - $protectionPointsCap = 0x7FFFFFFF; -} - -$fleetArray = $session['fleet']; - -if (!is_array($fleetArray)) { - message($lang['fl_fleet_err'], $lang['fl_error'], "fleet.php", 2); -} - -// On verifie s'il y a assez de vaisseaux sur la planete ! -foreach ($fleetArray as $shipId => $count) { - if ($count > $planet->getElement($shipId)) { - message($lang['fl_fleet_err'], $lang['fl_error'], "fleet.php", 2); - } -} - -$allowedPlanetTypes = array( - Wootook_Empire_Model_Planet::TYPE_PLANET, - Wootook_Empire_Model_Planet::TYPE_DEBRIS, - Wootook_Empire_Model_Planet::TYPE_MOON - ); -if (!in_array($type, $allowedPlanetTypes)) { - message($lang['fl_fleet_err_pl'], $lang['fl_error'], "fleet.php", 2); -} - -if ($planet->getGalaxy() == $galaxy && - $planet->getSystem() == $system && - $planet->getPosition() == $position && - $planet->getType() == $type) { - message($lang['fl_ownpl_err'], $lang['fl_error'], "fleet.php", 2); -} - -$YourPlanet = false; -$UsedPlanet = false; -$coords = array( - 'galaxy' => $galaxy, - 'system' => $system, - 'position' => $position - ); -if ($mission == Legacies_Empire::ID_MISSION_RECYCLE) { - $destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords); -} else { - $destination = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $type); -} - -// Test d'existence de l'enregistrement dans la galaxie ! -if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) { - if (!$destination->getId()) { - if ($mission != Legacies_Empire::ID_MISSION_SETTLE_COLONY) { - message($lang['fl_unknow_target'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } else if ($mission == Legacies_Empire::ID_MISSION_DESTROY) { - message($lang['fl_used_target'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - } else if ($mission == Legacies_Empire::ID_MISSION_DESTROY && !$destination->isMoon()) { - message($lang['fl_used_target'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } -} else { - $EnvoiMaxExpedition = $user->getElement(Legacies_Empire::ID_RESEARCH_EXPEDITION_TECHNOLOGY); - $Expedition = 0; - if ($EnvoiMaxExpedition > 0) { - $statement = $readAdapter->select() - ->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')) - ->from(array('fleet' => $readAdapter->getTable('fleets'))) - ->where('fleet_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $user->getId())) - ->where('fleet_mission', Legacies_Empire::ID_MISSION_EXPEDITION) - ->prepare() - ; - - $Expedition = $statement->fetchColumn(); - } - - if ($EnvoiMaxExpedition == 0 ) { - message ($lang['fl_expe_notech'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } else if ($Expedition >= $EnvoiMaxExpedition ) { - message ($lang['fl_expe_max'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } -} - -if ($destination->getUserId() == $user['id']) { - $YourPlanet = true; - $UsedPlanet = true; -} else if ($destination->getId()) { - $UsedPlanet = true; -} - -$missionTypes = array(); -// Determinons les type de missions possibles par rapport a la planete cible -if ($position == (Wootook::getGameConfig('engine/universe/positions') + 1)) { - $missionTypes[Legacies_Empire::ID_MISSION_EXPEDITION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_EXPEDITION]; -} else { - if ($type == Wootook_Empire_Model_Planet::TYPE_DEBRIS) { - if (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) { - $missionTypes[Legacies_Empire::ID_MISSION_RECYCLE] = $lang['type_mission'][Legacies_Empire::ID_MISSION_RECYCLE]; - } - } else if ($type == Wootook_Empire_Model_Planet::TYPE_PLANET) { - if (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0 && !$UsedPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_SETTLE_COLONY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SETTLE_COLONY]; - } - if (isset($fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER]) && $fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER] > 0 && !$UsedPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_ORE_MINING] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ORE_MINING]; - } - } else if ($type == Wootook_Empire_Model_Planet::TYPE_MOON) { - if (((isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) && - !$YourPlanet && $UsedPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_DESTROY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_DESTROY]; - } - if (isset($fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER]) && $fleetArray[Legacies_Empire::ID_SHIP_ORE_MININER] > 0 && !$YourPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_ORE_MINING] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ORE_MINING]; - } - } - - if (in_array($type, array(Wootook_Empire_Model_Planet::TYPE_MOON, Wootook_Empire_Model_Planet::TYPE_PLANET))) { - if (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && !$YourPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_SPY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_SPY]; - } - - if ((isset($fleetArray[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT]) && $fleetArray[Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT]) && $fleetArray[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_LIGHT_FIGHTER]) && $fleetArray[Legacies_Empire::ID_SHIP_LIGHT_FIGHTER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER]) && $fleetArray[Legacies_Empire::ID_SHIP_HEAVY_FIGHTER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_CRUISER]) && $fleetArray[Legacies_Empire::ID_SHIP_CRUISER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_BATTLESHIP] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP]) && $fleetArray[Legacies_Empire::ID_SHIP_COLONY_SHIP] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_RECYCLER]) && $fleetArray[Legacies_Empire::ID_SHIP_RECYCLER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE]) && $fleetArray[Legacies_Empire::ID_SHIP_SPY_DRONE] > 0 && Wootook::getGameConfig('engine/combat/allow_spy_drone_attacks')) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_BOMBER]) && $fleetArray[Legacies_Empire::ID_SHIP_BOMBER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR]) && $fleetArray[Legacies_Empire::ID_SHIP_DESTRUCTOR] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR]) && $fleetArray[Legacies_Empire::ID_SHIP_DEATH_STAR] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_BATTLECRUISER]) && $fleetArray[Legacies_Empire::ID_SHIP_BATTLECRUISER] > 0) || - (isset($fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA]) && $fleetArray[Legacies_Empire::ID_SHIP_SUPERNOVA] > 0)) { - - if (!$YourPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_ATTACK] = $lang['type_mission'][Legacies_Empire::ID_MISSION_ATTACK]; - $missionTypes[Legacies_Empire::ID_MISSION_GROUP_ATTACK] = $lang['type_mission'][Legacies_Empire::ID_MISSION_GROUP_ATTACK]; - $missionTypes[Legacies_Empire::ID_MISSION_STATION_ALLY] = $lang['type_mission'][Legacies_Empire::ID_MISSION_STATION_ALLY]; - } - $missionTypes[Legacies_Empire::ID_MISSION_TRANSPORT] = $lang['type_mission'][Legacies_Empire::ID_MISSION_TRANSPORT]; - } - - if ($YourPlanet) { - $missionTypes[Legacies_Empire::ID_MISSION_STATION] = $lang['type_mission'][Legacies_Empire::ID_MISSION_STATION]; - } - } -} - -if (isset($fleetArray[Legacies_Empire::ID_SHIP_SOLAR_SATELLITE])) { - $missionTypes = array(); -} - -if (!isset($missionTypes[$mission])) { - message($lang['fl_bad_mission'], $lang['fl_error'], "fleet." . PHPEXT, 2); -} - -if (!$destination->getId()) { - $destinationUser = $user; -} else { - $destinationUser = $destination->getUser(); -} - -$myGameLevel = $readAdapter->select() - ->column('total_points') - ->from(array('statpoints' => $readAdapter->getTable('statpoints'))) - ->where('stat_type', 1) - ->where('stat_code', 1) - ->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $user->getId())) - ->prepare() - ->fetchColumn() -; -if ($destinationUser->getId()) { - $hisGameLevel = $readAdapter->select() - ->column('total_points') - ->from(array('statpoints' => $readAdapter->getTable('statpoints'))) - ->where('stat_type', 1) - ->where('stat_code', 1) - ->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Param('player', $destinationUser->getId())) - ->prepare() - ->fetchColumn() - ; -} else { - $hisGameLevel = 0; -} - -$vacationMode = $destinationUser->isVacation(); - -if ($protection) { - $protectedMissions = array( - Legacies_Empire::ID_MISSION_ATTACK, - Legacies_Empire::ID_MISSION_GROUP_ATTACK, - Legacies_Empire::ID_MISSION_STATION_ALLY, - Legacies_Empire::ID_MISSION_SPY, - Legacies_Empire::ID_MISSION_DESTROY - ); - if ($destinationUser->getId() && in_array($mission, $protectedMissions)) { - if ($myGameLevel > ($hisGameLevel * $protectionMultiplier) && $hisGameLevel < ($protectionPointsCap * 1000)) { - message($lang['fl_noob_mess_n'], $lang['fl_noob_title'], "fleet." . PHPEXT, 2); - } else if (($myGameLevel * $protectionMultiplier) < $hisGameLevel && $myGameLevel < ($protectionPointsCap * 1000)) { - message($lang['fl_noob_mess_n'], $lang['fl_noob_title'], "fleet." . PHPEXT, 2); - } - } -} - -if ($vacationMode && $mission != Legacies_Empire::ID_MISSION_RECYCLE) { - message($lang['fl_vacation_pla'], $lang['fl_vacation_ttl'], "fleet." . PHPEXT, 2); -} - -$currentFleets = $user->getFleets()->getSize(); - -if (($user->getElement(Legacies_Empire::ID_RESEARCH_COMPUTER_TECHNOLOGY) + 1) <= $currentFleets) { - message("Pas de slot disponible", "Erreur", "fleet." . PHPEXT, 1); -} - -$metal = isset($_POST['resource1']) ? intval($_POST['resource1']) : 0; -$cristal = isset($_POST['resource2']) ? intval($_POST['resource2']) : 0; -$deuterium = isset($_POST['resource3']) ? intval($_POST['resource3']) : 0; - -if ($metal + $cristal + $deuterium < 1 && $mission == Legacies_Empire::ID_MISSION_TRANSPORT) { - message("".$lang['fl_noenoughtgoods']."", $lang['type_mission'][3], "fleet." . PHPEXT, 1); -} -if ($mission != Legacies_Empire::ID_MISSION_EXPEDITION) { - $userMissions = array( - Legacies_Empire::ID_MISSION_ATTACK, - Legacies_Empire::ID_MISSION_GROUP_ATTACK, - Legacies_Empire::ID_MISSION_TRANSPORT, - Legacies_Empire::ID_MISSION_STATION, - Legacies_Empire::ID_MISSION_STATION_ALLY, - Legacies_Empire::ID_MISSION_SPY - ); - if (!$destination->getUserId() && in_array($mission, $userMissions)) { - message ($lang['fl_bad_planet01'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destination->getId() && $mission == Legacies_Empire::ID_MISSION_SETTLE_COLONY) { - message ($lang['fl_bad_planet02'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destination->getId() != $planet->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) { - message ($lang['fl_dont_stay_here'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destination->getElement(Legacies_Empire::ID_BUILDING_ALLIANCE_DEPOT) < 1 && $destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION_ALLY) { - message ($lang['fl_no_allydeposit'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_ATTACK)) { - message ($lang['fl_no_self_attack'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destinationUser->getId() == $user->getId() && ($mission == Legacies_Empire::ID_MISSION_SPY)) { - message ($lang['fl_no_self_spy'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } - if ($destinationUser->getId() != $user->getId() && $mission == Legacies_Empire::ID_MISSION_STATION) { - message ($lang['fl_only_stay_at_home'], $lang['fl_error'], "fleet." . PHPEXT, 2); - } -} - -$possibleSpeeds = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1); - -$AllFleetSpeed = GetFleetMaxSpeed($fleetArray, 0, $user); -$SpeedFactor = Wootook::getGameConfig('game/speed/general'); -$MaxFleetSpeed = min($AllFleetSpeed); - -if (!in_array($speed, $possibleSpeeds)) { - message ($lang['fl_cheat_speed'], $lang['fl_error'], "fleet." . PHPEXT, 2); -} - -$error = 0; -$errorlist = ""; -if ($galaxy > Wootook::getGameConfig('engine/universe/galaxies') || $galaxy < 1) { - $error++; - $errorlist .= $lang['fl_limit_galaxy']; -} -if ($system > Wootook::getGameConfig('engine/universe/systems') || $system < 1) { - $error++; - $errorlist .= $lang['fl_limit_system']; -} -if ($position > (Wootook::getGameConfig('engine/universe/positions') + 1) || $position < 1) { - $error++; - $errorlist .= $lang['fl_limit_planet']; -} - -if ($error > 0) { - message($errorlist, $lang['fl_error'], "fleet." . PHPEXT, 2); -} - -if (!isset($fleetArray)) { - message($lang['fl_no_fleetarray'], $lang['fl_error'], "fleet." . PHPEXT, 2); -} - -$distance = GetTargetDistance($planet->getGalaxy(), $galaxy, $planet->getSystem(), $system, $planet->getPosition(), $position); -$duration = GetMissionDuration($speed, $MaxFleetSpeed, $distance, $SpeedFactor); -$consumption = GetFleetConsumption($fleetArray, $SpeedFactor, $duration, $distance, $MaxFleetSpeed, $user); - -$startTime = time() + $duration; -if ($mission == Legacies_Empire::ID_MISSION_EXPEDITION && isset($_POST['expeditiontime']) && is_int($_POST['expeditiontime']) - && ($expeditionTime = intval($_POST['expeditiontime'])) >= 1 && $expeditionTime <= 10) { - $StayDuration = $expeditionTime * 3600; - $StayTime = $startTime + $expeditionTime * 3600; -} elseif ($mission == Legacies_Empire::ID_MISSION_STATION_ALLY || $mission == Legacies_Empire::ID_MISSION_ORE_MINING && is_int($_POST['holdingtime']) - && ($holdingTime = intval($_POST['holdingtime'])) >= 1 && $holdingTime <= 10) { - $StayDuration = $holdingTime * 3600; - $StayTime = $startTime + $holdingTime * 3600; -} else { - $StayDuration = 0; - $StayTime = 0; -} - -/* END Refactoring */ -$endTime = $StayDuration + (2 * $duration) + time(); -$FleetStorage = 0; -$FleetShipCount = array_sum($fleetArray); -$serializedFleetArray = ''; - -foreach ($fleetArray as $shipId => $count) { - $FleetStorage += $pricelist[$shipId]["capacity"] * $count; - $serializedFleetArray .= $shipId .",". $count .";"; - $planet->setElement($shipId, $planet->getElement($shipId) - $count); -} - -$StockMetal = $planet['metal']; -$StockCrystal = $planet['cristal']; -$StockDeuterium = $planet['deuterium'] - $consumption; - -$FleetStorage -= $consumption; -$StorageNeeded = 0; -if (!isset($_POST['resource1']) || intval($_POST['resource1']) < 1) { - $TransMetal = 0; -} else { - $TransMetal = intval($_POST['resource1']); - if (Math::comp($StockMetal, $TransMetal) < 0) { - $TransMetal = $StockMetal; - } - $StorageNeeded = Math::add($TransMetal, $StorageNeeded); -} -if (!isset($_POST['resource2']) || intval($_POST['resource2']) < 1) { - $TransCrystal = 0; -} else { - $TransCrystal = intval($_POST['resource2']); - if (Math::comp($StockCrystal, $TransCrystal) < 0) { - $TransCrystal = $StockCrystal; - } - $StorageNeeded = Math::add($TransCrystal, $StorageNeeded); -} -if (!isset($_POST['resource3']) || intval($_POST['resource3']) < 1) { - $TransDeuterium = 0; -} else { - $TransDeuterium = intval($_POST['resource3']); - if (Math::comp($StockDeuterium, $TransDeuterium) < 0) { - $TransDeuterium = $StockDeuterium; - } - $StorageNeeded = Math::add($TransDeuterium, $StorageNeeded); -} - -if ($StorageNeeded > $FleetStorage) { - message($lang['fl_nostoragespa'] . pretty_number($StorageNeeded - $FleetStorage), $lang['fl_error'], "fleet." . PHPEXT, 2); -} - -if ($destinationUser['authlevel'] > $user['authlevel']) { - $specialMissions = array( - Legacies_Empire::ID_MISSION_ATTACK, - Legacies_Empire::ID_MISSION_GROUP_ATTACK, - Legacies_Empire::ID_MISSION_SPY, - Legacies_Empire::ID_MISSION_DESTROY - ); - - if (in_array($mission, $specialMissions)) { - message($lang['fl_adm_attak'], $lang['fl_warning'], "fleet." . PHPEXT, 2); - } -} - -/* BEGIN Refactoring */ -try { - $writeAdapter->beginTransaction(); - - $mapper = $writeAdapter->getDataMapper(); - $dateMapper = $mapper->load('date-time'); - - $writeAdapter->insert() - ->into($writeAdapter->getTable('fleets')) - ->set('fleet_owner', $user->getId()) - ->set('fleet_mission', $mission) - ->set('fleet_amount', $FleetShipCount) - ->set('fleet_array', $serializedFleetArray) - ->set('fleet_start_time', $dateMapper->encode($startTime)) - ->set('fleet_start_galaxy', $planet->getGalaxy()) - ->set('fleet_start_system', $planet->getSystem()) - ->set('fleet_start_planet', $planet->getPosition()) - ->set('fleet_start_type', $planet->getType()) - ->set('fleet_end_time', $dateMapper->encode($endTime)) - ->set('fleet_end_stay', $dateMapper->encode($StayTime)) - ->set('fleet_end_galaxy', $galaxy) - ->set('fleet_end_system', $system) - ->set('fleet_end_planet', $position) - ->set('fleet_end_type', $type) - ->set('fleet_resource_metal', intval($TransMetal)) - ->set('fleet_resource_crystal', intval($TransCrystal)) // FIXME: refactor field name - ->set('fleet_resource_deuterium', intval($TransDeuterium)) - ->set('fleet_target_owner', $destination['id_owner']) - ->set('start_time', $dateMapper->encode(time())) - ->execute() - ; - - $planet["metal"] = $planet["metal"] - $TransMetal; - $planet["cristal"] = $planet["cristal"] - $TransCrystal; - $planet["deuterium"] = $planet["deuterium"] - $TransDeuterium - $consumption; - $planet->save(); - - $writeAdapter->commit(); -} catch (Exception $e) { - Wootook_Core_ErrorProfiler::getSingleton()->addException($e); - $writeAdapter->rollback(); - message($errorlist, $lang['fl_error'], "fleet." . PHPEXT, 2); -} -/* END Refactoring */ - -$page = "
"; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; -$page .= ""; - -$helper = Wootook_Empire_Helper_Config_Labels::getSingleton(); -foreach ($fleetArray as $shipId => $shipCount) { - $page .= ""; - $page .= ""; - $page .= ""; -} -$page .= "
". $lang['fl_fleet_send'] ."
". $lang['fl_mission'] ."". $missionTypes[$mission] ."
". $lang['fl_dist'] ."". pretty_number($distance) ."
". $lang['fl_speed'] ."". pretty_number($_POST['speedallsmin']) ."
". $lang['fl_deute_need'] ."". pretty_number($consumption) ."
". $lang['fl_from'] ."". $planet->getCoords() ."
". $lang['fl_dest'] ."". $galaxy . ':' . $system . ':' . $position ."
". $lang['fl_time_go'] ."". date("M D d H:i:s", $startTime) ."
". $lang['fl_time_back'] ."". date("M D d H:i:s", $endTime) ."
". $lang['fl_title'] ."
". $helper[$shipId]['name'] ."". pretty_number($shipCount) ."
"; - -display($page, $lang['fl_title']); diff --git a/src/includes/functions/GalaxyRowUser.php b/src/includes/functions/GalaxyRowUser.php deleted file mode 100644 index 6e4f460..0000000 --- a/src/includes/functions/GalaxyRowUser.php +++ /dev/null @@ -1,136 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * @deprecated - * @param Wootook_Empire_Model_Planet $currentPlanet - * @param Wootook_Player_Model_Entity $currentPlayer - */ -function GalaxyRowUser($currentPlanet, $currentPlayer) { - global $user; - - if (is_array($currentPlayer)) { - $currentPlayer = new Wootook_Player_Model_Entity($currentPlayer); - } - if (is_array($currentPlanet)) { - $currentPlanet = new Wootook_Empire_Model_Planet($currentPlanet); - $currentPlanet->setData('last_update', new Wootook_Core_DateTime($currentPlanet->getData('last_update'))); - } - if (!$currentPlayer || !$currentPlayer->getId() || !$currentPlanet || $currentPlanet->isDestroyed()) { - return ''; - } - - $activeNoobProtection = Wootook::getGameConfig('game/noob-protection/active'); - $noobProtectionMultiplier = Wootook::getGameConfig('game/noob-protection/multiplier'); - $noobProtectionPointsLimit = Wootook::getGameConfig('game/noob-protection/points-cap'); - - $readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); - - $statement = $readAdapter->select() - ->column('total_points') - ->column('total_rank') - ->from(array('stats' => $readAdapter->getTable('statpoints'))) - ->where('id_owner', new Wootook_Core_Database_Sql_Placeholder_Variable('player_id')) - ->where('stat_code', 1) - ->where('stat_type', 1) - ->prepare() - ; - - $statement->execute(array('player_id' => $user->getId())); - $playerPoints = $statement->fetchColumn(0); - - $statement->execute(array('player_id' => $currentPlayer->getId())); - $currentPlayerPoints = $statement->fetchColumn(0); - $currentPlayerRank = $statement->fetchColumn(1); - - $classes = array(); - if ($currentPlayer->isBanned()) { - $classes['banned'] = 'B'; - } - if ($currentPlayer->isVacation()) { - $classes['vacation'] = 'V'; - } - $pastDate = new Wootook_Core_DateTime(); - $pastDate->sub(8, Wootook_Core_DateTime::DAY); - if ($pastDate->isLater($currentPlayer->getLastLoginDate())) { - $classes['inactive'] = 'i'; - } - - $pastDate->sub(22, Wootook_Core_DateTime::DAY); - if ($pastDate->isLater($currentPlayer->getLastLoginDate())) { - $classes['long-inactive'] = 'I'; - } - if ($currentPlayer->isAuthorized(LEVEL_ADMIN)) { - $classes['admin'] = 'A'; - } else if ($currentPlayer->isAuthorized(LEVEL_OPERATOR)) { - $classes['operator'] = 'O'; - } else if ($currentPlayer->isAuthorized(LEVEL_MODERATOR)) { - $classes['moderator'] = 'M'; - } - - if ($activeNoobProtection) { - if ($playerPoints <= $noobProtectionPointsLimit && ($playerPoints * $noobProtectionMultiplier) < $currentPlayerPoints) { - $classes['strong'] = 'F'; - } else if ($currentPlayerPoints <= $noobProtectionPointsLimit && ($currentPlayerPoints * $noobProtectionMultiplier) < $playerPoints) { - $classes['strong'] = 'F'; - } - } - - $output = ''; - if (count($classes) > 0) { - $output .= '' . $currentPlayer->getUsername() . ''; - foreach ($classes as $class => $identifier) { - $output .= '' . $identifier . ''; - } - } else { - $output .= '' . $currentPlayer->getUsername() . ''; - } - - if (true || $currentPlayer->getId() !== $user->getId()) { - $translator = Wootook::getTranslator(); - $messageUrl = Wootook::getStaticUrl('messages.php', array('mode' => 'write', 'id' => $currentPlayer->getId())); - $buddyUrl = Wootook::getStaticUrl('buddy.php', array('a' => '2', 'u' => $currentPlayer->getId())); - $statsUrl = Wootook::getStaticUrl('stat.php', array('who' => 'player', 'start' => 100 * floor($currentPlayerRank / 100))); - - $output .=<< -

{$translator->translate('Player: %s', $currentPlayer->getUsername())}

-

{$translator->translate('Rank: %d', $currentPlayerRank)}

-

{$translator->translate('Send a message')}

-

{$translator->translate('Add to buddy list')}

-

{$translator->translate('Statistics')}

- -HTML_EOF; - } - - $output .= ''; - return $output; -} diff --git a/src/includes/functions/MissionCaseAttack.php b/src/includes/functions/MissionCaseAttack.php deleted file mode 100644 index 44e32d1..0000000 --- a/src/includes/functions/MissionCaseAttack.php +++ /dev/null @@ -1,458 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * @deprecated - * @param unknown_type $FleetRow - */ -function MissionCaseAttack($FleetRow) -{ - global $lang; - - $pricelist = Wootook_Empire_Helper_Config_Prices::getSingleton(); - $resource = Wootook_Empire_Helper_Config_FieldsAlias::getSingleton(); - $CombatCaps = Wootook_Empire_Helper_Config_Combat::getSingleton(); - - if ($FleetRow['fleet_mess'] == 0 && $FleetRow['fleet_start_time'] <= time()) { - -// refactored parts -// {{{ - $targetPlanet = Wootook_Empire_Model_Planet::factoryFromCoords(array( - 'galaxy' => $FleetRow['fleet_end_galaxy'], - 'system' => $FleetRow['fleet_end_system'], - 'planet' => $FleetRow['fleet_end_planet'], - 'type' => $FleetRow['fleet_end_type'] - )); - - /* - * Update planet resources and constructions - */ - Wootook::dispatchEvent('planet.update', array( - 'planet' => $targetPlanet - )); - $targetPlanet->save(); - - $TargetUser = $targetPlanet->getUser(); - $CurrentUser = Wootook_Player_Model_Entity::factory($FleetRow['fleet_owner']); - - $TargetUserID = $TargetUser->getId(); - $CurrentUserID = $CurrentUser->getId(); - - $TargetTechno = array( - 'military_tech' => $TargetUser->getData('military_tech'), - 'defence_tech' => $TargetUser->getData('defence_tech'), - 'shield_tech' => $TargetUser->getData('shield_tech') - ); - - $CurrentTechno = array( - 'military_tech' => $CurrentUser->getData('military_tech'), - 'defence_tech' => $CurrentUser->getData('defence_tech'), - 'shield_tech' => $CurrentUser->getData('shield_tech') - ); -// }}} - for ($SetItem = 200; $SetItem < 500; $SetItem++) { - if ($targetPlanet[$resource[$SetItem]] > 0) { - $TargetSet[$SetItem]['count'] = $targetPlanet[$resource[$SetItem]]; - } - } - - $TheFleet = explode(";", $FleetRow['fleet_array']); - foreach($TheFleet as $a => $b) { - if ($b != '') { - $a = explode(",", $b); - $CurrentSet[$a[0]]['count'] = $a[1]; - } - } - - include_once($xnova_root_path . 'includes/ataki.' . PHPEXT); - // Calcul de la duree de traitement (initialisation) - $mtime = microtime(); - $mtime = explode(" ", $mtime); - $mtime = $mtime[1] + $mtime[0]; - $starttime = $mtime; - - $walka = walka($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno); - // Calcul de la duree de traitement (calcul) - $mtime = microtime(); - $mtime = explode(" ", $mtime); - $mtime = $mtime[1] + $mtime[0]; - $endtime = $mtime; - $totaltime = ($endtime - $starttime); - // Ce qu'il reste de l'attaquant - $CurrentSet = $walka["atakujacy"]; - // Ce qu'il reste de l'attaqué - $TargetSet = $walka["wrog"]; - // Le resultat de la bataille - $FleetResult = $walka["wygrana"]; - // Rapport long (rapport de bataille detaillé) - $dane_do_rw = $walka["dane_do_rw"]; - // Rapport court (cdr + unitées perdues) - $zlom = $walka["zlom"]; - - $FleetArray = ""; - $FleetAmount = 0; - $FleetStorage = 0; - foreach ($CurrentSet as $Ship => $Count) { - $FleetStorage += $pricelist[$Ship]["capacity"] * $Count['count']; - $FleetArray .= $Ship . "," . $Count['count'] . ";"; - $FleetAmount += $Count['count']; - } - // Au cas ou le p'tit rigolo qu'a envoyé la flotte y avait mis des ressources ... - $FleetStorage -= $FleetRow["fleet_resource_metal"]; - $FleetStorage -= $FleetRow["fleet_resource_crystal"]; - $FleetStorage -= $FleetRow["fleet_resource_deuterium"]; - - $targetPlanetUpd = ""; - if (!is_null($TargetSet)) { - foreach($TargetSet as $Ship => $Count) { - $targetPlanetUpd .= "`" . $resource[$Ship] . "` = '" . $Count['count'] . "', "; - } - } - // Determination des ressources pillées - $Mining['metal'] = 0; - $Mining['crystal'] = 0; - $Mining['deuter'] = 0; - if ($FleetResult == "a") { - if ($FleetStorage > 0) { - $metal = $targetPlanet['metal'] / 2; - $crystal = $targetPlanet['crystal'] / 2; - $deuter = $targetPlanet["deuterium"] / 2; - if (($metal) > $FleetStorage / 3) { - $Mining['metal'] = $FleetStorage / 3; - $FleetStorage = $FleetStorage - $Mining['metal']; - } else { - $Mining['metal'] = $metal; - $FleetStorage = $FleetStorage - $Mining['metal']; - } - - if (($crystal) > $FleetStorage / 2) { - $Mining['crystal'] = $FleetStorage / 2; - $FleetStorage = $FleetStorage - $Mining['crystal']; - } else { - $Mining['crystal'] = $crystal; - $FleetStorage = $FleetStorage - $Mining['crystal']; - } - - if (($deuter) > $FleetStorage) { - $Mining['deuter'] = $FleetStorage; - $FleetStorage = $FleetStorage - $Mining['deuter']; - } else { - $Mining['deuter'] = $deuter; - $FleetStorage = $FleetStorage - $Mining['deuter']; - } - } - } - $Mining['metal'] = round($Mining['metal']); - $Mining['crystal'] = round($Mining['crystal']); - $Mining['deuter'] = round($Mining['deuter']); - // Mise a jour de l'enregistrement de la planete attaquée - $QryUpdateTarget = "UPDATE {{table}} SET "; - $QryUpdateTarget .= $targetPlanetUpd; - $QryUpdateTarget .= "`metal` = `metal` - '" . $Mining['metal'] . "', "; - $QryUpdateTarget .= "`crystal` = `crystal` - '" . $Mining['crystal'] . "', "; - $QryUpdateTarget .= "`deuterium` = `deuterium` - '" . $Mining['deuter'] . "' "; - $QryUpdateTarget .= "WHERE "; - $QryUpdateTarget .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND "; - $QryUpdateTarget .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND "; - $QryUpdateTarget .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND "; - $QryUpdateTarget .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "' "; - $QryUpdateTarget .= "LIMIT 1;"; - doquery($QryUpdateTarget , 'planets'); - // Mise a jour du champ de ruine devant la planete attaquée - $QryUpdateGalaxy = "UPDATE {{table}} SET "; - $QryUpdateGalaxy .= "`metal` = `metal` + '" . $zlom['metal'] . "', "; - $QryUpdateGalaxy .= "`crystal` = `crystal` + '" . $zlom['crystal'] . "' "; - $QryUpdateGalaxy .= "WHERE "; - $QryUpdateGalaxy .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND "; - $QryUpdateGalaxy .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND "; - $QryUpdateGalaxy .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' "; - $QryUpdateGalaxy .= "LIMIT 1;"; - doquery($QryUpdateGalaxy , 'galaxy'); - // Là on va discuter le bout de gras pour voir s'il y a moyen d'avoir une Lune ! - $FleetDebris = $zlom['metal'] + $zlom['crystal']; - $StrAttackerUnits = sprintf ($lang['sys_attacker_lostunits'], pretty_number ($zlom["atakujacy"])); - $StrDefenderUnits = sprintf ($lang['sys_defender_lostunits'], pretty_number ($zlom["wrog"])); - $StrRuins = sprintf ($lang['sys_gcdrunits'], pretty_number ($zlom["metal"]), $lang['Metal'], pretty_number ($zlom['crystal']), $lang['Crystal']); - $DebrisField = $StrAttackerUnits . "
" . $StrDefenderUnits . "
" . $StrRuins; - $MoonChance = $FleetDebris / 100000; - if ($FleetDebris > 2000000) { - $MoonChance = 20; - } - if ($FleetDebris < 100000) { - $UserChance = 0; - $ChanceMoon = ""; - } elseif ($FleetDebris >= 100000) { - $UserChance = mt_rand(1, 100); - $ChanceMoon = sprintf ($lang['sys_moonproba'], $MoonChance); - } - - if (($UserChance > 0) and ($UserChance <= $MoonChance) and $galenemyrow['id_luna'] == 0) { - $user = Wootook_Player_Model_Entity::factory($TargetUserID); - $user->createNewPlanet( - intval($FleetRow['fleet_end_galaxy']), - intval($FleetRow['fleet_end_system']), - intval($FleetRow['fleet_end_planet']), - Wootook_Empire_Model_Planet::TYPE_MOON, - Wootook::__('Moon') - ); - $GottenMoon = Wootook::_('A moon has been created!'); - } elseif ($UserChance = 0 or $UserChance > $MoonChance) { - $GottenMoon = ""; - } - - $AttackDate = date("r", $FleetRow["fleet_start_time"]); - $title = sprintf ($lang['sys_attack_title'], $AttackDate); - $raport = "
" . $title . "
"; - $zniszczony = false; - $a_zestrzelona = 0; - $AttackTechon['A'] = $CurrentTechno["military_tech"] * 10; - $AttackTechon['B'] = $CurrentTechno["defence_tech"] * 10; - $AttackTechon['C'] = $CurrentTechno["shield_tech"] * 10; - $AttackerData = sprintf ($lang['sys_attack_attacker_pos'], $CurrentUser["username"], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']); - $AttackerTech = sprintf ($lang['sys_attack_techologies'], $AttackTechon['A'], $AttackTechon['B'], $AttackTechon['C']); - - $DefendTechon['A'] = $TargetTechno["military_tech"] * 10; - $DefendTechon['B'] = $TargetTechno["defence_tech"] * 10; - $DefendTechon['C'] = $TargetTechno["shield_tech"] * 10; - $DefenderData = sprintf ($lang['sys_attack_defender_pos'], $TargetUser["username"], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']); - $DefenderTech = sprintf ($lang['sys_attack_techologies'], $DefendTechon['A'], $DefendTechon['B'], $DefendTechon['C']); - - foreach ($dane_do_rw as $a => $b) { - $raport .= "

" . $AttackerData . "
" . $AttackerTech . ""; - if ($b["atakujacy"]['count'] > 0) { - $raport1 = ""; - $raport2 = ""; - $raport3 = ""; - $raport4 = ""; - $raport5 = ""; - foreach ($b["atakujacy"] as $Ship => $Data) { - if (is_numeric($Ship)) { - if ($Data['count'] > 0) { - $raport1 .= ""; - $raport2 .= ""; - $raport3 .= ""; - $raport4 .= ""; - $raport5 .= ""; - } - } - } - $raport1 .= ""; - $raport2 .= ""; - $raport3 .= ""; - $raport4 .= ""; - $raport5 .= ""; - $raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5; - } else { - if ($a == 2) { - $a_zestrzelona = 1; - } - $zniszczony = true; - $raport .= "
" . $lang['sys_destroyed']; - } - - $raport .= "
" . $lang['sys_ship_type'] . "
" . $lang['sys_ship_count'] . "
" . $lang['sys_ship_weapon'] . "
" . $lang['sys_ship_shield'] . "
" . $lang['sys_ship_armour'] . "" . $lang["tech_rc"][$Ship] . "" . pretty_number ($Data['count']) . "" . pretty_number (round($Data["atak"] / $Data['count'])) . "" . pretty_number (round($Data["tarcza"] / $Data['count'])) . "" . pretty_number (round($Data["obrona"] / $Data['count'])) . "
"; - $raport .= "

" . $DefenderData . "
" . $DefenderTech . ""; - if ($b["wrog"]['count'] > 0) { - $raport1 = ""; - $raport2 = ""; - $raport3 = ""; - $raport4 = ""; - $raport5 = ""; - foreach ($b["wrog"] as $Ship => $Data) { - if (is_numeric($Ship)) { - if ($Data['count'] > 0) { - $raport1 .= ""; - $raport2 .= ""; - $raport3 .= ""; - $raport4 .= ""; - $raport5 .= ""; - } - } - } - $raport1 .= ""; - $raport2 .= ""; - $raport3 .= ""; - $raport4 .= ""; - $raport5 .= ""; - $raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5; - } else { - $zniszczony = true; - $raport .= "
" . $lang['sys_destroyed']; - } - $raport .= "
" . $lang['sys_ship_type'] . "
" . $lang['sys_ship_count'] . "
" . $lang['sys_ship_weapon'] . "
" . $lang['sys_ship_shield'] . "
" . $lang['sys_ship_armour'] . "" . $lang["tech_rc"][$Ship] . "" . pretty_number ($Data['count']) . "" . pretty_number (round($Data["atak"] / $Data['count'])) . "" . pretty_number (round($Data["tarcza"] / $Data['count'])) . "" . pretty_number (round($Data["obrona"] / $Data['count'])) . "
"; - - if (($zniszczony == false) and !($a == 8)) { - $AttackWaveStat = sprintf ($lang['sys_attack_attack_wave'], pretty_number (floor($b["atakujacy"]["atak"])), pretty_number (floor($b["wrog"]["tarcza"]))); - $DefendWavaStat = sprintf ($lang['sys_attack_defend_wave'], pretty_number (floor($b["wrog"]["atak"])), pretty_number (floor($b["atakujacy"]["tarcza"]))); - $raport .= "
" . $AttackWaveStat . "
" . $DefendWavaStat . "
"; - } - } - switch ($FleetResult) { - case "a": - $Pillage = sprintf ($lang['sys_stealed_ressources'], pretty_number ($Mining['metal']), $lang['metal'], pretty_number ($Mining['crystal']), $lang['crystal'], pretty_number ($Mining['deuter']), $lang['Deuterium']); - $raport .= $lang['sys_attacker_won'] . "
" . $Pillage . "
"; - $raport .= $DebrisField . "
"; - $raport .= $ChanceMoon . "
"; - $raport .= $GottenMoon . "
"; - break; - case "r": - $raport .= $lang['sys_both_won'] . "
"; - $raport .= $DebrisField . "
"; - $raport .= $ChanceMoon . "
"; - $raport .= $GottenMoon . "
"; - break; - case "w": - $raport .= $lang['sys_defender_won'] . "
"; - $raport .= $DebrisField . "
"; - $raport .= $ChanceMoon . "
"; - $raport .= $GottenMoon . "
"; - doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets'); - break; - default: - break; - } - $SimMessage = sprintf ($lang['sys_rapport_build_time'], $totaltime); - $raport .= $SimMessage . "
"; - - $rid = md5($raport); - $QryInsertRapport = "INSERT INTO {{table}} SET "; - $QryInsertRapport .= "`time` = UNIX_TIMESTAMP(), "; - $QryInsertRapport .= "`id_owner1` = '" . $FleetRow['fleet_owner'] . "', "; - $QryInsertRapport .= "`id_owner2` = '" . $TargetUserID . "', "; - $QryInsertRapport .= "`rid` = '" . $rid . "', "; - $QryInsertRapport .= "`a_zestrzelona` = '" . $a_zestrzelona . "', "; - $QryInsertRapport .= "`raport` = '" . addslashes ($raport) . "';"; - doquery($QryInsertRapport , 'rw'); - // Colorisation du résumé de rapport pour l'attaquant - $raport = ""; - $raport .= "
"; - if ($FleetResult == "a") { - $raport .= ""; - } elseif ($FleetResult == "r") { - $raport .= ""; - } elseif ($FleetResult == "w") { - $raport .= ""; - } - $raport .= $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "]

"; - $raport .= "" . $lang['sys_perte_attaquant'] . ": " . pretty_number ($zlom["atakujacy"]) . ""; - $raport .= " " . $lang['sys_perte_defenseur'] . ":" . pretty_number ($zlom["wrog"]) . "
" ; - $raport .= $lang['sys_gain'] . " " . $lang['Metal'] . ":" . pretty_number ($Mining['metal']) . " " . $lang['Crystal'] . ":" . pretty_number ($Mining['crystal']) . " " . $lang['Deuterium'] . ":" . pretty_number ($Mining['deuter']) . "
"; - $raport .= $lang['sys_debris'] . " " . $lang['Metal'] . ":" . pretty_number ($zlom['metal']) . " " . $lang['Crystal'] . ":" . pretty_number ($zlom['crystal']) . "
"; - - $Mining['metal'] = $Mining['metal'] + $FleetRow["fleet_resource_metal"]; - $Mining['crystal'] = $Mining['crystal'] + $FleetRow["fleet_resource_crystal"]; - $Mining['deuter'] = $Mining['deuter'] + $FleetRow["fleet_resource_deuterium"]; - - $QryUpdateFleet = "UPDATE {{table}} SET "; - $QryUpdateFleet .= "`fleet_amount` = '" . $FleetAmount . "', "; - $QryUpdateFleet .= "`fleet_array` = '" . $FleetArray . "', "; - $QryUpdateFleet .= "`fleet_mess` = '1', "; - $QryUpdateFleet .= "`fleet_resource_metal` = '" . $Mining['metal'] . "', "; - $QryUpdateFleet .= "`fleet_resource_crystal` = '" . $Mining['crystal'] . "', "; - $QryUpdateFleet .= "`fleet_resource_deuterium` = '" . $Mining['deuter'] . "' "; - $QryUpdateFleet .= "WHERE fleet_id = '" . $FleetRow['fleet_id'] . "' "; - $QryUpdateFleet .= "LIMIT 1 ;"; - doquery($QryUpdateFleet , 'fleets'); - - SendSimpleMessage ($CurrentUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport); - // Ajout du petit point raideur - $AddPoint = $CurrentUser['xpraid'] + 1; - - $QryUpdateOfficier = "UPDATE {{table}} SET "; - $QryUpdateOfficier .= "`xpraid` = '" . $AddPoint . "' "; - $QryUpdateOfficier .= "WHERE id = '" . $CurrentUserID . "' "; - $QryUpdateOfficier .= "LIMIT 1 ;"; - doquery($QryUpdateOfficier, 'users'); - // Ajout d'un point au compteur de raids - $RaidsTotal = $CurrentUser['raids'] + 1; - if ($FleetResult == "a") { - $RaidsWin = $CurrentUser['raidswin'] + 1; - $QryUpdateRaidsCompteur = "UPDATE {{table}} SET "; - $QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsWin . "', "; - $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' "; - $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' "; - $QryUpdateRaidsCompteur .= "LIMIT 1 ;"; - doquery($QryUpdateRaidsCompteur, 'users'); - } elseif ($FleetResult == "r" || $FleetResult == "w") { - $RaidsLoose = $CurrentUser['raidsloose'] + 1; - $QryUpdateRaidsCompteur = "UPDATE {{table}} SET "; - $QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsLoose . "', "; - $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' "; - $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' "; - $QryUpdateRaidsCompteur .= "LIMIT 1 ;"; - doquery($QryUpdateRaidsCompteur, 'users'); - } - // Colorisation du résumé de rapport pour l'attaquant - $raport2 = ""; - $raport2 .= "
"; - if ($FleetResult == "a") { - $raport2 .= ""; - } elseif ($FleetResult == "r") { - $raport2 .= ""; - } elseif ($FleetResult == "w") { - $raport2 .= ""; - } - $raport2 .= $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "]

"; - - SendSimpleMessage ($TargetUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport2); - } -// Retour de flotte (s'il en reste) - $fquery = ""; - if ($FleetRow['fleet_end_time'] <= time()) { - if (!is_null($CurrentSet)) { - foreach($CurrentSet as $Ship => $Count) { - $fquery .= "`" . $resource[$Ship] . "` = `" . $resource[$Ship] . "` + '" . $Count['count'] . "', "; - } - } else { - $fleet = explode(";", $FleetRow['fleet_array']); - foreach($fleet as $a => $b) { - if ($b != '') { - $a = explode(",", $b); - $fquery .= "{$resource[$a[0]]}={$resource[$a[0]]} + {$a[1]}, \n"; - } - } - } - - doquery ("DELETE FROM {{table}} WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets'); - if (!($FleetResult == "w")) { - $QryUpdatePlanet = "UPDATE {{table}} SET "; - $QryUpdatePlanet .= $fquery; - $QryUpdatePlanet .= "`metal` = `metal` + " . $FleetRow['fleet_resource_metal'] . ", "; - $QryUpdatePlanet .= "`crystal` = `crystal` + " . $FleetRow['fleet_resource_crystal'] . ", "; - $QryUpdatePlanet .= "`deuterium` = `deuterium` + " . $FleetRow['fleet_resource_deuterium'] . " "; - $QryUpdatePlanet .= "WHERE "; - $QryUpdatePlanet .= "`galaxy` = " . $FleetRow['fleet_start_galaxy'] . " AND "; - $QryUpdatePlanet .= "`system` = " . $FleetRow['fleet_start_system'] . " AND "; - $QryUpdatePlanet .= "`planet` = " . $FleetRow['fleet_start_planet'] . " AND "; - $QryUpdatePlanet .= "`planet_type` = " . $FleetRow['fleet_start_type'] . " LIMIT 1 ;"; - doquery($QryUpdatePlanet, 'planets'); - } - } -} diff --git a/src/includes/functions/MissionCaseColonisation.php b/src/includes/functions/MissionCaseColonisation.php deleted file mode 100644 index b736091..0000000 --- a/src/includes/functions/MissionCaseColonisation.php +++ /dev/null @@ -1,138 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * @deprecated - * @param Wootook_Empire_Model_Fleet|array $fleet - */ -function MissionCaseColonisation($fleet) -{ - $readConnection = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); - - $player = new Wootook_Player_Model_Entity(); - $player->load($fleet->getData('fleet_owner')); - if (!$player->getId()) { - $fleet->delete(); - return; - } - - $event = Wootook::dispatchEvent('fleet.mission.colonize.max-allowed-planets', array( - 'base_count' => MAX_PLAYER_PLANETS, - 'count' => MAX_PLAYER_PLANETS, - 'player' => $player, - 'fleet' => $fleet - )); - - $maxAllowedPlanetCount = $event->getData('count'); - - /* first trip */ - if ($fleet->getData('fleet_mess') == 0) { - if ($fleet->getActionTime()->isEarlier()) { - return; - } - if ($player->getPlanetCollection()->getSize() >= $maxAllowedPlanetCount && !$player->isAuthorized(array(LEVEL_ADMIN))) { - /* no more planets to colonize */ - - $coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet')); - SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0, - Wootook::__('Colonization'), Wootook::__('Colonization report'), - Wootook::__("The fleet has arrived at the coordinates [%1\$s], but unfortunatly colonization cannot happen : you can't have more than %2\$d colonies.", $coords, $maxAllowedPlanetCount)); - - $fleet->goBack(); - return; - } - - $statement = $readConnection->select() - ->column(new Wootook_Core_Database_Sql_Placeholder_Expression('COUNT(*)')) - ->from($readConnection->getTable('planets')) - ->where('galaxy', $fleet->getData('fleet_end_galaxy')) - ->where('system', $fleet->getData('fleet_end_system')) - ->where('planet', $fleet->getData('fleet_end_planet')) - ->prepare() - ; - - $statement->execute(); - if ($statement->fetchColumn() > 0) { - $coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet')); - SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0, - Wootook::__('Colonization'), Wootook::__('Colonization report'), - Wootook::__("The fleet has arrived at the coordinates [%1\$s], but unfortunatly colonization cannot happen : the planet is already colonized.", $coords)); - - $fleet->goBack(); - return; - } - - if (mt_rand(0, 100) >= 75) { - $baseSize = Wootook::getGameConfig('planet/initial/fields'); - $factor = 2 * $position / (1 + log($position)); - $fuzz = 2 * $factor * pow(sin($factor), 2) / 2 + $factor / 4; - $size = ($baseSize * mt_rand(floor($factor / 10), ceil($factor * 5 / 4))) + mt_rand(0, $fuzz); - - $player->createNewPlanet( - $fleet->getData('fleet_end_galaxy'), - $fleet->getData('fleet_end_system'), - $fleet->getData('fleet_end_planet'), - Wootook_Empire_Model_Planet::TYPE_PLANET, - Wootook::__('Colony'), - $size - ); - - $coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet')); - SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0, - Wootook::__('Colonization'), Wootook::__('Colonization report'), - Wootook::__("The fleet has arrived at the coordinates [%1\$s], the settlers succeeded creating your new colony.", $coords)); - - $fleet->delete(); - return; - } else { - $coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet')); - SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0, - Wootook::__('Colonization'), Wootook::__('Colonization report'), - Wootook::__("The fleet has arrived at the coordinates [%1\$s], the settlers failed creating your new colony, no planet was there.", $coords)); - - $fleet->goBack(); - return; - } - } - - /* back trip */ - if ($fleet->getArrivalTime()->isEarlier()) { - return; - } - - $fleet->dock($fleet->getOriginPlanet()); - - $coords = sprintf('%d:%d:%d', $fleet->getData('fleet_end_galaxy'), $fleet->getData('fleet_end_system'), $fleet->getData('fleet_end_planet')); - SendSimpleMessage($player->getId(), null, $fleet['fleet_end_time'], 0, - Wootook::__('Colonization'), Wootook::__('Colonization report'), - Wootook::__("The fleet went back from the coordinates [%1\$s], the settlers failed creating your new colony.", $coords)); - return; -} \ No newline at end of file diff --git a/src/includes/functions/MissionCaseExploit.php b/src/includes/functions/MissionCaseExploit.php deleted file mode 100644 index 5b424c6..0000000 --- a/src/includes/functions/MissionCaseExploit.php +++ /dev/null @@ -1,137 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * @deprecated - * @param unknown_type $fleet - */ -function MissionCaseExploit($fleet) -{ - global $lang; - - $prices = Wootook_Empire_Helper_Config_Prices::getSingleton(); - $player = Wootook_Player_Model_Session::getSingleton()->getPlayer(); - $writeAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_write'); - - $userId = $fleet['fleet_owner']; - $MessSender = $lang['sys_mess_qg']; - $MessTitle = $lang['sys_expe_report']; - - if ($fleet['fleet_mess'] == 0) { - if ($fleet['fleet_end_stay'] < time()) { - $stayDuration = ($fleet['fleet_end_stay'] - $fleet['fleet_start_time']); - - $shipList = array(); - $fleetCapacity = array(); - $storageShips = array( - Legacies_Empire::ID_SHIP_ORE_MININER, - Legacies_Empire::ID_SHIP_DEATH_STAR, - Legacies_Empire::ID_SHIP_LIGHT_TRANSPORT, - Legacies_Empire::ID_SHIP_LARGE_TRANSPORT, - Legacies_Empire::ID_SHIP_SUPERNOVA, - ); - foreach (explode(";", $fleet['fleet_array']) as $shipData) { - if ($shipData) { - $shipData = explode(',', $shipData); - if (count($shipData) != 2) { - continue; - } - - $shipList[$shipData[0]] = $shipData[1]; - - if (in_array($shipData[0], $storageShips) && isset($prices[$shipData[0]]) && isset($prices[$shipData[0]]['capacity'])) { - $fleetCapacity += $prices[$shipData[0]]['capacity']; - } - } - } - - if (!isset($shipList[Legacies_Empire::ID_SHIP_ORE_MININER])) { - return; - } - - $fleetSentResources = $fleet['fleet_resource_metal'] + $fleet['fleet_resource_crystal'] + $fleet['fleet_resource_deuterium']; - $fleetAvailableCapacity = $fleetCapacity - $fleetSentResources; - - $minerCount = $shipList[Legacies_Empire::ID_SHIP_ORE_MININER]; - - mt_srand(); - $miningAmount = Math::mul(Math::mul($minerCount, $stayDuration), Math::pow(1.2, $player->getElement(Legacies_Empire::ID_RESEARCH_ORE_MINING))); - - $random = mt_rand(1, 10000); - $metalOreAmount = Math::mul($miningAmount, Math::div($random, 10000)); - - $random = mt_rand(1, 10000); - $cristalOreAmount = Math::mul($miningAmount, Math::div($random, 10000)); - - $totalOreAmount = Math::add($metalOreAmount, $cristalOreAmount); - if (Math::comp($totalOreAmount, $fleetAvailableCapacity) > 0) { - $ratio = Math::div($fleetAvailableCapacity, $totalOreAmount); - - $metalOreAmount = Math::mul($metalOreAmount, $ratio); - $cristalOreAmount = Math::mul($cristalOreAmount, $ratio); - } - - $statement = $writeAdapter->update() - ->into($writeAdapter->getTable('fleets')) - ->set('fleet_resource_metal', Math::add($fleet['fleet_resource_metal'], $metalOreAmount)) - ->set('fleet_resource_crystal', Math::add($fleet['fleet_resource_crystal'], $cristalOreAmount)) - ->prepare() - ; - $statement->execute(); - } - } else { - // La Flotte est de retour a quai - if ($fleet['fleet_end_time'] < time()) { - $coords = array( - 'galaxy' => $fleet['fleet_start_galaxy'], - 'system' => $fleet['fleet_start_system'], - 'position' => $fleet['fleet_start_planet'] - ); - $planet = Wootook_Empire_Model_Planet::factoryFromCoords($coords, $fleet['fleet_start_type']); - if (!$planet->getId() || $planet->getPlayerId() != $player->getId()) - foreach (explode(";", $fleet['fleet_array']) as $shipData) { - if ($shipData) { - $shipData = explode(',', $shipData); - if (count($shipData) != 2) { - continue; - } - - $planet->setElement($shipData[0], Math::add($planet->getElement($shipData[0]), $shipData[1])); - } - } - $planet->save(); - - SendSimpleMessage($userId, '', $fleet['fleet_end_time'], 15, $MessSender, $MessTitle, $lang['sys_expe_back_home']); - - $writeAdapter->delete()->from($writeAdapter->getTable('fleets'))->where('fleet_id', $fleet['fleet_id']); - } - } -} diff --git a/src/includes/functions/ShowGalaxyRows.php b/src/includes/functions/ShowGalaxyRows.php deleted file mode 100644 index fa5eef7..0000000 --- a/src/includes/functions/ShowGalaxyRows.php +++ /dev/null @@ -1,121 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -/** - * - * @deprecated - * @param int $Galaxy - * @param int $System - */ -function ShowGalaxyRows($Galaxy, $System) -{ - global $planetcount; - - $readAdapter = Wootook_Core_Database_ConnectionManager::getSingleton()->getConnection('core_read'); - - $galaxyStatement = $readAdapter->select() - ->column('*') - ->from($readAdapter->getTable('galaxy')) - ->where('galaxy', $Galaxy) - ->where('system', $System) - ->where('planet', new Wootook_Core_Database_Sql_Placeholder_Variable('planet')) - ->limit(1) - ->prepare() - ; - - $planetStatement = $readAdapter->select() - ->column('*') - ->from($readAdapter->getTable('planets')) - ->where('id', new Wootook_Core_Database_Sql_Placeholder_Variable('planet_id')) - ->limit(1) - ->prepare() - ; - - $output = ""; - for ($Planet = 1; $Planet <= Wootook::getGameConfig('engine/universe/positions'); $Planet++) { - if ($galaxyStatement->execute(array('planet' => $Planet))) { - /** @var Wootook_Empire_Model_Galaxy_Position $galaxyPosition */ - $galaxyPosition = $galaxyStatement->fetchEntity('Wootook_Empire_Model_Galaxy_Position'); - } else { - $output .= ''; - continue; - } - - $output .= ""; - if ($galaxyPosition->getData('galaxy') && $galaxyPosition["id_planet"] != 0) { - if ($planetStatement->execute(array('planet_id' => $galaxyPosition["id_planet"]))) { - /** @var Wootook_Empire_Model_Planet $currentPlanet */ - $currentPlanet = $planetStatement->fetchEntity('Wootook_Empire_Model_Planet'); - } else { - $currentPlanet = new Wootook_Empire_Model_Planet(); - } - - if ($currentPlanet->getId() && !$currentPlanet->isDestroyed()) { - $planetcount++; - $currentPlayer = $currentPlanet->getPlayer(); - } else { - CheckAbandonPlanetState($currentPlanet); - $currentPlayer = new Wootook_Player_Model_Entity(); - } - - if ($galaxyPosition["id_luna"] != 0) { - if ($planetStatement->execute(array('planet_id' => $galaxyPosition["id_luna"]))) { - /** @var Wootook_Empire_Model_Planet $currentMoon */ - $currentMoon = $planetStatement->fetchEntity('Wootook_Empire_Model_Planet'); - } else { - $currentMoon = new Wootook_Empire_Model_Planet(); - } - - if ($currentMoon->isDestroyed()) { - CheckAbandonMoonState($currentMoon); - } - } else { - $currentMoon = new Wootook_Empire_Model_Planet(); - } - } else { - $currentPlanet = new Wootook_Empire_Model_Planet(); - $currentPlayer = new Wootook_Player_Model_Entity(); - $currentMoon = new Wootook_Empire_Model_Planet(); - } - $output .= GalaxyRowPos($Planet, $galaxyPosition); - $output .= GalaxyRowPlanet($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 1); - $output .= GalaxyRowPlanetName($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 1); - $output .= GalaxyRowMoon($galaxyPosition, $currentMoon , $currentPlayer, $Galaxy, $System, $Planet, 3); - $output .= GalaxyRowDebris($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 2); - $output .= GalaxyRowUser($currentPlanet, $currentPlayer); - $output .= GalaxyRowAlly($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 0); - $output .= GalaxyRowActions($galaxyPosition, $currentPlanet, $currentPlayer, $Galaxy, $System, $Planet, 0); - $output .= ""; - } - - return $output; -} - -?> \ No newline at end of file diff --git a/src/includes/todofleetcontrol.php b/src/includes/todofleetcontrol.php deleted file mode 100644 index 819c79f..0000000 --- a/src/includes/todofleetcontrol.php +++ /dev/null @@ -1,74 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -require_once ROOT_PATH . 'includes/deprecated.php'; - -/** - * @deprecated - * {{{ - */ -include(ROOT_PATH . 'includes/functions/MissionCaseAttack.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseStay.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseStayAlly.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseTransport.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseSpy.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseRecycling.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseDestruction.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseColonisation.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/MissionCaseExpedition.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/SendSimpleMessage.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/SpyTarget.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/RestoreFleetToPlanet.'.PHPEXT); -include(ROOT_PATH . 'includes/functions/StoreGoodsToPlanet.'.PHPEXT); // includes/functions/StoreGoodsToPlanet.php -include(ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.'.PHPEXT); // infos.php, includes/functions/BuildFleetEventTable.php -include(ROOT_PATH . 'includes/functions/InsertGalaxyScripts.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyCheckFunctions.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/ShowGalaxyRows.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT); // <- TODO: delete -include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT); // <- TODO: delete -include(ROOT_PATH . 'includes/functions/GalaxyRowPos.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowPlanet.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowPlanetName.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowMoon.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowDebris.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowUser.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowAlly.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyRowActions.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/ShowGalaxySelector.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/ShowGalaxyMISelector.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/ShowGalaxyTitles.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/GalaxyLegendPopup.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/ShowGalaxyFooter.'.PHPEXT); // galaxy.php -include(ROOT_PATH . 'includes/functions/MessageForm.'.PHPEXT); // alliance.php -include(ROOT_PATH . 'includes/functions/MipCombatEngine.'.PHPEXT); // mipattack.php -include(ROOT_PATH . 'includes/functions/BuildFleetEventTable.'.PHPEXT); // phalanx.php -/** - * }}} - */ diff --git a/src/index.php b/src/index.php deleted file mode 100644 index 7454dc0..0000000 --- a/src/index.php +++ /dev/null @@ -1,42 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -define('DISABLE_IDENTITY_CHECK', true); -require_once dirname(__FILE__) .'/application/bootstrap.php'; - -$frontController = new Wootook_Core_Mvc_Controller_Front(Wootook::getRequest(), Wootook::getResponse()); - -$frontController - ->addModule('core', 'Wootook_Core_Controller_', 'Wootook/Core/Controller') - ->addModule('player', 'Wootook_Player_Controller_', 'Wootook/Player/Controller') - ->addModule('empire', 'Wootook_Empire_Controller_', 'Wootook/Empire/Controller') - ->addModule('legacies-empire', 'Legacies_Empire_Controller_', 'Legacies/Empire/Controller') - ->dispatch() - ->send(); diff --git a/src/install/gameplays.php b/src/install/gameplays.php deleted file mode 100644 index ab036c5..0000000 --- a/src/install/gameplays.php +++ /dev/null @@ -1,26 +0,0 @@ - array( - 'label' => 'Legacies', - 'description' => "Conquer planets and grow your outer space empire, fight against other space emperors and master the outer space.", - 'modules' => array( - 'Wootook_Core' => array( - 'code_pool' => 'core', - 'version' => '1.5.0' - ), - 'Wootook_Empire' => array( - 'code_pool' => 'core', - 'version' => '1.5.0' - ), - 'Legacies_Empire' => array( - 'code_pool' => 'core', - 'version' => '1.5.0' - ), -/* - 'Legacies_Officers' => array( - 'code_pool' => 'core', - 'version' => '1.5.0' - ), -*/ - ) - ) - ); diff --git a/src/install/index.php b/src/install/index.php deleted file mode 100644 index d96aacc..0000000 --- a/src/install/index.php +++ /dev/null @@ -1,592 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -define('DEBUG', true); -define('DEPRECATION', true); - -define('STEP_SYSTEM', 1); -define('STEP_DATABASE', 2); -define('STEP_UNIVERSE', 3); -define('STEP_PROFILE', 4); -define('STEP_CONFIG', 5); - -if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { - define('DEBUG', true); -} else if (!defined('DEBUG') && isset($_SERVER['DEBUG']) && in_array(strtolower($_SERVER['DEBUG']), array('1', 'on', 'true'))) { - define('DEBUG', true); -} - -if (!defined('DEPRECATION') && ($env = getenv('DEPRECATION')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { - define('DEPRECATION', true); -} else if (!defined('DEPRECATION') && isset($_SERVER['DEPRECATION']) && in_array(strtolower($_SERVER['DEPRECATION']), array('1', 'on', 'true'))) { - define('DEPRECATION', true); -} - -if (!defined('BCNUMBERS') && ($env = getenv('BCNUMBERS')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) { - define('BCNUMBERS', true); -} else if (!defined('BCNUMBERS') && isset($_SERVER['BCNUMBERS']) && in_array(strtolower($_SERVER['BCNUMBERS']), array('1', 'on', 'true'))) { - define('BCNUMBERS', true); -} - -if (!defined('DEBUG')) { - @ini_set('display_errors', false); -} else { - @ini_set('display_errors', true); - @error_reporting(E_ALL | E_STRICT); -} - -defined('ROOT_PATH') || define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR); -defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'application' . DIRECTORY_SEPARATOR); - -defined('PHPEXT') || define('PHPEXT', 'php'); - -defined('VERSION') || define('VERSION', '1.5.0-beta2'); - -set_include_path(implode(PATH_SEPARATOR, array( - APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries', - APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'local', - APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'community', - APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'core', - get_include_path() - ))); - -function __autoload($class) { - include_once str_replace('_', '/', $class) . '.php'; -} - -Wootook::$isInstalled = false; - -include ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'constants.php'; - -Wootook_Core_ErrorProfiler::register(); -Wootook_Core_Helper_Config_Events::registerEvents(); - -$mode = isset($_GET['mode']) ? strval($_GET['mode']) : 'intro'; -$step = isset($_GET['step']) ? intval($_GET['step']) : 1; -$prevStep = $step - 1; -$nextStep = $step + 1; - -$baseUrl = (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) == "on" ? 'https://' : 'http://') - . $_SERVER["SERVER_NAME"] . ($_SERVER["SERVER_PORT"] != "80" ? ":{$_SERVER["SERVER_PORT"]}" : ''); - -if (isset($_SERVER['REQUEST_URI'])) { - $pathOffset = strrpos($_SERVER['REQUEST_URI'], 'install/'); - $baseUrl .= substr($_SERVER['REQUEST_URI'], 0, strpos(substr($_SERVER['REQUEST_URI'], 0, -1), '/')) . '/'; -} -$session = Wootook::getSession('install'); - -$website = new Wootook_Core_Model_Website(); -$website->setId(0)->setData('code', Wootook_Core_Model_Website::DEFAULT_CODE); -Wootook::setDefaultWebsite($website); - -$game = new Wootook_Core_Model_Game(); -$game->setId(0)->setData('code', Wootook_Core_Model_Game::DEFAULT_CODE); -Wootook::setDefaultGame($game); - -$configRewrites = array( - 'default' => array( - 'web' => array( - 'url' => array( - 'base' => $baseUrl, - 'link' => $baseUrl, - 'skin' => $baseUrl . 'skin/', - 'js' => $baseUrl . 'js/', - 'css' => $baseUrl . 'css/' - ) - ), - 'system' => array( - 'path' => array( - 'base' => ROOT_PATH, - 'design' => APPLICATION_PATH . 'design' . DIRECTORY_SEPARATOR, - 'skin' => ROOT_PATH . 'skin' . DIRECTORY_SEPARATOR, - ) - ), - 'package' => 'default', - 'theme' => 'default', - 'layout' => array( - 'page' => 'page.xml', - 'install' => 'install.php' - ), - 'engine' => array( - 'storyline' => array( - 'universe' => 'legacies', - 'episode' => 'default', - ) - ), - 'resources' => array( - 'initial' => array( - 'metal' => 500, - 'cristal' => 500, - 'deuterium' => 0, - 'energy' => 0, - ), - 'base-income' => array( - 'metal' => 20, - 'cristal' => 10, - 'deuterium' => 0, - 'energy' => 0, - ), - ), - 'planet' => array( - 'initial' => array( - 'fields' => 163 - ) - ) - ) - ); - -$config = unserialize($session->getData('config')); -if (is_array($config)) { - Wootook::loadConfig(array_merge_recursive($config, $configRewrites)); -} else { - Wootook::loadConfig($configRewrites); -} -unset($config); - -$layout = new Wootook_Core_Model_Layout('install'); - -$request = new Wootook_Core_Mvc_Controller_Request_Http(); -$response = new Wootook_Core_Mvc_Controller_Response_Http(); - -switch ($mode) { -case 'intro': - $layout->load('install.intro'); - $layout->getMessagesBlock()->prepareMessages('install'); - $session->setData('step', 1); - break; - -case 'install': - if ($step > $session->getData('step')) { - $session->setData('step', 0); - $response->setRedirect("?mode=intro", Wootook_Core_Mvc_Controller_Response_Http::REDIRECT_TEMPORARY); - $response->sendHeaders(); - exit(0); - } - - switch ($step) { - case STEP_SYSTEM: - if ($request->isPost()) { - $form = new Wootook_Core_Form($session, array( - 'url_path' => 'text', - 'timezone' => 'text' - )); - $form->setRequest($request); - $form->populate(); - - if (!$form->validate()) { - $session->setData('step', STEP_SYSTEM); - $session->setFormData($form->getData()); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_SYSTEM))); - $response->sendHeaders(); - exit(0); - } - - $urlPath = $request->getPost('url_path'); - - $config = array( - 'global' => array( - 'resource' => array() - ), - 'backend' => array( - 'web' => array( - 'url' => array( - 'base' => $request->getPost('url_path'), - 'link' => $request->getPost('url_path') . 'admin/', - 'skin' => $request->getPost('url_path') . 'skin/', - 'js' => $request->getPost('url_path') . 'js/', - 'css' => $request->getPost('url_path') . 'css/', - ) - ), - 'system' => array( - 'path' => array( - 'base' => ROOT_PATH, - 'skin' => ROOT_PATH . 'skin' . DIRECTORY_SEPARATOR, - 'design' => ROOT_PATH . 'application' . DIRECTORY_SEPARATOR . 'design' . DIRECTORY_SEPARATOR, - ), - 'date' => array( - 'timezone' => $request->getPost('timezone') - ) - ), - ), - 'frontend' => array( - 'web' => array( - 'url' => array( - 'base' => $request->getPost('url_path'), - 'link' => $request->getPost('url_path'), - 'skin' => $request->getPost('url_path') . 'skin/', - 'js' => $request->getPost('url_path') . 'js/', - 'css' => $request->getPost('url_path') . 'css/', - ) - ), - 'system' => array( - 'path' => array( - 'base' => ROOT_PATH, - 'skin' => ROOT_PATH . 'skin' . DIRECTORY_SEPARATOR, - 'design' => ROOT_PATH . 'application' . DIRECTORY_SEPARATOR . 'design' . DIRECTORY_SEPARATOR, - ), - 'date' => array( - 'timezone' => $request->getPost('timezone') - ) - ), - 'engine' => array( - 'storyline' => array( - 'universe' => 'legacies', - 'episode' => 'default', - ), - 'core' => array( - 'use_large_numbers' => true - ), - 'universe' => array( - 'galaxies' => 3, - 'systems' => 100, - 'positions' => 15 - ), - 'combat' => array( - 'allow_spy_drone_attacks' => true - ) - ), - 'locales' => array( - 'fr' => 'fr_FR', - 'fr_FR' => 'fr_FR', - 'en' => 'en_US', - 'en_US' => 'en_US' - ) - ) - ); - $session->setData('config', serialize($config)); - - $session->setData('step', STEP_DATABASE); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_DATABASE))); - $response->sendHeaders(); - exit(0); - } - - $layout->load('install.step.system'); - $layout->getMessagesBlock()->prepareMessages('install'); - break; - - case STEP_DATABASE: - $config = unserialize($session->getData('config')); - if (isset($config['global']['database'])) { - $session->setFormData(array( - 'host' => $config['global']['database']['default']['params']['hostname'], - 'port' => $config['global']['database']['default']['params']['port'], - 'user' => $config['global']['database']['default']['params']['username'], - 'password' => $config['global']['database']['default']['params']['password'], - 'dbname' => $config['global']['database']['default']['params']['database'], - 'prefix' => $config['global']['database']['default']['table_prefix'], - )); - } - - if ($request->isPost()) { - $form = new Wootook_Core_Form($session, array( - 'host' => 'text', - 'port' => 'text', - 'user' => 'text', - 'password' => 'text', - 'dbname' => 'text', - 'prefix' => 'text', - )); - $form->setRequest($request); - $form->populate(); - - if (!$form->validate()) { - $session->setData('step', STEP_DATABASE); - $session->setFormData($request->getAllDatas()); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_DATABASE))); - $response->sendHeaders(); - exit(0); - } - - if ($request->getPost('test')) { - $data = array( - 'status' => 'pending', - 'message' => '' - ); - - try { - $hostname = $request->getPost('host'); - $username = $request->getPost('user'); - $password = $request->getPost('password'); - $database = $request->getPost('dbname'); - $port = $request->getPost('port'); - - $connection = new Wootook_Core_Database_Adapter_Pdo_Mysql("mysql:dbname={$database};host={$hostname};port={$port}", $username, $password); - $data['status'] = 'success'; - } catch (PDOException $e) { - $data['status'] = 'error'; - $data['message'] = $e->getMessage(); - } - - Wootook_Core_ErrorProfiler::unregister(true); - $response->setHeader('Content-Type', 'application/json'); - $response->setBody(json_encode($data)); - - $response->sendHeaders(); - echo $response->sendBody(); - exit(0); - } - - $config = unserialize($session->getData('config')); - $config['global']['resource']['database'] = array( - 'default' => array( - 'engine' => 'pdo.mysql', - 'options' => array( - ), - 'params' => array( - 'hostname' => $request->getPost('host'), - 'username' => $request->getPost('user'), - 'password' => $request->getPost('password'), - 'database' => $request->getPost('dbname'), - 'port' => $request->getPost('port') - ), - 'table_prefix' => $request->getPost('prefix'), - ), - 'core_setup' => array( - 'use' => 'default' - ), - 'core_read' => array( - 'use' => 'default' - ), - 'core_write' => array( - 'use' => 'default' - ), - ); - $session->setData('config', serialize($config)); - - $session->setData('step', STEP_UNIVERSE); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_UNIVERSE))); - $response->sendHeaders(); - exit(0); - } - - $layout->load('install.step.database'); - $layout->getMessagesBlock()->prepareMessages('install'); - break; - - case STEP_UNIVERSE: - if ($request->isPost()) { - $form = new Wootook_Core_Form($session, array( - 'galaxies' => 'text', - 'systems' => 'text', - 'positions' => 'text', - - 'allow_spy_drone_attacks' => 'text', - 'use_large_numbers' => 'text' - )); - $form->setRequest($request); - $form->populate(); - - if (!$form->validate()) { - $session->setData('step', STEP_UNIVERSE); - $session->setFormData($request->getAllDatas()); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } - - $config = unserialize($session->getData('config')); - $config['default'] = array( - 'engine' => array( - 'core' => array( - 'use_large_numbers' => (bool) $request->getPost('use_large_numbers') - ), - 'universe' => array( - 'galaxies' => $request->getPost('galaxies'), - 'systems' => $request->getPost('systems'), - 'positions' => $request->getPost('positions') - ), - 'combat' => array( - 'allow_spy_drone_attacks' => (bool) $request->getPost('allow_spy_drone_attacks') - ) - ), - ); - $session->setData('config', serialize($config)); - $writer = new Wootook_Core_Config_Adapter_Array(); - $writer->setData($config); - $writer->save(APPLICATION_PATH . 'configs' . DIRECTORY_SEPARATOR . 'local.php'); - - Wootook::loadConfig(array_merge_recursive($writer->toArray(), $configRewrites)); - - $galaxyCount = Wootook::getConfig('engine/universe/galaxies'); - $systemCount = Wootook::getConfig('engine/universe/systems'); - - $gameplays = include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'gameplays.php'; - $gameplayKey = Wootook::getConfig('storyline/universe'); - if (!isset($gameplays[$gameplayKey])) { - $gameplayKey = key($gameplays); - } - $moduleList = $gameplays[$gameplayKey]['modules']; - - $installedModules = array(); - $updater = new Wootook_Core_Setup_Updater(); - foreach ($moduleList as $module => $moduleData) { - $version = $moduleData['version']; - $codePool = $moduleData['code_pool']; - $modulePath = str_replace('_', DIRECTORY_SEPARATOR, $module); - - $scriptPath = APPLICATION_PATH . 'code' . DIRECTORY_SEPARATOR . $codePool - . DIRECTORY_SEPARATOR . $modulePath . DIRECTORY_SEPARATOR . 'install' - . DIRECTORY_SEPARATOR . 'mysql5'; - - try { - $queue = new Wootook_Core_Setup_Updater_ScriptQueue($scriptPath, null, $version); - - foreach ($queue as $installScript) { - $updater->run($installScript['script']); - $installedModules[$module] = $installScript['version']['version']; - } - } catch (Wootook_Core_Setup_Exception_VersionStageError $e) { - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - continue; - } catch (Wootook_Core_Setup_Exception_VersionValueError $e) { - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - continue; - } catch (Wootook_Core_Setup_Exception_RuntimeException $e) { - $session->addError($e->getMessage()); - Wootook_Core_ErrorProfiler::getSingleton()->exceptionManager($e); - - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_UNIVERSE))); - $response->sendHeaders(); - exit(0); - break; - } - } - $path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'gamedata' . DIRECTORY_SEPARATOR - . $gameplayKey . DIRECTORY_SEPARATOR . 'version.php'; - file_put_contents($path, '<' . '?p' . 'hp ' . var_export($installedModules, true) . ';'); - - $session->addSuccess(Wootook::__('Game data successfully initialized.')); - $session->setData('step', STEP_PROFILE); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } - - $layout->load('install.step.universe'); - $layout->getMessagesBlock()->prepareMessages('install'); - break; - - case STEP_PROFILE: - if ($request->isPost()) { - $form = new Wootook_Core_Form($session, array( - 'username' => 'text', - 'email' => 'text', - 'email_confirm' => 'text', - 'password' => 'text', - 'password_confirm' => 'text', - )); - $form->setRequest($request); - $form->populate(); - - if (!$form->validate()) { - $session->setData('step', STEP_PROFILE); - $session->setFormData($request->getAllDatas()); - $session->addError(Wootook::__('Form data error.')); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } - - if ($request->getPost('password') != $request->getPost('password_confirm')) { - $session->setData('step', STEP_PROFILE); - $session->setFormData($request->getAllDatas()); - $session->addError(Wootook::__('Passwords does not match.')); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } - - if ($request->getPost('email') != $request->getPost('email_confirm')) { - $session->setData('step', STEP_PROFILE); - $session->setFormData($request->getAllDatas()); - $session->addError(Wootook::__('Both e-mails does not match.')); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } - - try { - $user = Wootook_Player_Model_Entity::register($request->getPost('username'), $request->getPost('email'), $request->getPost('password')); - } catch (Wootook_Empire_Exception_RuntimeException $e) { - } - - $layout->getMessagesBlock()->prepareMessages('user'); - if (!$user || !$user->getId()) { - $session->setData('step', STEP_PROFILE); - $session->setFormData($request->getAllDatas()); - $session->addError(Wootook::__('Could not create user.')); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_PROFILE))); - $response->sendHeaders(); - exit(0); - } else { - Wootook_Player_Model_Session::getSingleton()->setLoggedIn($user); - - $user->setData('authlevel', LEVEL_ADMIN)->save(); - - $user->getHomePlanet()->setName(Wootook::__('Planet'))->save(); - } - - $session->setData('step', STEP_CONFIG); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'install', 'step' => STEP_CONFIG))); - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'summary'))); - $response->sendHeaders(); - exit(0); - } - - $layout->load('install.step.profile'); - $layout->getMessagesBlock()->prepareMessages('install'); - break; - - case STEP_CONFIG: - //* - $response->setRedirect(Wootook::getStaticUrl('install/index.php', array('mode' => 'summary'))); - $response->sendHeaders(); - exit(0); - /*/ - if ($request->isPost()) { - $session->setData('step', $step); - $response->setRedirect("?mode=install&step={$nextStep}"); - $response->sendHeaders(); - exit(0); - } - - $layout->getMessagesBlock()->prepareMessages('install'); - $layout->load('install.step.config'); - //*/ - break; - } - break; -case 'summary': - $layout->load('install.summary'); - $layout->getMessagesBlock()->prepareMessages('install'); - break; -} -echo $layout->render(); diff --git a/src/language/en/admin/banned.mo b/src/language/en/admin/banned.mo deleted file mode 100644 index 01f6d62..0000000 --- a/src/language/en/admin/banned.mo +++ /dev/null @@ -1,49 +0,0 @@ - - * Copyright (c) 2011-Present, Wootook Contributors - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - - -$lang['ip_ban_sys'] = 'IP banning system'; -$lang['nr'] = 'Number'; -$lang['IP'] = 'IP'; -$lang['cause'] = 'Reason'; -$lang['ban_time'] = 'Duration'; -$lang['ip_ban'] = 'IP Ban'; -$lang['add_ip_ban_ok'] = 'The IP address %s was successfully banned.'; -$lang['add_ip_ban'] = 'Add IP address'; -$lang['addb'] = 'Add'; -$lang['rem_ip_ban_ok'] = 'The IP address %s was successfully removed.'; -$lang['rem_ip_ban'] = 'Remove IP address'; -$lang['remb'] = 'Remove'; -$lang['error'] = 'Error'; -$lang['add_no_ip'] = 'You should add at least one IP address'; -$lang['rem_no_ip'] = 'You should select which IP address to remove'; -$lang['no_admin'] = 'You are not an administrator or you dont have the right permissions.'; -?> \ No newline at end of file diff --git a/src/language/en/admin/server.mo b/src/language/en/admin/server.mo deleted file mode 100644 index df07596..0000000 --- a/src/language/en/admin/server.mo +++ /dev/null @@ -1,36 +0,0 @@ - - * Copyright (c) 2011-Present, Wootook Contributors - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -$lang['server_information'] = 'Server information'; -$lang['serverip'] = 'Server IP address'; -$lang['server_software'] ='Server software'; -$lang['server_system'] = ' Server operating system'; -$lang['php_version'] = 'PHP version'; diff --git a/src/language/en/announce.mo b/src/language/en/announce.mo deleted file mode 100644 index 3a19f0b..0000000 --- a/src/language/en/announce.mo +++ /dev/null @@ -1,52 +0,0 @@ - - * Copyright (c) 2011-Present, Wootook Contributors - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -$lang['add_announce'] = 'Add an trade'; -$lang['metal'] = 'Metal'; -$lang['crystal'] = 'Crystal'; -$lang['deuterium'] = 'Deuterium'; -$lang['Resources_to_be_sold'] = 'Resources to be sold'; -$lang['Desired_resources'] = 'Wanted resources'; -$lang['send'] = 'Send'; -$lang['Your_announce_was_recorded'] = 'Your trade was sent successfully'; -$lang['return_to_announce'] = 'Return to trade'; -$lang['Classifieds'] = 'Published trade'; -$lang['Action'] = 'Action'; -$lang['Galaxy'] = 'Galaxy'; -$lang['Solar_system'] = 'Solar system'; -$lang['Infos_of_delivery'] = 'trader information'; -$lang['Salesman'] = 'User'; -$lang['Delete'] = 'Delete'; -$lang['announce_status'] = 'Announce status'; -$lang['Your_announce_not_recorded'] = 'Your trade was not sent'; -$lang['Your_announce_was_deleted'] = 'Your trade was successfully deleted'; - -?> diff --git a/src/language/en/lang_info.cfg b/src/language/en/lang_info.cfg deleted file mode 100644 index 127828b..0000000 --- a/src/language/en/lang_info.cfg +++ /dev/null @@ -1,34 +0,0 @@ - - * Copyright (c) 2011-Present, Wootook Contributors - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - - -$langInfos['ENCODING'] = 'UTF-8'; -$langInfos['DIRECTION'] = 'http://wootook.org/'; diff --git a/src/language/en/supp.mo b/src/language/en/supp.mo deleted file mode 100644 index 0ca8f96..0000000 --- a/src/language/en/supp.mo +++ /dev/null @@ -1,52 +0,0 @@ - - * Copyright (c) 2011-Present, Wootook Contributors - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -$lang['supp_header'] = "Suport"; -$lang['ticket_id'] = "#Ticket-ID"; -$lang['subject'] = "Subject"; -$lang['status'] = "Status"; -$lang['ticket_posted'] = "Posted in:"; -$lang['ticket_new'] = "New Ticket"; -$lang['input_text'] = "Problem description:"; -$lang['answer_new'] = "Answer:"; -$lang['text'] = "Text:"; -$lang['message_a'] = "Message status:"; -$lang['sendit_a'] = "Your message was sent"; -$lang['message_t'] = "Ticket status:"; -$lang['sendit_t'] = "The ticket was sent."; -$lang['close_t'] = "The ticket was closed."; -$lang['sendit_error'] = "Error:"; -$lang['sendit_error_msg'] = "You didnt fill all the data!"; -$lang['supp_admin_system'] = "Support System Administration"; -$lang['close_ticket'] = "Close Ticket"; -$lang['player'] = "Player"; -$lang['input_text'] = "Send"; - diff --git a/src/medias/klore/images/building/alliance-depot.jpg b/src/medias/klore/images/building/alliance-depot.jpg deleted file mode 100644 index e7b7f7f..0000000 Binary files a/src/medias/klore/images/building/alliance-depot.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/cristal-mine.jpg b/src/medias/klore/images/building/cristal-mine.jpg deleted file mode 100644 index fcdf957..0000000 Binary files a/src/medias/klore/images/building/cristal-mine.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/cristal-storage.jpg b/src/medias/klore/images/building/cristal-storage.jpg deleted file mode 100644 index 777707c..0000000 Binary files a/src/medias/klore/images/building/cristal-storage.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/deuterium-syntherizer.jpg b/src/medias/klore/images/building/deuterium-syntherizer.jpg deleted file mode 100644 index 31f2637..0000000 Binary files a/src/medias/klore/images/building/deuterium-syntherizer.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/deuterium-tank.jpg b/src/medias/klore/images/building/deuterium-tank.jpg deleted file mode 100644 index 7908e9f..0000000 Binary files a/src/medias/klore/images/building/deuterium-tank.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/fusion-reactor.jpg b/src/medias/klore/images/building/fusion-reactor.jpg deleted file mode 100644 index e4e28ee..0000000 Binary files a/src/medias/klore/images/building/fusion-reactor.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/jump-gate.jpg b/src/medias/klore/images/building/jump-gate.jpg deleted file mode 100644 index df95db9..0000000 Binary files a/src/medias/klore/images/building/jump-gate.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/lunar-base.jpg b/src/medias/klore/images/building/lunar-base.jpg deleted file mode 100644 index 7345110..0000000 Binary files a/src/medias/klore/images/building/lunar-base.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/metal-mine.jpg b/src/medias/klore/images/building/metal-mine.jpg deleted file mode 100644 index b11c616..0000000 Binary files a/src/medias/klore/images/building/metal-mine.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/metal-storage.jpg b/src/medias/klore/images/building/metal-storage.jpg deleted file mode 100644 index 9199a8a..0000000 Binary files a/src/medias/klore/images/building/metal-storage.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/missile-silo.jpg b/src/medias/klore/images/building/missile-silo.jpg deleted file mode 100644 index cc59a21..0000000 Binary files a/src/medias/klore/images/building/missile-silo.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/nanite-factory.jpg b/src/medias/klore/images/building/nanite-factory.jpg deleted file mode 100644 index c15b9c5..0000000 Binary files a/src/medias/klore/images/building/nanite-factory.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/research-lab.jpg b/src/medias/klore/images/building/research-lab.jpg deleted file mode 100644 index bbabfa6..0000000 Binary files a/src/medias/klore/images/building/research-lab.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/robotic-factory.jpg b/src/medias/klore/images/building/robotic-factory.jpg deleted file mode 100644 index 83f1ec0..0000000 Binary files a/src/medias/klore/images/building/robotic-factory.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/sensor-phalanx.jpg b/src/medias/klore/images/building/sensor-phalanx.jpg deleted file mode 100644 index 03f3031..0000000 Binary files a/src/medias/klore/images/building/sensor-phalanx.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/shipyard.jpg b/src/medias/klore/images/building/shipyard.jpg deleted file mode 100644 index 2d81393..0000000 Binary files a/src/medias/klore/images/building/shipyard.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/solar-plant.jpg b/src/medias/klore/images/building/solar-plant.jpg deleted file mode 100644 index 23e9d59..0000000 Binary files a/src/medias/klore/images/building/solar-plant.jpg and /dev/null differ diff --git a/src/medias/klore/images/building/terraformer.jpg b/src/medias/klore/images/building/terraformer.jpg deleted file mode 100644 index e12efdd..0000000 Binary files a/src/medias/klore/images/building/terraformer.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/antiballistic-missile.jpg b/src/medias/klore/images/defense/antiballistic-missile.jpg deleted file mode 100644 index f35eb79..0000000 Binary files a/src/medias/klore/images/defense/antiballistic-missile.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/gauss-canon.jpg b/src/medias/klore/images/defense/gauss-canon.jpg deleted file mode 100644 index 7540d90..0000000 Binary files a/src/medias/klore/images/defense/gauss-canon.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/heavy-laser.jpg b/src/medias/klore/images/defense/heavy-laser.jpg deleted file mode 100644 index 870f852..0000000 Binary files a/src/medias/klore/images/defense/heavy-laser.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/interplanetary-missile.jpg b/src/medias/klore/images/defense/interplanetary-missile.jpg deleted file mode 100644 index a037494..0000000 Binary files a/src/medias/klore/images/defense/interplanetary-missile.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/ion-canon.jpg b/src/medias/klore/images/defense/ion-canon.jpg deleted file mode 100644 index 6885f94..0000000 Binary files a/src/medias/klore/images/defense/ion-canon.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/large-shield-dome.jpg b/src/medias/klore/images/defense/large-shield-dome.jpg deleted file mode 100644 index 52b93f0..0000000 Binary files a/src/medias/klore/images/defense/large-shield-dome.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/light-laser.jpg b/src/medias/klore/images/defense/light-laser.jpg deleted file mode 100644 index 541b22e..0000000 Binary files a/src/medias/klore/images/defense/light-laser.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/plasma-turret.jpg b/src/medias/klore/images/defense/plasma-turret.jpg deleted file mode 100644 index e0a14a2..0000000 Binary files a/src/medias/klore/images/defense/plasma-turret.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/rocket-launcher.jpg b/src/medias/klore/images/defense/rocket-launcher.jpg deleted file mode 100644 index d1eebc5..0000000 Binary files a/src/medias/klore/images/defense/rocket-launcher.jpg and /dev/null differ diff --git a/src/medias/klore/images/defense/small-shield-dome.jpg b/src/medias/klore/images/defense/small-shield-dome.jpg deleted file mode 100644 index 74d8744..0000000 Binary files a/src/medias/klore/images/defense/small-shield-dome.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/battlecruiser.jpg b/src/medias/klore/images/ship/battlecruiser.jpg deleted file mode 100644 index 51e8b34..0000000 Binary files a/src/medias/klore/images/ship/battlecruiser.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/battleship.jpg b/src/medias/klore/images/ship/battleship.jpg deleted file mode 100644 index 395caff..0000000 Binary files a/src/medias/klore/images/ship/battleship.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/bomber.jpg b/src/medias/klore/images/ship/bomber.jpg deleted file mode 100644 index e0bbe5c..0000000 Binary files a/src/medias/klore/images/ship/bomber.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/colony-ship.jpg b/src/medias/klore/images/ship/colony-ship.jpg deleted file mode 100644 index 2f932ea..0000000 Binary files a/src/medias/klore/images/ship/colony-ship.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/cruiser.jpg b/src/medias/klore/images/ship/cruiser.jpg deleted file mode 100644 index 97729cd..0000000 Binary files a/src/medias/klore/images/ship/cruiser.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/death-star.jpg b/src/medias/klore/images/ship/death-star.jpg deleted file mode 100644 index 453372a..0000000 Binary files a/src/medias/klore/images/ship/death-star.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/destructor.jpg b/src/medias/klore/images/ship/destructor.jpg deleted file mode 100644 index aac6d6b..0000000 Binary files a/src/medias/klore/images/ship/destructor.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/heavy-fighter.jpg b/src/medias/klore/images/ship/heavy-fighter.jpg deleted file mode 100644 index 4fbb6e7..0000000 Binary files a/src/medias/klore/images/ship/heavy-fighter.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/large-transport.jpg b/src/medias/klore/images/ship/large-transport.jpg deleted file mode 100644 index aba4772..0000000 Binary files a/src/medias/klore/images/ship/large-transport.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/light-fighter.jpg b/src/medias/klore/images/ship/light-fighter.jpg deleted file mode 100644 index e59a213..0000000 Binary files a/src/medias/klore/images/ship/light-fighter.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/light-transport.jpg b/src/medias/klore/images/ship/light-transport.jpg deleted file mode 100644 index ceb9434..0000000 Binary files a/src/medias/klore/images/ship/light-transport.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/ore-miner.jpg b/src/medias/klore/images/ship/ore-miner.jpg deleted file mode 100644 index e83a7ec..0000000 Binary files a/src/medias/klore/images/ship/ore-miner.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/recycler.jpg b/src/medias/klore/images/ship/recycler.jpg deleted file mode 100644 index 046617d..0000000 Binary files a/src/medias/klore/images/ship/recycler.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/solar-satellite.jpg b/src/medias/klore/images/ship/solar-satellite.jpg deleted file mode 100644 index af690e5..0000000 Binary files a/src/medias/klore/images/ship/solar-satellite.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/spy-drone.jpg b/src/medias/klore/images/ship/spy-drone.jpg deleted file mode 100644 index bb9b3fd..0000000 Binary files a/src/medias/klore/images/ship/spy-drone.jpg and /dev/null differ diff --git a/src/medias/klore/images/ship/supernova.jpg b/src/medias/klore/images/ship/supernova.jpg deleted file mode 100644 index 3ebb876..0000000 Binary files a/src/medias/klore/images/ship/supernova.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/armour.jpg b/src/medias/klore/images/technology/armour.jpg deleted file mode 100644 index 1028560..0000000 Binary files a/src/medias/klore/images/technology/armour.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/combustion-drive.jpg b/src/medias/klore/images/technology/combustion-drive.jpg deleted file mode 100644 index 3711874..0000000 Binary files a/src/medias/klore/images/technology/combustion-drive.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/computer.jpg b/src/medias/klore/images/technology/computer.jpg deleted file mode 100644 index 01bca1b..0000000 Binary files a/src/medias/klore/images/technology/computer.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/energy.jpg b/src/medias/klore/images/technology/energy.jpg deleted file mode 100644 index 08049f6..0000000 Binary files a/src/medias/klore/images/technology/energy.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/espionnage.jpg b/src/medias/klore/images/technology/espionnage.jpg deleted file mode 100644 index 81201c5..0000000 Binary files a/src/medias/klore/images/technology/espionnage.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/expedition.jpg b/src/medias/klore/images/technology/expedition.jpg deleted file mode 100644 index 0cbee64..0000000 Binary files a/src/medias/klore/images/technology/expedition.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/graviton.jpg b/src/medias/klore/images/technology/graviton.jpg deleted file mode 100644 index 68fac77..0000000 Binary files a/src/medias/klore/images/technology/graviton.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/hyperspace-drive.jpg b/src/medias/klore/images/technology/hyperspace-drive.jpg deleted file mode 100644 index fa8f4cd..0000000 Binary files a/src/medias/klore/images/technology/hyperspace-drive.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/hyperspace-technology.jpg b/src/medias/klore/images/technology/hyperspace-technology.jpg deleted file mode 100644 index 343cea3..0000000 Binary files a/src/medias/klore/images/technology/hyperspace-technology.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/impulse-drive.jpg b/src/medias/klore/images/technology/impulse-drive.jpg deleted file mode 100644 index 085ed02..0000000 Binary files a/src/medias/klore/images/technology/impulse-drive.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/intergalactic-research-network.jpg b/src/medias/klore/images/technology/intergalactic-research-network.jpg deleted file mode 100644 index 39a2821..0000000 Binary files a/src/medias/klore/images/technology/intergalactic-research-network.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/interplanetary-missile.jpg b/src/medias/klore/images/technology/interplanetary-missile.jpg deleted file mode 100644 index a037494..0000000 Binary files a/src/medias/klore/images/technology/interplanetary-missile.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/ion.jpg b/src/medias/klore/images/technology/ion.jpg deleted file mode 100644 index ad65150..0000000 Binary files a/src/medias/klore/images/technology/ion.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/laser.jpg b/src/medias/klore/images/technology/laser.jpg deleted file mode 100644 index 4cdbf1f..0000000 Binary files a/src/medias/klore/images/technology/laser.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/ore-mining.jpg b/src/medias/klore/images/technology/ore-mining.jpg deleted file mode 100644 index a10af80..0000000 Binary files a/src/medias/klore/images/technology/ore-mining.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/plasma.jpg b/src/medias/klore/images/technology/plasma.jpg deleted file mode 100644 index 15baf33..0000000 Binary files a/src/medias/klore/images/technology/plasma.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/shielding.jpg b/src/medias/klore/images/technology/shielding.jpg deleted file mode 100644 index 070f02a..0000000 Binary files a/src/medias/klore/images/technology/shielding.jpg and /dev/null differ diff --git a/src/medias/klore/images/technology/weaponry.jpg b/src/medias/klore/images/technology/weaponry.jpg deleted file mode 100644 index 16ef740..0000000 Binary files a/src/medias/klore/images/technology/weaponry.jpg and /dev/null differ diff --git a/src/skin/backend/base/default/css/base.css b/src/skin/backend/base/default/css/base.css deleted file mode 100644 index ef5c189..0000000 --- a/src/skin/backend/base/default/css/base.css +++ /dev/null @@ -1,37 +0,0 @@ -@CHARSET "UTF-8"; - -* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;} -body,html {margin:0;background:#DEDEDE;} -h1 {font-size:2.3em;/*border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;text-align:center;color:#58939f;background:#EEE;*/} -/*h1:hover {color:#6AB;background:#CCC;}*/ -h2,h3 {text-decoration:underline;font-weight:bold;} -h4,h5,h6 {font-style:italic;} -h2 {font-size:2em;} -h3 {font-size:1.8em;} -h4 {font-size:1.5em;} -h5 {font-size:1.6em;} -h6 {font-size:1em;} - -input[type=text],input[type=password] {height:2em;border:#58939f 0 solid;border-width:.1em 1em;} -input[type=submit],input[type=button] {height:2em;border:#58939f 0 solid;border-width:.1em 1em;} - -.global {} - -.global .header .navigation-container {width:100%;margin:0;height:60px;background-color:#58939f;background-image:linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-moz-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-o-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-webkit-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-ie-linear-gradient(center top, #58939F 0, #78B3BF 55px);} -.global .header .navigation {margin:0 auto;width:600px;height:60px;display:block;padding:0 30px;position:relative;} -.global .header .navigation .last {float:left;width:100%;} -.global .header .navigation .navigation-node {margin:0 0 5px;height:30px;width:120px;color:#FFF;float:left;border-radius:15px;} -.global .header .navigation .navigation-node:hover,.global .header .navigation .navigation-node.hover {background:#666;} -.global .header .navigation .navigation-node .title {margin:5px 20px 8px;font-size:1.5em;text-align:center;} -.global .header .navigation .navigation-links {display:none;margin:0;width:600px;float:left;border:none;} -.global .header .navigation .navigation-link {margin:0;float:left;padding:5px 0;color:#FFF;} -.global .header .navigation .navigation-link a {color:#FFF;text-decoration:none;border-radius:10px;padding:2px 10px;} -.global .header .navigation .navigation-link a:hover {color:#000;background:#FFF;} - -.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #58939f inset, 20px 20px 40px #58939f, -20px 20px 40px #58939f, 0 -20px 40px #58939f;} -.global .content form.form h1 {font-size:2em;} -.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;} -.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;} -.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;} -.global .content form.form input {width:150px;display:block;margin:10px auto;} -.global .content form.form fieldset p input {width:100px;display:block;} diff --git a/src/skin/backend/base/default/css/deprecated/styles.css b/src/skin/backend/base/default/css/deprecated/styles.css deleted file mode 100644 index c81e320..0000000 --- a/src/skin/backend/base/default/css/deprecated/styles.css +++ /dev/null @@ -1,543 +0,0 @@ -/** - * This file is part of Wootook - * - * @license http://www.gnu.org/licenses/gpl-3.0.txt -* @see http://www.wootook.com/ - * - * Copyright (c) 2009-Present, XNova Support Team - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -body { - background-color:#000000; - background-repeat: no-repeat; - text-align: center; - font-family:Arial, Helvetica, sans-serif; -} - -a { - color:#666666; - text-decoration: none; -} -a:hover { - color:#ffffff; -} - -#main { - margin: -8px 0px 0px 0px; - position: relative; - width: 886px; - height: 580px; - background-image: url(../graphics/images/tlo.jpg); - background-repeat: none; - -} - -#mainmenu { - position: absolute; - left: 270px; - top: 364px; - font-size: 12px; - font-weight: bold; - color:#b1daf2; - text-align: left; - width: 127px; -} - - - -#login { - position: absolute; - left: 400px; - top: 457px; - width: 450px; - height: 125px; - z-index:10; -} - -.rightmenu_big { - position: absolute; - left: 400px; - top: 70px; - width: 450px; - height: 384px; - z-index:1; -} - -.rightmenu_register { - position: absolute; - left: 400px; - top: 70px; - width: 450px; - height: 384px; -} - -.rightmenu { - position: absolute; - left: 400px; - top: 250px; - width: 450px; - height: 205px; - z-index:1; -} - -#link { - cursor: pointer; -} - -#title { - position: absolute; - left: 25px; - top: 9px; - font-family:Arial, Helvetica, sans-serif; - font-size: 21px; - font-weight: bold; - color: #b1daf2; - text-align: center; - width: 400px; -} - -#content { - position: absolute; - left: 25px; - top: 50px; - font-family:Arial, Helvetica, sans-serif; - font-size: 12px; - - color:#b1daf2; - text-align: left; - width: 400px; -} - -#contentscroll { - overflow: auto; - height: 320px; - width: 405px; - - padding-right: 10px; - -} - -#register { - position: absolute; - left: 0px; - top: 60px; - width: 400px; - height:26px; - padding-top:10px; -} - -#register:hover { - color:#ffffff; -} - -#text2 { - position: absolute; - left: 0px; - top: 120px; - font-family:Arial, Helvetica, sans-serif; - font-size: 12px; - color:#b1daf2; - text-align: left; - width: 400px; - -} - -#login_input { - position: absolute; - left: 25px; - top: 21px; - font-family:Arial, Helvetica, sans-serif; - font-size: 10px; - color:#b1daf2; - text-align: left; - width: 400px; - right: 25px; - height: 90px; -} - -#login_text_1 { - position: absolute; - top: 11px; - left: 0px; - font-family:Arial, Helvetica, sans-serif; - font-size: 9px; - color:#666666; - text-align: left; - width: 440px; -} - -#login_text_2 { - position: absolute; - top: 30px; - left: 0px; - font-family:Arial, Helvetica, sans-serif; - font-size: 9px; - color:#666666; - text-align: left; - width: 440px; -} - - -#downmenu { - position: absolute; - top: 110px; - left: 270px; - font-size: 10px; - color:#666666; - text-align: right; - width: 169px; -} - -#copyright { - position: absolute; - top: 110px; - left: -100px; - font-size: 10px; - color:#666666; - text-align: left; - width: 370px; -} - -.image { - padding-bottom: 10px; -} - -.eingabe{ - border:1px solid #000000; - background:#ffffff; - color: #000000; - font-size:10px; - -} -.menupoint { - /*width:10px;*/ - /* height:4px; */ - padding-top:2px; - padding-bottom:1px; - padding-left:10px; - background-repeat: no-repeat; - background-position: left center; -} - -.link { - cursor: pointer; -} -.link:hover { - color:#ffffff; -} - -#mainmenu a { - padding-left:10px; - padding-top:2px; - padding-bottom:1px; - color:#b1daf2; - text-decoration: none; - display: block; - -} - -#mainmenu span { - display: block; -} - -#login_input a { - color:#cccccc; - text-decoration: none; -} -#login_input a:hover { - color:#ffffff; -} - - -#mainmenu a:hover { - color:#ffffff; -} - -.products { - position:relative; - width:886px; - top:23px; - height:30px; - font-family:Arial, Helvetica, sans-serif; - margin:0 auto; - font-size: 10px; - color:#b5cfcd; -} - -img { - border: 1px solid #516274; -} - - -img:hover { - /* border: 1px solid #ffffff;*/ -} - -a img:hover { - border: 1px solid #ffffff; -} - -.products { - /* display:none;*/ -} - -.products img { - color:#516274; - border-width: 1px; - height: 12px; - width: 18px; -} - - -.products a { - color:#b5cfcd; - text-decoration: none; -} -.products a:hover { - color:#ffffff; -} - -#headerselect { - border:1px double #000000; - background:#595f71; - color: #dddddd; - font-size:10px; -} - -#register_container { - position: absolute; - top: 80px; - left: 10px; - width:380px; - height:300px; -} - -#infotext { - position: absolute; - top: 210px; - width:400px; -} - -#statustext { - position: absolute; - top: 260px; - width:400px; -} - -#register_submit { - position: absolute; - top: 286px; - left:75px; - width:250px; - padding-top: 4px; - height:20px; - font-family:Arial, Helvetica, sans-serif; - font-size: 13px; - text-align: center; - font-weight: bold; - color:#497ec7; - cursor: pointer; -} - -#register_submit:hover { - color:#ffffff; -} - - -table { - text-align: right; - color:#CCCCCC; - font-size: 10px; -} - -td .eingabe { - width: 120px; - text-align:left; -} - -.bigbutton { - font-family:Arial, Helvetica, sans-serif; - font-size: 16px; - text-align: center; - font-weight: bold; - color:#497ec7; - cursor: pointer; -} - -.bigbutton:hover { - color:#ffffff; -} - -.warning { - color:#ff7876; -} - -.fine { - color:#00ff00; -} - -.register_agb { - color:#cccccc; -} - -.register_agb:hover { - color:#ffffff; -} - -.headline { - text-align:center; - font-weight:bold; - font-size:14px; -} - -#gimmik_1 { - width:100px; - height:50px; - top:100px; - left:100px; -} - -#gimmik_2 { - width:50px; - height:50px; - top:200px; - left:100px; -} - -.iframe { - border:none; - - width:100%; - height:27px; -} - -.loginButton { - padding-top:2px; - padding-left:5px; -} - - -.loginButton:hover { - padding-top:2px; - padding-left:5px; -} - -.bildUeberschrift { - font-family:Arial, Helvetica, sans-serif; - font-size: 10px; - color:#b1daf2; -} - -#unis_content { - padding-left:70px; - padding-top:10px; -} - -#unis_content a { - display: block; - color:#878787; -} - -#unis_content a:hover { - color:#ffffff; -} - -#unis_title2 { - padding-top:25px; - padding-bottom:3px; - width:380px; - font-size:14px; - font-weight:bold; - border-bottom-style:solid; - border-bottom-width:1px; - border-bottom-color:#2a2f33; -} - -#closed_uni { - color:#535353; -} - - -#uni_infos_link { - text-align:left; - width:200px; - padding-top:3px; -} - -#uni_infos_link a { - color:#878787; -} - -#uni_infos_link a:hover { - color:#ffffff; -} - -#uni_label { - vertical-align:top; - padding-top:3px; -} - -.table_lable { - -} - -.table_input { - text-align:left; - padding-left:3px; -} - -#table_agb { - text-align:left; -} - -#agb_zeile { - -} - -input, select, textarea -{ - border : 1px #545454 solid; - font-size : 10px; - font-family : Tahoma, sans-serif; -} - -th, td.a, td.b, td.c, td.f, input, select, td.g, -td.h, td.i, td.j, td.k, td.m, td.o, td.q, td.r, -td.v, td.s, .style td, p td -{ - background-color : #000000; - filter : alpha(opacity=70); - -moz-opacity : 0.7; - -khtml-opacity : 0.7; - opacity : 0.7; -} - -td.f, input, select, textarea -{ - color : #FFFFFF; - background-color : #1c1c1c; - filter : alpha(opacity=70); - -moz-opacity : 0.7; - -khtml-opacity : 0.7; - opacity : 0.7; -} diff --git a/src/skin/backend/base/default/css/legacies.css b/src/skin/backend/base/default/css/legacies.css deleted file mode 100644 index 08cee7b..0000000 --- a/src/skin/backend/base/default/css/legacies.css +++ /dev/null @@ -1,93 +0,0 @@ -@CHARSET "UTF-8"; - -* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;} -h1 {font-size:2em;/*border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;*/text-align:center;color:#156;/*background:#EEE;*/} -h1:hover {color:#6AB;background:#CCC;} -h2,h3 {text-decoration:underline;font-weight:bold;} -h4,h5,h6 {font-style:italic;} -h2 {font-size:2em;} -h3 {font-size:2em;} -h4 {font-size:2em;} -h5 {font-size:2em;} -h6 {font-size:2em;} - -input[type=text] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;} -input[type=submit] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;} - -.global .content .navigation {margin:0pt auto;width:1000px;height:30px;display:block;padding:0 40px;position:relative;border-width:0 1px;border-style:none solid;border-color:#FFF;background-color:#933;border-radius:10px;} -.global .content .navigation .navigation-node {margin:0;height:30px;width:250px;color:#FFF;float:left;} -.global .content .navigation .navigation-node .title {margin:5px 20px;font-size:1.5em;} -.global .content .navigation .navigation-link {display:none;margin:0pt 10px;width:200px;background-color:#FFF;float:left;padding:5px 10px;border:0 solid #933;border-left-width:4px;border-right-width:1px;} -.global .content .navigation .navigation-node .last {width:225px;margin:0 10px;float:left;display:none;border:0 solid #933;border-bottom-width:1px;} - -.global .content .planet-carrousel {width:950px;height:100px;margin:0 auto;padding:0 30px;color:#000;background:#FFF;border:1px solid #FFF;border-top:none;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;border-bottom-left-radius:50px;border-bottom-right-radius:50px;} -.global .content .planet-carrousel .items {width:900px;height:100px;overflow:hidden;float:left;} -.global .content .planet-carrousel .arrow {height:40px;width:25px;float:left;font-size:20px;font-weight:bold;margin:30px 0;} -.global .content .planet-carrousel div.planet {color:#000;height:100px;width:100px;float:left;} -.global .content .planet-carrousel .selected {background-color:#EFEFEF;box-shadow:0 -4px 6px #115566 inset, 0 20px 40px #115566;} -.global .content .planet-carrousel .planet a {color:#000;} -.global .content .planet-carrousel .planet img {border:0;margin:0;} -.global .content .planet-carrousel .planet a.moon img,.global .content .planet-carrousel .planet span.moon img {position:absolute;float:left;margin:0;border:1px solid #FFF;} -.global .content .planet-carrousel .planet .planet-name {text-align:center;margin:2px 5px} -.global .content .planet-carrousel .planet .planet-image {margin:0 25px;height:50px;} -.global .content .planet-carrousel .planet .planet-position {text-align:center;margin:2px 5px} - -.global .content .resources-display {width:770px;height:40px;margin:0 auto 30px;padding:0 50px;color:#000;background:#FFF;box-shadow:0 -4px 6px #115566 inset, 0 20px 40px #115566;border:1px solid #FFF;border-top:none;border-radius: 0 0 20px 20px;} -.global .content .resources-display .resource,.global .content .resources-display .messages {height:22px;float:left;width:140px;margin:7px 0;} -.global .content .resources-display .resource img,.global .content .resources-display .messages img {float:left;} -.global .content .resources-display .resource p,.global .content .resources-display .messages p {font-weight:bold;font-size:12px;margin:2px 0 2px 47px;} -.global .content .resources-display .resource a,.global .content .resources-display .messages a {color:#000;text-decoration:underline;} -.global .content .resources-display .resource .resource-capped {color:red;} -.global .content .resources-display .messages {height:22px;float:left;width:110px;} -.global .content .resources-display .energy {width:240px;} - -.global .content .queue {width:600px;margin:10px auto 0;background:#FFF;color:#000;border:1px solid #FFF;border-radius:5px;border-top-left-radius:20px;border-top-right-radius:20px;box-shadow:0 4px 6px #156 inset;} -.global .content .queue h1 {color:#000;margin:10px 15px;width:570px;text-align:center;border-bottom:5px solid #9BC;} - -.global .content .queue .item {width:580px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .queue .item,.global .content .queue .item * {color:#000;} - -.global .content .item-list {width:640px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:1px solid #FFF;border-radius:5px;border-top-left-radius:20px;border-top-right-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;} -.global .content .item-list h1 {width:320px;color:#FFF;border:3px solid #156;border-radius:20px;height:30px;margin:10px auto;background:#589;box-shadow:0 -4px 8px #156 inset,0 -2px 5px #000;font-size:2.3em;} -.global .content .item-list .item-container {width:190px;float:left;margin:10px;height:230px;border:1px solid #156;box-shadow:0 -4px 6px #156 inset, 2px 2px 5px #000;border-radius:10px;} -.global .content .item-list.countable .item-container {height:270px;} -.global .content .item-list .item {width:170px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .item-list .item h2 {margin-bottom:0;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {margin-top:0;} -.global .content .item-list .item h2,.global .content .item-list .item h2 * {font-size:1.1em;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {font-size:1em;color:gray;font-weight:bold;} -.global .content .item-list .item .image {margin:0 auto;width:120px;display:block;border-radius:60px;overflow:hidden;border:3px solid #156;box-shadow:0 4px 6px #156;} -.global .content .item-list .item,.global .content .item-list .item * {color:#000;} -.global .content .item-list .item .buy,.global .content .item-list .item .max,.global .content .item-list .item .qty {border:1px solid #156;border-radius:10px;height:20px;margin:20px 5px;background:#589;box-shadow:0 -4px 8px #156 inset,0 -2px 5px #000;} -.global .content .item-list .item .buy p,.global .content .item-list .item .buy p *,.global .content .item-list .item .max p,.global .content .item-list .item .max p * {margin:1px 0;text-align:center;font-size:1.2em;color:#FFF;} -.global .content .item-list .item .qty p {margin:0 auto;} -.global .content .item-list .item .qty p input {border:none;height:20px;margin:0 10px;color:#FFF;padding:0 10px;width:140px;text-align:center;} -.global .content .item-list .item .details {padding:5px 10px;border-radius:30px;box-shadow:0 4px 6px #156;width:300px;background:#FFF;z-index:999;display:none;position:relative;left:-30px;top:-10px;border:3px solid #156;} -.global .content .item-list .item .details ul {list-style:square inside;color:#156;padding-left:5px;} -.global .content .item-list .item .details ul li .cost {font-weight:bold;color:darkgreen;} -.global .content .item-list .item .details ul li .requirement {font-weight:bold;text-decoration:underline;} -.global .content .item-list .item .details ul li .capped {color:darkred;} -.global .content .item-list .item .details .time {color:gray;} -.global .content .item-list .clear {clear:left;height:50px;} - -.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #156 inset, 20px 20px 40px #156, -20px 20px 40px #115566, 0 -20px 40px #156;} -.global .content form.form h1 {font-size:2em;} -.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;} -.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;} -.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;} -.global .content form.form input {width:150px;display:block;margin:10px auto;} -.global .content form.form fieldset p input {width:100px;display:block;} - -.global .content .install {background:#FFF;width:600px;margin:10px auto;padding:20px;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;} - - -/** - * Galaxy user name display colors - */ -.allymember {color:lime;} -.noob {color:darkgreen;} -.strong {color:darkred;} -.vacation {color:lightblue;} -.inactive {color:grey;} -.longinactive {color:darkgrey;} -.banned {color:red;text-decoration:line-through;} diff --git a/src/skin/backend/base/default/js/fleet.js b/src/skin/backend/base/default/js/fleet.js deleted file mode 100644 index df6053e..0000000 --- a/src/skin/backend/base/default/js/fleet.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This file is part of Wootook - * - * @license http://www.gnu.org/licenses/gpl-3.0.txt -* @see http://www.wootook.com/ - * - * Copyright (c) 2009-Present, XNova Support Team - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -function Fleet(fleetArray) { - this._fleetArray = fleetArray; - - this.getMaximumSpeed = function() { - var max = 0; - - for (var shipId in this._fleetArray) { - document.getElementsByName('') - } - var msp = 1000000000; - for (i = 200; i < 220; i++) { - if (document.getElementsByName("ship[" + i + "]")[0]) { - if ((document.getElementsByName("speed[" + i + "]")[0].value * 1) >= 1 - && (document.getElementsByName("ship[" + i + "]")[0].value * 1) >= 1) { - msp = min(msp, document.getElementsByName("speed[" + i + "]")[0].value); - } - } - } - return(msp); - }; - - return this; -} diff --git a/src/skin/frontend/base/default/css/base.css b/src/skin/frontend/base/default/css/base.css deleted file mode 100644 index 38b8445..0000000 --- a/src/skin/frontend/base/default/css/base.css +++ /dev/null @@ -1,169 +0,0 @@ -@CHARSET "UTF-8"; - -* {font-size:1em;font-family:Arial,Tahoma,sans-serif;text-align:left;} -body {margin:0;font-size:10px;background:#EFEFEF;} -body.public {background:url("../graphics/background.jpg") no-repeat fixed right top;background-color:inherit;background-size:cover;} -h1 {font-size:2.3em;/*border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;text-align:center;color:#58939f;background:#EEE;*/} -/*h1:hover {color:#6AB;background:#CCC;}*/ -h2,h3 {text-decoration:underline;font-weight:bold;} -h4,h5,h6 {font-style:italic;} -h2 {font-size:2em;} -h3 {font-size:1.8em;} -h4 {font-size:1.5em;} -h5 {font-size:1.6em;} -h6 {font-size:1em;} - -input[type=text],input[type=password] {height:2em;border:#58939f 0 solid;border-width:.1em 1em;} -input[type=submit],input[type=button] {height:2em;border:#58939f 0 solid;border-width:.1em 1em;} - -.global {} - -.global .header .navigation-container {width:100%;margin:0;height:60px;background-color:#58939f;background-image:linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-moz-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-o-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-webkit-linear-gradient(center top, #58939F 0, #78B3BF 55px);background-image:-ie-linear-gradient(center top, #58939F 0, #78B3BF 55px);} -.global .header .navigation {margin:0 auto;width:600px;height:60px;display:block;padding:0 30px;position:relative;} -.global .header .navigation .last {float:left;width:100%;} -.global .header .navigation .navigation-node {margin:0 0 5px;height:30px;width:120px;color:#FFF;float:left;border-radius:15px;} -.global .header .navigation .navigation-node:hover,.global .header .navigation .navigation-node.hover {background:#666;} -.global .header .navigation .navigation-node .title {margin:5px 20px 8px;font-size:1.5em;text-align:center;} -.global .header .navigation .navigation-links {display:none;margin:0;width:600px;float:left;border:none;} -.global .header .navigation .navigation-link {margin:0;float:left;padding:5px 0;color:#FFF;} -.global .header .navigation .navigation-link a {color:#FFF;text-decoration:none;border-radius:10px;padding:2px 10px;} -.global .header .navigation .navigation-link a:hover {color:#000;background:#FFF;} - -.global .header .planet-carrousel {width:100%;height:110px;border:none;padding:0;color:#000;font-weight:bold;background:#FFF;} -.global .header .planet-carrousel .end {height:9px;border-bottom:1px solid #000;background-color:#58939F;background-image:linear-gradient(center top, #78B3BF 0, #58939F 5px);background-image:-moz-linear-gradient(center top, #78B3BF 0, #58939F 5px);background-image:-o-linear-gradient(center top, #78B3BF 0, #58939F 5px);background-image:-webkit-linear-gradient(center top, #78B3BF 0, #58939F 5px);background-image:-ie-linear-gradient(center top, #78B3BF 0, #58939F 5px);} -.global .header .planet-carrousel .items {width:900px;height:100px;overflow:hidden;margin:0 auto;} -.global .header .planet-carrousel div.planet {color:#000;height:100px;width:100px;float:left;} -.global .header .planet-carrousel .selected {background-color:#58939f;} -.global .header .planet-carrousel .selected * {color:#FFF;} -.global .header .planet-carrousel .planet a {color:#000;} -.global .header .planet-carrousel .planet img {border:0;margin:0;} -.global .header .planet-carrousel .planet a.moon img,.global .header .planet-carrousel .planet span.moon img {position:absolute;float:left;margin:0;border:1px solid #FFF;} -.global .header .planet-carrousel .planet .planet-name {text-align:center;margin:2px 5px} -.global .header .planet-carrousel .planet .planet-image {margin:0 25px;height:50px;} -.global .header .planet-carrousel .planet .planet-position {text-align:center;margin:2px 5px} - -.global .header .resources-display-container {height:40px;background:#FFF;width:100%;margin-bottom:50px;border-bottom:1px solid #58939f;} -.global .header .resources-display {width:770px;height:40px;margin:0 auto;padding:0 50px;color:#000;} -.global .header .resources-display .resource,.global .header .resources-display .messages {height:22px;float:left;width:140px;margin:7px 0;} -.global .header .resources-display .resource img,.global .header .resources-display .messages img {float:left;} -.global .header .resources-display .resource p,.global .header .resources-display .messages p {font-weight:bold;font-size:12px;margin:2px 0 2px 47px;} -.global .header .resources-display .resource a,.global .header .resources-display .messages a {color:#000;text-decoration:underline;} -.global .header .resources-display .resource .resource-capped {color:red;} -.global .header .resources-display .messages {height:22px;float:left;width:150px;} -.global .header .resources-display .energy {width:200px;} - -.global .content .message {width:740px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:10px solid #58939f;border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} -.global .content .message h1 {border-bottom:10px solid #58939f;height:30px;margin:10px;font-size:2.3em;} - -.global .content .queue {width:740px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:10px solid #58939f;border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} -.global .content .queue h1 {border-bottom:10px solid #58939f;height:30px;margin:10px;font-size:2.3em;} - -.global .content .queue .item {width:580px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .queue .item,.global .content .queue .item * {color:#000;} - -.global .content .item-list {width:740px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:10px solid #58939f;border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} -.global .content .item-list h1 {border-bottom:10px solid #58939f;height:30px;margin:10px;font-size:2.3em;} -.global .content .item-list .item-container {width:220px;float:left;margin:10px;height:250px;border:3px solid #58939f;} -.global .content .item-list.countable .item-container {height:290px;} -.global .content .item-list .title {height:60px;} -.global .content .item-list .item {width:200px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .item-list .item h2,.global .content .item-list .item h3 {text-decoration:none;} -.global .content .item-list .item h2 {margin-bottom:0;} -.global .content .item-list .item h3.class {margin-top:0;margin-bottom:0;font-size:1em;font-weight:bold;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {margin-top:0;} -.global .content .item-list .item h2,.global .content .item-list .item h2 * {font-size:1.2em;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {font-size:1em;color:#58939f;font-weight:bold;} -.global .content .item-list .item .image {margin:0 auto;width:120px;display:block;overflow:hidden;border:1px solid #58939f;} -.global .content .item-list .item .image img {margin:0;border:none;} -.global .content .item-list .item,.global .content .item-list .item * {color:#000;} -.global .content .item-list .item .buy,.global .content .item-list .item .max,.global .content .item-list .item .qty {border:1px solid #000;border-radius:3px;height:20px;margin:20px 10px;background:#666;cursor:pointer;} -.global .content .item-list .item .buy p,.global .content .item-list .item .buy p *,.global .content .item-list .item .max p,.global .content .item-list .item .max p * {margin:4px 0;text-align:center;font-size:1em;color:#FFF;text-decoration:none;} -.global .content .item-list .item .buy:hover,.global .content .item-list .item .buy.hover,.global .content .item-list .item .max:hover,.global .content .item-list .item .max.hover,.global .content .item-list .item .qty:hover,.global .content .item-list .item .qty.hover {background-color:#58939f;} -.global .content .item-list .item .unavailable,.global .content .item-list .item .unavailable:hover {background:#933;border-color:#D00;} -.global .content .item-list .item .unavailable p {color:#CCC;} -.global .content .item-list .item .qty p {margin:0 auto;} -.global .content .item-list .item .qty p input {border:none;height:20px;margin:0 10px;color:#FFF;padding:0 10px;width:158px;text-align:center;font-weight:bold;font-size:1.1em;} -.global .content .item-list .item .details {padding:5px 10px;border-radius:5px;width:300px;background:#FFF;z-index:999;display:none;position:relative;left:-30px;top:-10px;border:3px solid #58939f;border-left-width:15px;} -.global .content .item-list .item .details ul {list-style:square inside;color:#58939f;padding-left:5px;} -.global .content .item-list .item .details ul li .cost {font-weight:bold;color:darkgreen;} -.global .content .item-list .item .details ul li .requirement {font-weight:bold;text-decoration:underline;} -.global .content .item-list .item .details ul li .capped {color:darkred;} -.global .content .item-list .item .details .time {color:gray;} -.global .content .item-list .clear {clear:left;height:50px;} -.global .content .item-list input[type=submit] {margin:30px 220px 0;width:300px;height:45px;background:#F7A90F;border-radius:10px;font-weight:bold;font-family:Arial,sans-serif;font-variant:small-caps;font-style:oblique;border:2px solid #263D43;box-shadow:0 -8px 10px #D5640E inset, 0 2px 7px #58939F;color:#08335B;font-size:2em;text-align:center;} - -.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #58939f inset, 20px 20px 40px #58939f, -20px 20px 40px #58939f, 0 -20px 40px #58939f;} -.global .content form.form h1 {font-size:2em;} -.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;} -.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;} -.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;} -.global .content form.form input {width:150px;display:block;margin:10px auto;} -.global .content form.form fieldset p input {width:100px;display:block;} - -.global .content .install {background:#FFF;width:600px;margin:10px auto;padding:20px;border-radius:20px;box-shadow:0 -4px 8px #58939f inset, 20px 20px 40px #58939f, -20px 20px 40px #58939f, 0 -20px 40px #58939f;} - -/** - * Overview - */ - -.overview .global .container {width:740px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:10px solid #58939f;border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} -.overview .global .container h1 {border-bottom:10px solid #58939f;height:30px;margin:10px 10px 30px;font-size:2.3em;} -.overview .global .container .clear {clear:left;height:50px;} -.overview .global .container .item-container h2 {text-decoration:none;margin-bottom:0;font-size:1.3em;} -.overview .global .container .item-container h3 {text-decoration:none;margin-top:0;font-size:1em;color:#58939f;font-weight:bold;} -.overview .global .container .item-container {padding:10px;margin:10px;border:3px solid #58939f;background-color:#EFEFEF;border-radius:15px 3px 15px 3px;} - -.overview .global .container .left {width:250px;float:left;} -.overview .global .container .content {margin-left:250px;width:490px;} -.overview .global .container .left .item-container {width:200px;} -.overview .global .container .content .item-container {width:440px;} - -/** - * Public pages - */ -body.public-form {width:100%;height:100%;} -body.public-form .main-form {display:block;margin:0 auto;padding:0;width:300px;border-radius:5px;background:rgba(255,255,255,.8);border:5px solid #58939f;background-image:-moz-linear-gradient(top,#AAA 0,#FFF 100%);background-image:linear-gradient(top,#AAA 0,#FFF 100%);} -body.public-form #login-form {height:230px;} -body.public-form #lost-password-form {height:170px;} -body.public-form #register-form {height:390px;} -body.public-form .main-form fieldset {border:none;margin:0;padding:0;} -body.public-form #login-form fieldset legend, -body.public-form #lost-password-form fieldset legend {display:block;width:280px;height:30px;background:#58939f;color:#FFF;font-weight:bold;font-size:2em;padding:0 10px;margin-bottom:10px;} -body.public-form #register-form h1 {display:block;width:280px;height:30px;background:#58939f;color:#FFF;font-weight:bold;font-size:2em;padding:0 10px;margin:0 0 10px;} -body.public-form #register-form fieldset legend {display:block;width:280px;height:15px;font-weight:bold;font-size:1.5em;padding:0 10px;margin:10px 0 5px;} -body.public-form .main-form input[type="button"], -body.public-form .main-form input[type="text"], -body.public-form .main-form input[type="password"] {border-width:1px;} -body.public-form .main-form p.form {margin:0;padding:0;height:30px;width:300px;float:left;} -body.public-form .main-form p.lost-password {margin:0;padding:0;height:30px;width:300px;float:left;text-align:center;} -body.public-form .main-form p.form label {margin:0;padding:0 10px;text-align:right;width:150px;height:30px;float:left;display:block;} -body.public-form .main-form p.form input {margin:0;padding:0;width:120px;} -body.public-form .main-form p.checkbox input {margin:0;padding:0;width:20px;} -body.public-form .main-form p.submit input {margin:0 100px;padding:0;text-align:center;} -body.public-form #lost-password-form p.submit input {margin:0 75px;} - -body.public .content .public-topbar {background:#FFF;border-bottom:5px solid #000;margin:0;height:30px;padding:0 10px;width:100%;background:rgba(0,0,0,.1);} -body.public .content .public-topbar .container {margin:0 auto;width:780px;} -body.public .content .public-topbar .container span {height:25px;padding:5px 15px 0;display:block;float:left;height:25px;margin:0 5px;font-size:1.5em;font-weight:bold;} -body.public .content .public-topbar .container span:hover {background:rgba(94,175,239,0.3);border-radius:8px;} -body.public .content .public-topbar .container span a:hover {color:#000;} - -body.public-form .content .public-topbar {margin-bottom:150px;} - -body.public-form .main-form p.form input[type=submit], -button.register {height:45px;background:#F7A90F;border-radius:10px;font-weight:bold;font-family:Arial,sans-serif;font-variant:small-caps;font-style:oblique;border:2px solid #263D43;box-shadow:0 -8px 10px #D5640E inset, 0 2px 7px #58939F;color:#08335B;font-size:2em;text-align:center;} -button.register {margin:25px;margin-left:345px;width:400px;} -body.public-form .main-form p.form input[type=submit] {margin:10px 50px;width:200px;padding:5px 20px;} - -.global .content .home-block {width:740px;padding:10px 30px;margin:10px auto 0;background-color:rgba(255,255,255,.1);color:#FFF;border:10px solid rgba(88,147,159,.1);border-radius:10px;border-top-left-radius:30px;border-top-right-radius:30px;} - -/** - * Galaxy user name display colors - */ -.allymember {color:lime;} -.noob {color:darkgreen;} -.strong {color:darkred;} -.vacation {color:lightblue;} -.inactive {color:grey;} -.longinactive {color:darkgrey;} -.banned {color:red;text-decoration:line-through;} diff --git a/src/skin/frontend/base/default/css/deprecated/about.css b/src/skin/frontend/base/default/css/deprecated/about.css deleted file mode 100644 index 63a6120..0000000 --- a/src/skin/frontend/base/default/css/deprecated/about.css +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This file is part of Wootook - * - * @license http://www.gnu.org/licenses/gpl-3.0.txt -* @see http://www.wootook.com/ - * - * Copyright (c) 2009-Present, XNova Support Team - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing XNova. - * - */ - -.aboutParagraphHead{ - text-align:left; - font-weight:bold; - font-size:14px; -} -.storyParagraphHead{ - text-align:left; - font-weight:bold; - font-size:14px; -} - -.storyLink{ - font-size:12px; - color:#878787; - text-align:center; - display:block; -} - -.storyLink:hover{ - color:#FFFFFF; -} - -.joinLink{ -font-weight:bold; -font-size:14px; -color:#497ec7; -text-align:center; - display:block; -} - -.joinLink:hover{ - display:block; -font-weight:bold; -color:#FFFFFF; -} - -.imageLeft{ -float:left; -margin-right:10px; -margin-left:5px; -margin-bottom:10px; -} - -.imageRight{ -float:right; -margin-left:10px; -} -.imageFirst{ -float:right; -margin-left:10px; -margin-top:20px; -} - -.bigImage{ -margin-left:8px; -} \ No newline at end of file diff --git a/src/skin/frontend/base/default/css/deprecated/default.css b/src/skin/frontend/base/default/css/deprecated/default.css deleted file mode 100644 index b4820bc..0000000 --- a/src/skin/frontend/base/default/css/deprecated/default.css +++ /dev/null @@ -1,207 +0,0 @@ -.flight { -} - -.return { -} - -.holding { -} - -*.ownattack { - color: lime; -} - -.flight .ownattack a { - color: #E6EBFB; -} - -*.owncolony { - color: lime; -} - -.flight .owncolony a { - color: #E6EBFB; -} - -*.owndeploy { - color: lime; -} - -.flight .owndeploy a { - color: #E6EBFB; -} - -*.owndestroy { - color: gold; -} - -.flight .owndestroy a { - color: #E6EBFB; -} - -*.ownespionage { - color: orange; -} - -.flight .ownespionage a { - color: #E6EBFB; -} - -*.ownfederation { - color: 33CC00; -} - -.flight .ownfederation a { - color: #E6EBFB; -} - -*.ownharvest { - color: lime; -} - -.flight .ownharvest a { - color: #E6EBFB; -} - -*.ownhold { - color: #80a0C0; -} - -.flight .ownhold a { - color: #E6EBFB; -} - -*.ownmissile { - color: orange; -} - -.flight .ownmissile a { - color: #E6EBFB; -} - -*.owntransport { - color: lime; -} - -.flight .owntransport a { - color: #E6EBFB; -} - -*.attack { - color: red; -} - -.flight .attack a { - color: #E6EBFB; -} - -*.colony { - color: lime; -} - -.flight .colony a { - color: #E6EBFB; -} - -*.deploy { - color: lime; -} - -.flight .deploy a { - color: #E6EBFB; -} - -*.destroy { - color: gold; -} - -.flight .destroy a { - color: #E6EBFB; -} - -*.espionage { - color: red; -} - -.flight .espionage a { - color: #E6EBFB; -} - -*.federation { - color: CC0000; -} - -.flight .federation a { - color: #E6EBFB; -} - -*.harvest { - color: lime; -} - -.flight .harvest a { - color: #E6EBFB; -} - -*.hold { - color: #80a0C0; -} - -.flight .hold a { - color: #E6EBFB; -} - -*.missile { - color: red; -} - - -*.transport { - color: lime; -} - -.flight .transport a { - color: #E6EBFB; -} - -.flight .phalanx_fleet, .phalanx_fleet { - color: lime; -} - -.return .phalanx_fleet { - color: #3BB9FF; -} - -.success { - color: lime; -} - -.errormessage a { - text-decoration: underline; -} - -.error { - color: red; -} - -.warning { - color: orange; -} - -.notice { - color: yellow; -} - -.combatreport { - color: red; -} - -.espionagereport { - color: orange; -} - -.timeremaining { - color: orange; -} - - diff --git a/src/skin/frontend/base/default/css/deprecated/formate.css b/src/skin/frontend/base/default/css/deprecated/formate.css deleted file mode 100644 index 1152398..0000000 --- a/src/skin/frontend/base/default/css/deprecated/formate.css +++ /dev/null @@ -1,252 +0,0 @@ -/* -__ __ _ _ -\ \ / /| \ | | - \ V / | \| | _____ ____ _ - / \ | . ` |/ _ \ \ / / _` | -/ /^\ \| |\ | (_) \ V / (_| | -\/ \/\_| \_/\___/ \_/ \__,_| ------------ SKIN ------------- - -*/ - - -* {font-family:Arial,sans-serif;font-size:10px;} - -img {border:none;} -p table {border:none;} - -p td -{ - text-align : center; - font-size : 10px; - font-family : Arial,sans-serif; -} - -body.style {background-image:url("../../graphics/img/background1.jpg");} -body.style table {margin:0px;border:0 auto} -body form table th table input {width: 60px;} - -.content table {background-color:#FFFFFF;border:10px solid #58939F;border-radius:30px 30px 10px 10px;margin:0 auto 20px;padding:10px 30px;width:820px;} -.content table table {border:0;border-radius:0;padding:0;width:inherit;} - -th, td.a, td.b, td.c, td.f, td.g, td.h, td.i, -td.j, td.k, td.l, td.m, td.n, td.o, td.q, td.r, -td.v, .style td, p td, table.s th img -{ - border : 1px #545454 solid; -} - -input, select, textarea -{ - border : 1px #545454 solid; -} - -th,td.a,td.b,td.c,td.f,input,select,td.g,td.h,td.i,td.j,td.k,td.m,td.o,td.q,td.r,td.v,td.s,.style td,p td {background:#FFF;color:#000;} - -th -{ - text-align : center; - padding-left : 3px; - padding-right : 3px; -} - -td.a -{ - height : 39px; - text-align : center; -} - -td.b -{ - padding : 3px; -} - -td.c {font-weight:bold;padding:0 10px;background:#58939F;color:#FFF;font-size:1em;height:30px;} -td.c a,td.c a:visited {color:#FFF;} -td.c a:hover {color:#CDF;} - -td.f{color:#FFF;background-color:#1c1c1c;} - -input,select,textarea {color:#FFF;background-color:#1c1c1c;} - -textarea {width:100%;} - -td.k input -{ - text-align : left; -} - -td.g -{ - font-weight : bold; - text-align : right; - color : #FFFFFF; -} - -td.h -{ - text-align : center; - color : #FFFFFF; -} - -td.i -{ - text-align : center; - color : #FFFFFF; -} - -td.j -{ - text-align : center; - color : #FFFFFF; -} - -td.k, td.k input -{ - text-align : center; - color : #FFFFFF; -} - -td.l {background-color:#FFF;color:#000;vertical-align:top;padding:3px;text-align:center;} - -td.m -{ - font-weight : bold; - text-align : right; - width : 86px; - color : #FFFFFF; -} - -td.n -{ - font-weight : bold; - text-align : right; - width : 89px; - text-align : center; - color : #FFFFFF; -} - -td.o -{ - text-align : center; - color : #FFFFFF; -} - -td.q -{ - font-weight : bold; - font-size : 10px; - font-family : Arial,sans-serif; - text-align : center; - vertical-align : middle; - color : #FFFFFF; -} - -td.r -{ - text-align : right; - color : #FFFFFF; -} - -td.v -{ - font-weight : bold; - text-align : right; - color : #f7f7f7; -} - -td.s -{ - color : #FFFFFF; -} - -table.s th -{ - border : 0px; -} - -table.s th img -{ - width : 89px; - height : 89px; -} - -div.z -{ - font-size : 10px; - font-weight : bold; - color : #000; -} - -a -{ - color : #000; - text-decoration : none; - font-weight : bold; -} - -a.s -{ - color : #000; -} - -a.t -{ - color : #000; -} - -a:hover -{ - color : #CDD7F8; - text-decoration : underline; -} - -.style td -{ - color : #FFFFFF; - border-top : 0px; - font-size : 10px; - font-family : Arial,sans-serif; -} - -.style div a -{ - padding-left : 7px; - height : 100%; - width : 100%; - font-size : 10px; - font-family : Arial,sans-serif; -} - -.style div a:link -{ - height : 100%; - width : 100%; - font-size : 10px; - font-family : Arial,sans-serif; -} - -.style div a:visited -{ - height : 100%; - width : 100%; - font-size : 10px; - font-family : Arial,sans-serif; -} - -.style div a:hover -{ - background-image : url("../../graphics/img/link.gif"); - background-repeat : no-repeat; - background-position : left; - height : 100%; - width : 108px; - text-decoration : none; - font-size : 10px; - font-family : Arial,sans-serif; -} - -.style -{ - margin-top : 10px; -} \ No newline at end of file diff --git a/src/skin/frontend/base/default/css/legacies.css b/src/skin/frontend/base/default/css/legacies.css deleted file mode 100644 index 08cee7b..0000000 --- a/src/skin/frontend/base/default/css/legacies.css +++ /dev/null @@ -1,93 +0,0 @@ -@CHARSET "UTF-8"; - -* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;} -h1 {font-size:2em;/*border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;*/text-align:center;color:#156;/*background:#EEE;*/} -h1:hover {color:#6AB;background:#CCC;} -h2,h3 {text-decoration:underline;font-weight:bold;} -h4,h5,h6 {font-style:italic;} -h2 {font-size:2em;} -h3 {font-size:2em;} -h4 {font-size:2em;} -h5 {font-size:2em;} -h6 {font-size:2em;} - -input[type=text] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;} -input[type=submit] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;} - -.global .content .navigation {margin:0pt auto;width:1000px;height:30px;display:block;padding:0 40px;position:relative;border-width:0 1px;border-style:none solid;border-color:#FFF;background-color:#933;border-radius:10px;} -.global .content .navigation .navigation-node {margin:0;height:30px;width:250px;color:#FFF;float:left;} -.global .content .navigation .navigation-node .title {margin:5px 20px;font-size:1.5em;} -.global .content .navigation .navigation-link {display:none;margin:0pt 10px;width:200px;background-color:#FFF;float:left;padding:5px 10px;border:0 solid #933;border-left-width:4px;border-right-width:1px;} -.global .content .navigation .navigation-node .last {width:225px;margin:0 10px;float:left;display:none;border:0 solid #933;border-bottom-width:1px;} - -.global .content .planet-carrousel {width:950px;height:100px;margin:0 auto;padding:0 30px;color:#000;background:#FFF;border:1px solid #FFF;border-top:none;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;border-bottom-left-radius:50px;border-bottom-right-radius:50px;} -.global .content .planet-carrousel .items {width:900px;height:100px;overflow:hidden;float:left;} -.global .content .planet-carrousel .arrow {height:40px;width:25px;float:left;font-size:20px;font-weight:bold;margin:30px 0;} -.global .content .planet-carrousel div.planet {color:#000;height:100px;width:100px;float:left;} -.global .content .planet-carrousel .selected {background-color:#EFEFEF;box-shadow:0 -4px 6px #115566 inset, 0 20px 40px #115566;} -.global .content .planet-carrousel .planet a {color:#000;} -.global .content .planet-carrousel .planet img {border:0;margin:0;} -.global .content .planet-carrousel .planet a.moon img,.global .content .planet-carrousel .planet span.moon img {position:absolute;float:left;margin:0;border:1px solid #FFF;} -.global .content .planet-carrousel .planet .planet-name {text-align:center;margin:2px 5px} -.global .content .planet-carrousel .planet .planet-image {margin:0 25px;height:50px;} -.global .content .planet-carrousel .planet .planet-position {text-align:center;margin:2px 5px} - -.global .content .resources-display {width:770px;height:40px;margin:0 auto 30px;padding:0 50px;color:#000;background:#FFF;box-shadow:0 -4px 6px #115566 inset, 0 20px 40px #115566;border:1px solid #FFF;border-top:none;border-radius: 0 0 20px 20px;} -.global .content .resources-display .resource,.global .content .resources-display .messages {height:22px;float:left;width:140px;margin:7px 0;} -.global .content .resources-display .resource img,.global .content .resources-display .messages img {float:left;} -.global .content .resources-display .resource p,.global .content .resources-display .messages p {font-weight:bold;font-size:12px;margin:2px 0 2px 47px;} -.global .content .resources-display .resource a,.global .content .resources-display .messages a {color:#000;text-decoration:underline;} -.global .content .resources-display .resource .resource-capped {color:red;} -.global .content .resources-display .messages {height:22px;float:left;width:110px;} -.global .content .resources-display .energy {width:240px;} - -.global .content .queue {width:600px;margin:10px auto 0;background:#FFF;color:#000;border:1px solid #FFF;border-radius:5px;border-top-left-radius:20px;border-top-right-radius:20px;box-shadow:0 4px 6px #156 inset;} -.global .content .queue h1 {color:#000;margin:10px 15px;width:570px;text-align:center;border-bottom:5px solid #9BC;} - -.global .content .queue .item {width:580px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .queue .item,.global .content .queue .item * {color:#000;} - -.global .content .item-list {width:640px;padding:10px 30px;margin:10px auto 0;background:#FFF;color:#000;border:1px solid #FFF;border-radius:5px;border-top-left-radius:20px;border-top-right-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;} -.global .content .item-list h1 {width:320px;color:#FFF;border:3px solid #156;border-radius:20px;height:30px;margin:10px auto;background:#589;box-shadow:0 -4px 8px #156 inset,0 -2px 5px #000;font-size:2.3em;} -.global .content .item-list .item-container {width:190px;float:left;margin:10px;height:230px;border:1px solid #156;box-shadow:0 -4px 6px #156 inset, 2px 2px 5px #000;border-radius:10px;} -.global .content .item-list.countable .item-container {height:270px;} -.global .content .item-list .item {width:170px;margin:0 10px;border:0;box-shadow:none;border-radius:0;} -.global .content .item-list .item h2 {margin-bottom:0;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {margin-top:0;} -.global .content .item-list .item h2,.global .content .item-list .item h2 * {font-size:1.1em;} -.global .content .item-list .item h3.level,.global .content .item-list .item h3.count {font-size:1em;color:gray;font-weight:bold;} -.global .content .item-list .item .image {margin:0 auto;width:120px;display:block;border-radius:60px;overflow:hidden;border:3px solid #156;box-shadow:0 4px 6px #156;} -.global .content .item-list .item,.global .content .item-list .item * {color:#000;} -.global .content .item-list .item .buy,.global .content .item-list .item .max,.global .content .item-list .item .qty {border:1px solid #156;border-radius:10px;height:20px;margin:20px 5px;background:#589;box-shadow:0 -4px 8px #156 inset,0 -2px 5px #000;} -.global .content .item-list .item .buy p,.global .content .item-list .item .buy p *,.global .content .item-list .item .max p,.global .content .item-list .item .max p * {margin:1px 0;text-align:center;font-size:1.2em;color:#FFF;} -.global .content .item-list .item .qty p {margin:0 auto;} -.global .content .item-list .item .qty p input {border:none;height:20px;margin:0 10px;color:#FFF;padding:0 10px;width:140px;text-align:center;} -.global .content .item-list .item .details {padding:5px 10px;border-radius:30px;box-shadow:0 4px 6px #156;width:300px;background:#FFF;z-index:999;display:none;position:relative;left:-30px;top:-10px;border:3px solid #156;} -.global .content .item-list .item .details ul {list-style:square inside;color:#156;padding-left:5px;} -.global .content .item-list .item .details ul li .cost {font-weight:bold;color:darkgreen;} -.global .content .item-list .item .details ul li .requirement {font-weight:bold;text-decoration:underline;} -.global .content .item-list .item .details ul li .capped {color:darkred;} -.global .content .item-list .item .details .time {color:gray;} -.global .content .item-list .clear {clear:left;height:50px;} - -.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #156 inset, 20px 20px 40px #156, -20px 20px 40px #115566, 0 -20px 40px #156;} -.global .content form.form h1 {font-size:2em;} -.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;} -.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;} -.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;} -.global .content form.form input {width:150px;display:block;margin:10px auto;} -.global .content form.form fieldset p input {width:100px;display:block;} - -.global .content .install {background:#FFF;width:600px;margin:10px auto;padding:20px;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;} - - -/** - * Galaxy user name display colors - */ -.allymember {color:lime;} -.noob {color:darkgreen;} -.strong {color:darkred;} -.vacation {color:lightblue;} -.inactive {color:grey;} -.longinactive {color:darkgrey;} -.banned {color:red;text-decoration:line-through;} diff --git a/src/skin/frontend/base/default/graphics/background.jpg b/src/skin/frontend/base/default/graphics/background.jpg deleted file mode 100644 index dc921a4..0000000 Binary files a/src/skin/frontend/base/default/graphics/background.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/favicon-128.png b/src/skin/frontend/base/default/graphics/favicon-128.png deleted file mode 100644 index c6bdabb..0000000 Binary files a/src/skin/frontend/base/default/graphics/favicon-128.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/favicon-32.png b/src/skin/frontend/base/default/graphics/favicon-32.png deleted file mode 100644 index 1d0bf85..0000000 Binary files a/src/skin/frontend/base/default/graphics/favicon-32.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/1.gif b/src/skin/frontend/base/default/graphics/gebaeude/1.gif deleted file mode 100644 index 5e381de..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/1.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/106.gif b/src/skin/frontend/base/default/graphics/gebaeude/106.gif deleted file mode 100644 index 05f9107..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/106.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/108.gif b/src/skin/frontend/base/default/graphics/gebaeude/108.gif deleted file mode 100644 index 7d478da..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/108.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/109.gif b/src/skin/frontend/base/default/graphics/gebaeude/109.gif deleted file mode 100644 index 9b16fb1..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/109.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/110.gif b/src/skin/frontend/base/default/graphics/gebaeude/110.gif deleted file mode 100644 index 015d16d..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/110.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/111.gif b/src/skin/frontend/base/default/graphics/gebaeude/111.gif deleted file mode 100644 index d1c41c6..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/111.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/113.gif b/src/skin/frontend/base/default/graphics/gebaeude/113.gif deleted file mode 100644 index d4c5747..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/113.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/114.gif b/src/skin/frontend/base/default/graphics/gebaeude/114.gif deleted file mode 100644 index 6905408..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/114.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/115.gif b/src/skin/frontend/base/default/graphics/gebaeude/115.gif deleted file mode 100644 index b17a5a3..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/115.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/117.gif b/src/skin/frontend/base/default/graphics/gebaeude/117.gif deleted file mode 100644 index 01ccefe..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/117.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/118.gif b/src/skin/frontend/base/default/graphics/gebaeude/118.gif deleted file mode 100644 index ab2f4a0..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/118.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/12.gif b/src/skin/frontend/base/default/graphics/gebaeude/12.gif deleted file mode 100644 index 9f2abb3..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/12.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/120.gif b/src/skin/frontend/base/default/graphics/gebaeude/120.gif deleted file mode 100644 index f7ab8c6..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/120.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/121.gif b/src/skin/frontend/base/default/graphics/gebaeude/121.gif deleted file mode 100644 index 7c08ee6..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/121.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/122.gif b/src/skin/frontend/base/default/graphics/gebaeude/122.gif deleted file mode 100644 index 6c3de1c..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/122.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/123.gif b/src/skin/frontend/base/default/graphics/gebaeude/123.gif deleted file mode 100644 index 924587c..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/123.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/124.gif b/src/skin/frontend/base/default/graphics/gebaeude/124.gif deleted file mode 100644 index bd429bd..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/124.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/14.gif b/src/skin/frontend/base/default/graphics/gebaeude/14.gif deleted file mode 100644 index bf677d0..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/14.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/15.gif b/src/skin/frontend/base/default/graphics/gebaeude/15.gif deleted file mode 100644 index dd58779..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/15.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/199.gif b/src/skin/frontend/base/default/graphics/gebaeude/199.gif deleted file mode 100644 index 21d5795..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/199.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/2.gif b/src/skin/frontend/base/default/graphics/gebaeude/2.gif deleted file mode 100644 index ad2b5b9..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/2.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/202.gif b/src/skin/frontend/base/default/graphics/gebaeude/202.gif deleted file mode 100644 index b503a8d..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/202.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/203.gif b/src/skin/frontend/base/default/graphics/gebaeude/203.gif deleted file mode 100644 index 375db14..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/203.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/204.gif b/src/skin/frontend/base/default/graphics/gebaeude/204.gif deleted file mode 100644 index 57bd3b1..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/204.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/205.gif b/src/skin/frontend/base/default/graphics/gebaeude/205.gif deleted file mode 100644 index 8a22917..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/205.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/206.gif b/src/skin/frontend/base/default/graphics/gebaeude/206.gif deleted file mode 100644 index 65d896e..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/206.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/206.jpg b/src/skin/frontend/base/default/graphics/gebaeude/206.jpg deleted file mode 100644 index ba2b512..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/206.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/207.gif b/src/skin/frontend/base/default/graphics/gebaeude/207.gif deleted file mode 100644 index 1367058..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/207.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/208.gif b/src/skin/frontend/base/default/graphics/gebaeude/208.gif deleted file mode 100644 index f899fe3..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/208.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/209.gif b/src/skin/frontend/base/default/graphics/gebaeude/209.gif deleted file mode 100644 index 7d14cb0..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/209.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/21.gif b/src/skin/frontend/base/default/graphics/gebaeude/21.gif deleted file mode 100644 index 96347af..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/21.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/210.gif b/src/skin/frontend/base/default/graphics/gebaeude/210.gif deleted file mode 100644 index 3ea7fa1..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/210.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/211.gif b/src/skin/frontend/base/default/graphics/gebaeude/211.gif deleted file mode 100644 index 6cb428b..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/211.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/212.gif b/src/skin/frontend/base/default/graphics/gebaeude/212.gif deleted file mode 100644 index b3ac9e1..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/212.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/213.gif b/src/skin/frontend/base/default/graphics/gebaeude/213.gif deleted file mode 100644 index 83959a0..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/213.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/214.gif b/src/skin/frontend/base/default/graphics/gebaeude/214.gif deleted file mode 100644 index b3a5b42..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/214.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/215.gif b/src/skin/frontend/base/default/graphics/gebaeude/215.gif deleted file mode 100644 index 4a334a1..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/215.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/216.gif b/src/skin/frontend/base/default/graphics/gebaeude/216.gif deleted file mode 100644 index b3a5b42..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/216.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/21_a.gif b/src/skin/frontend/base/default/graphics/gebaeude/21_a.gif deleted file mode 100644 index d3e2bc6..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/21_a.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/22.gif b/src/skin/frontend/base/default/graphics/gebaeude/22.gif deleted file mode 100644 index 3a9ab8d..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/22.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/23.gif b/src/skin/frontend/base/default/graphics/gebaeude/23.gif deleted file mode 100644 index 970a8e2..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/23.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/24.gif b/src/skin/frontend/base/default/graphics/gebaeude/24.gif deleted file mode 100644 index 6db02e0..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/24.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/3.gif b/src/skin/frontend/base/default/graphics/gebaeude/3.gif deleted file mode 100644 index 42ae0f3..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/3.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/31.gif b/src/skin/frontend/base/default/graphics/gebaeude/31.gif deleted file mode 100644 index bf4fb70..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/31.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/33.gif b/src/skin/frontend/base/default/graphics/gebaeude/33.gif deleted file mode 100644 index de0433b..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/33.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/34.gif b/src/skin/frontend/base/default/graphics/gebaeude/34.gif deleted file mode 100644 index d3e2bc6..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/34.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/4.gif b/src/skin/frontend/base/default/graphics/gebaeude/4.gif deleted file mode 100644 index 4d6fcc7..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/4.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/401.gif b/src/skin/frontend/base/default/graphics/gebaeude/401.gif deleted file mode 100644 index 5a73d38..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/401.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/402.gif b/src/skin/frontend/base/default/graphics/gebaeude/402.gif deleted file mode 100644 index 948782c..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/402.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/403.gif b/src/skin/frontend/base/default/graphics/gebaeude/403.gif deleted file mode 100644 index 05ce67c..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/403.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/404.gif b/src/skin/frontend/base/default/graphics/gebaeude/404.gif deleted file mode 100644 index ad13c89..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/404.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/405.gif b/src/skin/frontend/base/default/graphics/gebaeude/405.gif deleted file mode 100644 index 49b87ce..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/405.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/406.gif b/src/skin/frontend/base/default/graphics/gebaeude/406.gif deleted file mode 100644 index 6fad289..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/406.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/407.gif b/src/skin/frontend/base/default/graphics/gebaeude/407.gif deleted file mode 100644 index e0d3ad8..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/407.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/408.gif b/src/skin/frontend/base/default/graphics/gebaeude/408.gif deleted file mode 100644 index 1c0cb93..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/408.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/41.gif b/src/skin/frontend/base/default/graphics/gebaeude/41.gif deleted file mode 100644 index 82da4f5..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/41.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/42.gif b/src/skin/frontend/base/default/graphics/gebaeude/42.gif deleted file mode 100644 index 51707bf..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/42.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/43.gif b/src/skin/frontend/base/default/graphics/gebaeude/43.gif deleted file mode 100644 index 1ec4991..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/43.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/44.gif b/src/skin/frontend/base/default/graphics/gebaeude/44.gif deleted file mode 100644 index a1c0707..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/44.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/501.gif b/src/skin/frontend/base/default/graphics/gebaeude/501.gif deleted file mode 100644 index 29627ee..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/501.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/502.gif b/src/skin/frontend/base/default/graphics/gebaeude/502.gif deleted file mode 100644 index 4ac5c96..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/502.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/503.gif b/src/skin/frontend/base/default/graphics/gebaeude/503.gif deleted file mode 100644 index 4e0a141..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/503.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gebaeude/ionen.gif.1 b/src/skin/frontend/base/default/graphics/gebaeude/ionen.gif.1 deleted file mode 100644 index 198a813..0000000 Binary files a/src/skin/frontend/base/default/graphics/gebaeude/ionen.gif.1 and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gfx/info-help.jpg b/src/skin/frontend/base/default/graphics/gfx/info-help.jpg deleted file mode 100644 index c65c785..0000000 Binary files a/src/skin/frontend/base/default/graphics/gfx/info-help.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/gfx/user-menu.jpg b/src/skin/frontend/base/default/graphics/gfx/user-menu.jpg deleted file mode 100644 index fc1088a..0000000 Binary files a/src/skin/frontend/base/default/graphics/gfx/user-menu.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/abort.gif b/src/skin/frontend/base/default/graphics/images/abort.gif deleted file mode 100644 index f9cebe1..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/abort.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/bann.png b/src/skin/frontend/base/default/graphics/images/bann.png deleted file mode 100644 index 4ddcd09..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/bann.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/banned.png b/src/skin/frontend/base/default/graphics/images/banned.png deleted file mode 100644 index 627842c..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/banned.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/deuterium.gif b/src/skin/frontend/base/default/graphics/images/deuterium.gif deleted file mode 100644 index 901e3c4..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/deuterium.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/energie.gif b/src/skin/frontend/base/default/graphics/images/energie.gif deleted file mode 100644 index 21376e0..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/energie.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/false.png b/src/skin/frontend/base/default/graphics/images/false.png deleted file mode 100644 index 403f76d..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/false.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/female.gif b/src/skin/frontend/base/default/graphics/images/female.gif deleted file mode 100644 index 321f2c9..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/female.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/icon_latest_reply.gif b/src/skin/frontend/base/default/graphics/images/icon_latest_reply.gif deleted file mode 100644 index cab7656..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/icon_latest_reply.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/kristall.gif b/src/skin/frontend/base/default/graphics/images/kristall.gif deleted file mode 100644 index 392aab3..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/kristall.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/loadingAnimation.gif b/src/skin/frontend/base/default/graphics/images/loadingAnimation.gif deleted file mode 100644 index 82290f4..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/loadingAnimation.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/male.gif b/src/skin/frontend/base/default/graphics/images/male.gif deleted file mode 100644 index bc98e06..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/male.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/message.gif b/src/skin/frontend/base/default/graphics/images/message.gif deleted file mode 100644 index 6aaa698..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/message.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/metall.gif b/src/skin/frontend/base/default/graphics/images/metall.gif deleted file mode 100644 index 25e265d..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/metall.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/601.jpg b/src/skin/frontend/base/default/graphics/images/officiers/601.jpg deleted file mode 100644 index 404fbeb..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/601.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/602.jpg b/src/skin/frontend/base/default/graphics/images/officiers/602.jpg deleted file mode 100644 index 7ebf8f3..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/602.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/603.jpg b/src/skin/frontend/base/default/graphics/images/officiers/603.jpg deleted file mode 100644 index 2bb9b7f..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/603.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/604.jpg b/src/skin/frontend/base/default/graphics/images/officiers/604.jpg deleted file mode 100644 index e04c0b0..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/604.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/605.jpg b/src/skin/frontend/base/default/graphics/images/officiers/605.jpg deleted file mode 100644 index b3a2280..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/605.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/606.jpg b/src/skin/frontend/base/default/graphics/images/officiers/606.jpg deleted file mode 100644 index 64aef7c..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/606.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/607.jpg b/src/skin/frontend/base/default/graphics/images/officiers/607.jpg deleted file mode 100644 index 0f979c7..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/607.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/608.jpg b/src/skin/frontend/base/default/graphics/images/officiers/608.jpg deleted file mode 100644 index f11f910..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/608.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/609.jpg b/src/skin/frontend/base/default/graphics/images/officiers/609.jpg deleted file mode 100644 index 34d8eee..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/609.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/610.jpg b/src/skin/frontend/base/default/graphics/images/officiers/610.jpg deleted file mode 100644 index b6ec727..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/610.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/611.jpg b/src/skin/frontend/base/default/graphics/images/officiers/611.jpg deleted file mode 100644 index 5ed60a1..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/611.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/612.jpg b/src/skin/frontend/base/default/graphics/images/officiers/612.jpg deleted file mode 100644 index 4b896dd..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/612.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/613.jpg b/src/skin/frontend/base/default/graphics/images/officiers/613.jpg deleted file mode 100644 index c0c3514..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/613.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/614.jpg b/src/skin/frontend/base/default/graphics/images/officiers/614.jpg deleted file mode 100644 index 7089f90..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/614.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/officiers/615.jpg b/src/skin/frontend/base/default/graphics/images/officiers/615.jpg deleted file mode 100644 index d3d34f8..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/officiers/615.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/progress.gif b/src/skin/frontend/base/default/graphics/images/progress.gif deleted file mode 100644 index 085ccae..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/progress.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/progressbar.gif b/src/skin/frontend/base/default/graphics/images/progressbar.gif deleted file mode 100644 index 676115b..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/progressbar.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r1.png b/src/skin/frontend/base/default/graphics/images/r1.png deleted file mode 100644 index f40d3c4..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r1.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r2.png b/src/skin/frontend/base/default/graphics/images/r2.png deleted file mode 100644 index bebf810..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r2.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r3.png b/src/skin/frontend/base/default/graphics/images/r3.png deleted file mode 100644 index 27080a2..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r3.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r4.png b/src/skin/frontend/base/default/graphics/images/r4.png deleted file mode 100644 index c2df0aa..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r4.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r5.png b/src/skin/frontend/base/default/graphics/images/r5.png deleted file mode 100644 index d7c0932..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r5.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r6.png b/src/skin/frontend/base/default/graphics/images/r6.png deleted file mode 100644 index eee8fef..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r6.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r7.png b/src/skin/frontend/base/default/graphics/images/r7.png deleted file mode 100644 index e26b2e7..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r7.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r8.png b/src/skin/frontend/base/default/graphics/images/r8.png deleted file mode 100644 index fb53c5e..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r8.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/r9.png b/src/skin/frontend/base/default/graphics/images/r9.png deleted file mode 100644 index f7b9a04..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/r9.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/confused.png b/src/skin/frontend/base/default/graphics/images/smileys/confused.png deleted file mode 100644 index d29d3a1..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/confused.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/cry.png b/src/skin/frontend/base/default/graphics/images/smileys/cry.png deleted file mode 100644 index f9170bb..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/cry.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/dizzy.png b/src/skin/frontend/base/default/graphics/images/smileys/dizzy.png deleted file mode 100644 index 42cb9b0..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/dizzy.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/happy.png b/src/skin/frontend/base/default/graphics/images/smileys/happy.png deleted file mode 100644 index ab74d33..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/happy.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/lol.png b/src/skin/frontend/base/default/graphics/images/smileys/lol.png deleted file mode 100644 index 0efa420..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/lol.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/neutral.png b/src/skin/frontend/base/default/graphics/images/smileys/neutral.png deleted file mode 100644 index a03d330..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/neutral.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/omg.png b/src/skin/frontend/base/default/graphics/images/smileys/omg.png deleted file mode 100644 index 88f2a60..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/omg.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/sad.png b/src/skin/frontend/base/default/graphics/images/smileys/sad.png deleted file mode 100644 index 7672ee1..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/sad.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/shit.png b/src/skin/frontend/base/default/graphics/images/smileys/shit.png deleted file mode 100644 index 230441c..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/shit.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/smile.png b/src/skin/frontend/base/default/graphics/images/smileys/smile.png deleted file mode 100644 index 6aeed0c..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/smile.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/tongue.png b/src/skin/frontend/base/default/graphics/images/smileys/tongue.png deleted file mode 100644 index 2e7c606..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/tongue.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/smileys/wink.png b/src/skin/frontend/base/default/graphics/images/smileys/wink.png deleted file mode 100644 index 014cb2f..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/smileys/wink.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/tlo.jpg b/src/skin/frontend/base/default/graphics/images/tlo.jpg deleted file mode 100644 index a8f00a0..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/tlo.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/true.png b/src/skin/frontend/base/default/graphics/images/true.png deleted file mode 100644 index 2f57645..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/true.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/images/xnova.png b/src/skin/frontend/base/default/graphics/images/xnova.png deleted file mode 100644 index 3343ab3..0000000 Binary files a/src/skin/frontend/base/default/graphics/images/xnova.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/b.gif b/src/skin/frontend/base/default/graphics/img/b.gif deleted file mode 100644 index ee94781..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/b.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/background1.jpg b/src/skin/frontend/base/default/graphics/img/background1.jpg deleted file mode 100644 index 44ee319..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/background1.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/background2.jpg b/src/skin/frontend/base/default/graphics/img/background2.jpg deleted file mode 100644 index 02fa04c..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/background2.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/bg1.gif b/src/skin/frontend/base/default/graphics/img/bg1.gif deleted file mode 100644 index d5212e8..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/bg1.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/e.gif b/src/skin/frontend/base/default/graphics/img/e.gif deleted file mode 100644 index d966d7a..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/e.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/link.gif b/src/skin/frontend/base/default/graphics/img/link.gif deleted file mode 100644 index b12e72b..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/link.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/m.gif b/src/skin/frontend/base/default/graphics/img/m.gif deleted file mode 100644 index 8c3dc1f..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/m.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/p.png b/src/skin/frontend/base/default/graphics/img/p.png deleted file mode 100644 index 21c1f16..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/p.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/p1z1.png b/src/skin/frontend/base/default/graphics/img/p1z1.png deleted file mode 100644 index 6312110..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/p1z1.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/p2z2.png b/src/skin/frontend/base/default/graphics/img/p2z2.png deleted file mode 100644 index 14fb937..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/p2z2.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/p3z2.png b/src/skin/frontend/base/default/graphics/img/p3z2.png deleted file mode 100644 index 649abaa..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/p3z2.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/r.gif b/src/skin/frontend/base/default/graphics/img/r.gif deleted file mode 100644 index af34366..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/r.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/s.gif b/src/skin/frontend/base/default/graphics/img/s.gif deleted file mode 100644 index 481bede..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/s.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/img/starz2.png b/src/skin/frontend/base/default/graphics/img/starz2.png deleted file mode 100644 index 21c1f16..0000000 Binary files a/src/skin/frontend/base/default/graphics/img/starz2.png and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/pic/abort.gif b/src/skin/frontend/base/default/graphics/pic/abort.gif deleted file mode 100644 index ae31916..0000000 Binary files a/src/skin/frontend/base/default/graphics/pic/abort.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/pic/appwiz.gif b/src/skin/frontend/base/default/graphics/pic/appwiz.gif deleted file mode 100644 index a8e622d..0000000 Binary files a/src/skin/frontend/base/default/graphics/pic/appwiz.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/pic/key.gif b/src/skin/frontend/base/default/graphics/pic/key.gif deleted file mode 100644 index ae6410b..0000000 Binary files a/src/skin/frontend/base/default/graphics/pic/key.gif and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/debris.jpg b/src/skin/frontend/base/default/graphics/planeten/debris.jpg deleted file mode 100644 index 8f5afe7..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/debris.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet01.jpg deleted file mode 100644 index 1f1a65e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet02.jpg deleted file mode 100644 index 0dd1930..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet03.jpg deleted file mode 100644 index a339cbc..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet04.jpg deleted file mode 100644 index 1a5fb35..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet05.jpg deleted file mode 100644 index d33e54e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet06.jpg deleted file mode 100644 index e9a42fd..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet07.jpg deleted file mode 100644 index 9f99f56..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet08.jpg deleted file mode 100644 index 50e7284..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet09.jpg deleted file mode 100644 index afd19db..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet10.jpg deleted file mode 100644 index 2efb9cd..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/dschjungelplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet01.jpg deleted file mode 100644 index 229c8fb..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet02.jpg deleted file mode 100644 index cade57c..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet03.jpg deleted file mode 100644 index 665329e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet04.jpg deleted file mode 100644 index 1e9fd04..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet05.jpg deleted file mode 100644 index a4e188c..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet06.jpg deleted file mode 100644 index 2873c00..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet07.jpg deleted file mode 100644 index dbfe7f8..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet08.jpg deleted file mode 100644 index aa0f84e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet09.jpg deleted file mode 100644 index 1269c07..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/eisplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/eisplanet10.jpg deleted file mode 100644 index 8a22eed..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/eisplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet01.jpg deleted file mode 100644 index 2f9ca71..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet02.jpg deleted file mode 100644 index e5c5386..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet03.jpg deleted file mode 100644 index 8b9832d..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet04.jpg deleted file mode 100644 index 517a883..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet05.jpg deleted file mode 100644 index 5fbd92d..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet06.jpg deleted file mode 100644 index b1b21df..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet07.jpg deleted file mode 100644 index e885e21..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/gasplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/gasplanet08.jpg deleted file mode 100644 index dd6e04f..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/gasplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/mond.jpg b/src/skin/frontend/base/default/graphics/planeten/mond.jpg deleted file mode 100644 index efca9ac..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/mond.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet01.jpg deleted file mode 100644 index a658059..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet02.jpg deleted file mode 100644 index af9487f..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet03.jpg deleted file mode 100644 index 0895c73..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet04.jpg deleted file mode 100644 index d2eed20..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet05.jpg deleted file mode 100644 index 96ef5ac..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet06.jpg deleted file mode 100644 index 196c957..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet07.jpg deleted file mode 100644 index 72b8dcb..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/normaltempplanet08.jpg deleted file mode 100644 index 9367f89..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/normaltempplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet01.jpg deleted file mode 100644 index 94cd423..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet02.jpg deleted file mode 100644 index 19183ad..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet03.jpg deleted file mode 100644 index 45db4ec..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet04.jpg deleted file mode 100644 index 0c0c2f7..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet05.jpg deleted file mode 100644 index 424275e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet06.jpg deleted file mode 100644 index 8079114..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet07.jpg deleted file mode 100644 index 611848d..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet08.jpg deleted file mode 100644 index 0182046..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet09.jpg deleted file mode 100644 index 8a82557..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet10.jpg deleted file mode 100644 index 25d34bd..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_dschjungelplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet01.jpg deleted file mode 100644 index 91b7dc3..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet02.jpg deleted file mode 100644 index 4e930df..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet03.jpg deleted file mode 100644 index 1555dd3..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet04.jpg deleted file mode 100644 index b3b10a5..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet05.jpg deleted file mode 100644 index 99304f8..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet06.jpg deleted file mode 100644 index 98b78da..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet07.jpg deleted file mode 100644 index 65115cd..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet08.jpg deleted file mode 100644 index 7cced23..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet09.jpg deleted file mode 100644 index 289213b..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet10.jpg deleted file mode 100644 index 2d4f669..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_eisplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet01.jpg deleted file mode 100644 index 5a1c69a..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet02.jpg deleted file mode 100644 index 507b56f..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet03.jpg deleted file mode 100644 index 5a2a779..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet04.jpg deleted file mode 100644 index e172e43..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet05.jpg deleted file mode 100644 index 3284d29..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet06.jpg deleted file mode 100644 index 12ea421..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet07.jpg deleted file mode 100644 index eb267f6..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet08.jpg deleted file mode 100644 index a769f7a..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_gasplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_mond.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_mond.jpg deleted file mode 100644 index ec241b3..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_mond.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet01.jpg deleted file mode 100644 index d0dc6b5..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet02.jpg deleted file mode 100644 index 2de938f..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet03.jpg deleted file mode 100644 index 98a81f3..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet04.jpg deleted file mode 100644 index 58dcacd..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet05.jpg deleted file mode 100644 index d61f5a2..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet06.jpg deleted file mode 100644 index 2fbe40d..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet07.jpg deleted file mode 100644 index 73ce710..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet08.jpg deleted file mode 100644 index 7f727ad..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_normaltempplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet01.jpg deleted file mode 100644 index f577ff9..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet02.jpg deleted file mode 100644 index e5daa62..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet03.jpg deleted file mode 100644 index 780183e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet04.jpg deleted file mode 100644 index 5a01876..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet05.jpg deleted file mode 100644 index 843ac1c..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet06.jpg deleted file mode 100644 index 1c7359a..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet07.jpg deleted file mode 100644 index 5698fd1..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet08.jpg deleted file mode 100644 index 2305bd0..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet09.jpg deleted file mode 100644 index 5669767..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet10.jpg deleted file mode 100644 index 81e8115..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_trockenplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet01.jpg deleted file mode 100644 index 4ed27e7..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet02.jpg deleted file mode 100644 index 3adee67..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet03.jpg deleted file mode 100644 index 23ff4b1..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet04.jpg deleted file mode 100644 index 3db451f..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet05.jpg deleted file mode 100644 index 6986882..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet06.jpg deleted file mode 100644 index 37d6415..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet07.jpg deleted file mode 100644 index 1c1954b..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet08.jpg deleted file mode 100644 index 62755eb..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet09.jpg deleted file mode 100644 index deef507..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wasserplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet01.jpg deleted file mode 100644 index b1542ce..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet02.jpg deleted file mode 100644 index 1969244..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet03.jpg deleted file mode 100644 index 2e61131..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet04.jpg deleted file mode 100644 index 94c7c37..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/small/s_wuestenplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet01.jpg deleted file mode 100644 index 3605962..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet02.jpg deleted file mode 100644 index d7f3dfe..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet03.jpg deleted file mode 100644 index beb851d..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet04.jpg deleted file mode 100644 index 21b2df1..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet05.jpg deleted file mode 100644 index 80d9af2..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet06.jpg deleted file mode 100644 index d01998e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet07.jpg deleted file mode 100644 index 1d8f7a6..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet08.jpg deleted file mode 100644 index bb5f0f4..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet09.jpg deleted file mode 100644 index 4873e17..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/trockenplanet10.jpg b/src/skin/frontend/base/default/graphics/planeten/trockenplanet10.jpg deleted file mode 100644 index f454177..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/trockenplanet10.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet01.jpg deleted file mode 100644 index 59779c6..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet02.jpg deleted file mode 100644 index 6a394f6..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet03.jpg deleted file mode 100644 index b8e48cc..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet04.jpg deleted file mode 100644 index 570d12e..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet04.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet05.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet05.jpg deleted file mode 100644 index 8ea9b18..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet05.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet06.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet06.jpg deleted file mode 100644 index f07cbfc..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet06.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet07.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet07.jpg deleted file mode 100644 index 14a25d0..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet07.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet08.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet08.jpg deleted file mode 100644 index 611c405..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet08.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wasserplanet09.jpg b/src/skin/frontend/base/default/graphics/planeten/wasserplanet09.jpg deleted file mode 100644 index c99da0b..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wasserplanet09.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet01.jpg b/src/skin/frontend/base/default/graphics/planeten/wuestenplanet01.jpg deleted file mode 100644 index c325895..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet01.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet02.jpg b/src/skin/frontend/base/default/graphics/planeten/wuestenplanet02.jpg deleted file mode 100644 index ba9f9a7..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet02.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet03.jpg b/src/skin/frontend/base/default/graphics/planeten/wuestenplanet03.jpg deleted file mode 100644 index a03e2e3..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet03.jpg and /dev/null differ diff --git a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet04.jpg b/src/skin/frontend/base/default/graphics/planeten/wuestenplanet04.jpg deleted file mode 100644 index 75f9286..0000000 Binary files a/src/skin/frontend/base/default/graphics/planeten/wuestenplanet04.jpg and /dev/null differ diff --git a/src/skin/install/base/default/css/base.css b/src/skin/install/base/default/css/base.css deleted file mode 100644 index 67e3b2c..0000000 --- a/src/skin/install/base/default/css/base.css +++ /dev/null @@ -1,52 +0,0 @@ -@CHARSET "UTF-8"; - -* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;} -body,html {background:#DDD;} -h1 {font-size:2.3em;/*border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;text-align:center;color:#58939f;background:#EEE;*/} -/*h1:hover {color:#6AB;background:#CCC;}*/ -h2,h3 {text-decoration:underline;font-weight:bold;} -h4,h5,h6 {font-style:italic;} -h2 {font-size:2em;} -h3 {font-size:1.8em;} -h4 {font-size:1.5em;} -h5 {font-size:1.6em;} -h6 {font-size:1em;} - -input[type=text],input[type=password] {height:2em;border:#58939f 0 solid;border-width:1px;border-radius:4px;} -input[type=submit],input[type=button],button {height:2em;border:#58939f 0 solid;border-width:1px;border-radius:4px;text-align:center;} -input[type=checkbox],input[type=radio] {height:2em;border:#58939f 0 solid;border-width:1px;border-radius:4px;} -select {height:2em;border:#58939f 0 solid;border-width:1px;border-radius:4px;margin:5px;} - -/* background-image:-moz-linear-gradient(center top, #58939F 0pt, #78B3BF 30px);*/ -.global .content .status {display:block;margin:0 auto;border:3px solid #000;height:30px;border-radius:20px;width:589px;padding:0 25px;background-color:#FFF;} -.global .content .status .item {float:left;display:block;width:95px;text-align:center;border-right:2px solid #000;margin:0;height:12px;padding:9px 0;font-weight:bold;} -.global .content .status .intro {border-left:2px solid #000;} -.global .content .status .cleared {color:#FFF;background-color:grey;} -.global .content .status .active {color:#FFF;background-color:#58939F;} - -.global .content .status {background-image:linear-gradient(center top, #EEE 0pt, #CCC 30px);background-image:-o-linear-gradient(center top, #EEE 0pt, #CCC 30px);background-image:-moz-linear-gradient(center top, #EEE 0pt, #CCC 30px);background-image:-webkit-linear-gradient(center top, #EEE 0pt, #CCC 30px);background-image:-ms-linear-gradient(center top, #EEE 0pt, #CCC 30px);} -.global .content .status .cleared {background-image:linear-gradient(center top, #444 0pt, #666 30px);background-image:-o-linear-gradient(center top, #444 0pt, #666 30px);background-image:-moz-linear-gradient(center top, #444 0pt, #666 30px);background-image:-webkit-linear-gradient(center top, #444 0pt, #666 30px);background-image:-ms-linear-gradient(center top, #444 0pt, #666 30px);} -.global .content .status .active {background-image:linear-gradient(center top, #58939F 0pt, #78B3BF 30px);background-image:-o-linear-gradient(center top, #58939F 0pt, #78B3BF 30px);background-image:-moz-linear-gradient(center top, #58939F 0pt, #78B3BF 30px);background-image:-webkit-linear-gradient(center top, #58939F 0pt, #78B3BF 30px);background-image:-ms-linear-gradient(center top, #58939F 0pt, #78B3BF 30px);} - -.global .content .install {background:#FFF;width:600px;margin:50px auto 10px;padding:20px;border:2px groove #58939F;} -.global .content .install p {width:550px;margin:0 auto;} -.global .content .install label {width:245px;display:block;float:left;margin:5px 10px 0 25px;text-align:right;} -.global .content .install input[type=text],.global .content .install input[type=password] {width:145px;padding:0 5px;margin:5px 0 0;} -.global .content .install input[type=button],.global .content .install button,.global .content .install input[type=submit] {width:145px;padding:0 5px;margin:25px 0 10px;} -.global .content .install input[type=submit] {background-color:#78B3BF;color:#FFF;} -.global .content .install select {margin:5px 0 0;} -.global .content .install #test {float:left;margin:25px 10px 10px 125px;} -.global .content .install #install_messages {font-family:monospace;border: 1px solid #000;padding:5px 10px;background-color:#EFEFEF;display:none;border-left-width:3px;} -.global .content .install #install_messages.failure {color:#D00;background-color:#FEE;border-color:#D00;} -.global .content .install #install_messages.success {color:#063;background-color:#EFE;border-color:#063;} - -/** - * Galaxy user name display colors - */ -.allymember {color:lime;} -.noob {color:darkgreen;} -.strong {color:darkred;} -.vacation {color:lightblue;} -.inactive {color:grey;} -.longinactive {color:darkgrey;} -.banned {color:red;text-decoration:line-through;} diff --git a/src/stat.php b/src/stat.php deleted file mode 100644 index e99027e..0000000 --- a/src/stat.php +++ /dev/null @@ -1,218 +0,0 @@ - - * All rights reserved. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * --> NOTICE <-- - * This file is part of the core development branch, changing its contents will - * make you unable to use the automatic updates manager. Please refer to the - * documentation for further information about customizing Wootook. - * - */ - -define('INSIDE' , true); -define('INSTALL' , false); -require_once dirname(__FILE__) .'/application/bootstrap.php'; - -includeLang('stat'); - -$parse = $lang; -$who = (isset($_POST['who'])) ? $_POST['who'] : isset($_GET['who']) ? $_GET['who'] : null; -if (!isset($who)) { - $who = 1; -} -$type = (isset($_POST['type'])) ? $_POST['type'] : isset($_GET['type']) ? $_GET['type'] : null; -if (!isset($type)) { - $type = 1; -} -$range = (isset($_POST['range'])) ? $_POST['range'] : isset($_GET['range']) ? $_GET['range'] : null; -if (!isset($range)) { - $range = 1; -} - -$start = 0; -$parse['who'] = ""; -$parse['who'] .= ""; - -$parse['type'] = ""; -$parse['type'] .= ""; -$parse['type'] .= ""; -$parse['type'] .= ""; -$parse['type'] .= ""; - -if ($type == 1) { - $Order = "total_points"; - $Points = "total_points"; - $Counts = "total_count"; - $Rank = "total_rank"; - $OldRank = "total_old_rank"; -} elseif ($type == 2) { - $Order = "fleet_points"; - $Points = "fleet_points"; - $Counts = "fleet_count"; - $Rank = "fleet_rank"; - $OldRank = "fleet_old_rank"; -} elseif ($type == 3) { - $Order = "tech_count"; - $Points = "tech_points"; - $Counts = "tech_count"; - $Rank = "tech_rank"; - $OldRank = "tech_old_rank"; -} elseif ($type == 4) { - $Order = "build_points"; - $Points = "build_points"; - $Counts = "build_count"; - $Rank = "build_rank"; - $OldRank = "build_old_rank"; -} elseif ($type == 5) { - $Order = "defs_points"; - $Points = "defs_points"; - $Counts = "defs_count"; - $Rank = "defs_rank"; - $OldRank = "defs_old_rank"; -} - -if ($who == 2) { - $MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}}", 'alliance', true); - if ($MaxAllys['count'] > 100) { - $LastPage = floor($MaxAllys['count'] / 100); - } - $parse['range'] = ""; - for ($Page = 0; $Page <= $LastPage; $Page++) { - $PageValue = ($Page * 100) + 1; - $PageRange = $PageValue + 99; - $parse['range'] .= ""; - } - - $parse['stat_header'] = parsetemplate(gettemplate('stat_alliancetable_header'), $parse); - - $start = floor($range / 100 % 100) * 100; - $query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints'); - - $start++; - $parse['stat_date'] = $gameConfig['stats']; - $parse['stat_values'] = ""; - while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) { - $parse['ally_rank'] = $start; - - $AllyRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'alliance',true); - - $rank_old = $StatRow[ $OldRank ]; - if ( $rank_old == 0) { - $rank_old = $start; - $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); - } else { - $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); - } - $rank_new = $start; - $ranking = $rank_old - $rank_new; - if ($ranking == "0") { - $parse['ally_rankplus'] = "*"; - } - if ($ranking < "0") { - $parse['ally_rankplus'] = "".$ranking.""; - } - if ($ranking > "0") { - $parse['ally_rankplus'] = "+".$ranking.""; - } - $parse['ally_tag'] = $AllyRow['ally_tag']; - $parse['ally_name'] = $AllyRow['ally_name']; - $parse['ally_mes'] = ''; - $parse['ally_members'] = $AllyRow['ally_members']; - $parse['ally_points'] = pretty_number( $StatRow[ $Order ] ); - $parse['ally_members_points'] = pretty_number( floor($StatRow[ $Order ] / $AllyRow['ally_members']) ); - - $parse['stat_values'] .= parsetemplate(gettemplate('stat_alliancetable'), $parse); - $start++; - } -} else { - $MaxUsers = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE `db_deaktjava` = '0';", 'users', true); - $LastPage = 0; - if ($MaxUsers['count'] > 100) { - $LastPage = floor($MaxUsers['count'] / 100); - } - $parse['range'] = ""; - for ($Page = 0; $Page <= $LastPage; $Page++) { - $PageValue = ($Page * 100) + 1; - $PageRange = $PageValue + 99; - $parse['range'] .= ""; - } - - $parse['stat_header'] = parsetemplate(gettemplate('stat_playertable_header'), $parse); - - $start = floor($range / 100 % 100) * 100; - $query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints'); - - $start++; - $parse['stat_date'] = $gameConfig['stats']; - $parse['stat_values'] = ""; - while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) { - $parse['stat_date'] = date("d M Y - H:i:s", $StatRow['stat_date']); - $parse['player_rank'] = $start; - - $UsrRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'users',true); - - $QryUpdateStats .= "`stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';"; - - - $rank_old = $StatRow[ $OldRank ]; - if ( $rank_old == 0) { - $rank_old = $start; - $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); - } else { - $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); - } - $rank_new = $start; - $ranking = $rank_old - $rank_new; - if ($ranking == "0") { - $parse['player_rankplus'] = "*"; - } - if ($ranking < "0") { - $parse['player_rankplus'] = "".$ranking.""; - } - if ($ranking > "0") { - $parse['player_rankplus'] = "+".$ranking.""; - } - if ($UsrRow['id'] == $user['id']) { - $parse['player_name'] = "".$UsrRow['username'].""; - } else { - $parse['player_name'] = $UsrRow['username']; - } - $parse['player_mes'] = "\""."; - if ($UsrRow['ally_name'] == $user['ally_name']) { - $parse['player_alliance'] = "".$UsrRow['ally_name'].""; - } else { - $parse['player_alliance'] = $UsrRow['ally_name']; - } - $parse['player_points'] = pretty_number( $StatRow[ $Order ] ); - $parse['stat_values'] .= parsetemplate(gettemplate('stat_playertable'), $parse); - $start++; - } -} - -$page = parsetemplate( gettemplate('stat_body'), $parse ); - -display($page, $lang['stat_title']); - -// ----------------------------------------------------------------------------------------------------------- -// History version -// 1.0 - R��criture module -?> diff --git a/stat.php b/stat.php new file mode 100644 index 0000000..c8e19d6 --- /dev/null +++ b/stat.php @@ -0,0 +1,216 @@ + + * All rights reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * --> NOTICE <-- + * This file is part of the core development branch, changing its contents will + * make you unable to use the automatic updates manager. Please refer to the + * documentation for further information about customizing Wootook. + * + */ + +define('INSIDE' , true); +define('INSTALL' , false); +require_once dirname(__FILE__) .'/application/bootstrap.php'; + + includeLang('stat'); + + $parse = $lang; + $who = (isset($_POST['who'])) ? $_POST['who'] : $_GET['who']; + if (!isset($who)) { + $who = 1; + } + $type = (isset($_POST['type'])) ? $_POST['type'] : $_GET['type']; + if (!isset($type)) { + $type = 1; + } + $range = (isset($_POST['range'])) ? $_POST['range'] : $_GET['range']; + if (!isset($range)) { + $range = 1; + } + + $parse['who'] = ""; + $parse['who'] .= ""; + + $parse['type'] = ""; + $parse['type'] .= ""; + $parse['type'] .= ""; + $parse['type'] .= ""; + $parse['type'] .= ""; + + if ($type == 1) { + $Order = "total_points"; + $Points = "total_points"; + $Counts = "total_count"; + $Rank = "total_rank"; + $OldRank = "total_old_rank"; + } elseif ($type == 2) { + $Order = "fleet_points"; + $Points = "fleet_points"; + $Counts = "fleet_count"; + $Rank = "fleet_rank"; + $OldRank = "fleet_old_rank"; + } elseif ($type == 3) { + $Order = "tech_count"; + $Points = "tech_points"; + $Counts = "tech_count"; + $Rank = "tech_rank"; + $OldRank = "tech_old_rank"; + } elseif ($type == 4) { + $Order = "build_points"; + $Points = "build_points"; + $Counts = "build_count"; + $Rank = "build_rank"; + $OldRank = "build_old_rank"; + } elseif ($type == 5) { + $Order = "defs_points"; + $Points = "defs_points"; + $Counts = "defs_count"; + $Rank = "defs_rank"; + $OldRank = "defs_old_rank"; + } + + if ($who == 2) { + $MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE 1;", 'alliance', true); + if ($MaxAllys['count'] > 100) { + $LastPage = floor($MaxAllys['count'] / 100); + } + $parse['range'] = ""; + for ($Page = 0; $Page <= $LastPage; $Page++) { + $PageValue = ($Page * 100) + 1; + $PageRange = $PageValue + 99; + $parse['range'] .= ""; + } + + $parse['stat_header'] = parsetemplate(gettemplate('stat_alliancetable_header'), $parse); + + $start = floor($range / 100 % 100) * 100; + $query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '2' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints'); + + $start++; + $parse['stat_date'] = $gameConfig['stats']; + $parse['stat_values'] = ""; + while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) { + $parse['ally_rank'] = $start; + + $AllyRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'alliance',true); + + $rank_old = $StatRow[ $OldRank ]; + if ( $rank_old == 0) { + $rank_old = $start; + $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); + } else { + $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '2' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); + } + $rank_new = $start; + $ranking = $rank_old - $rank_new; + if ($ranking == "0") { + $parse['ally_rankplus'] = "*"; + } + if ($ranking < "0") { + $parse['ally_rankplus'] = "".$ranking.""; + } + if ($ranking > "0") { + $parse['ally_rankplus'] = "+".$ranking.""; + } + $parse['ally_tag'] = $AllyRow['ally_tag']; + $parse['ally_name'] = $AllyRow['ally_name']; + $parse['ally_mes'] = ''; + $parse['ally_members'] = $AllyRow['ally_members']; + $parse['ally_points'] = pretty_number( $StatRow[ $Order ] ); + $parse['ally_members_points'] = pretty_number( floor($StatRow[ $Order ] / $AllyRow['ally_members']) ); + + $parse['stat_values'] .= parsetemplate(gettemplate('stat_alliancetable'), $parse); + $start++; + } + } else { + $MaxUsers = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE `db_deaktjava` = '0';", 'users', true); + if ($MaxUsers['count'] > 100) { + $LastPage = floor($MaxUsers['count'] / 100); + } + $parse['range'] = ""; + for ($Page = 0; $Page <= $LastPage; $Page++) { + $PageValue = ($Page * 100) + 1; + $PageRange = $PageValue + 99; + $parse['range'] .= ""; + } + + $parse['stat_header'] = parsetemplate(gettemplate('stat_playertable_header'), $parse); + + $start = floor($range / 100 % 100) * 100; + $query = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' ORDER BY `". $Order ."` DESC LIMIT ". $start .",100;", 'statpoints'); + + $start++; + $parse['stat_date'] = $gameConfig['stats']; + $parse['stat_values'] = ""; + while ($StatRow = $query->fetch(PDO::FETCH_ASSOC)) { + $parse['stat_date'] = date("d M Y - H:i:s", $StatRow['stat_date']); + $parse['player_rank'] = $start; + + $UsrRow = doquery("SELECT * FROM {{table}} WHERE `id` = '". $StatRow['id_owner'] ."';", 'users',true); + + $QryUpdateStats .= "`stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $TheRank['id_owner'] ."';"; + + + $rank_old = $StatRow[ $OldRank ]; + if ( $rank_old == 0) { + $rank_old = $start; + $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."', `".$OldRank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); + } else { + $QryUpdRank = doquery("UPDATE {{table}} SET `".$Rank."` = '".$start."' WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '". $StatRow['id_owner'] ."';" , "statpoints"); + } + $rank_new = $start; + $ranking = $rank_old - $rank_new; + if ($ranking == "0") { + $parse['player_rankplus'] = "*"; + } + if ($ranking < "0") { + $parse['player_rankplus'] = "".$ranking.""; + } + if ($ranking > "0") { + $parse['player_rankplus'] = "+".$ranking.""; + } + if ($UsrRow['id'] == $user['id']) { + $parse['player_name'] = "".$UsrRow['username'].""; + } else { + $parse['player_name'] = $UsrRow['username']; + } + $parse['player_mes'] = "\""."; + if ($UsrRow['ally_name'] == $user['ally_name']) { + $parse['player_alliance'] = "".$UsrRow['ally_name'].""; + } else { + $parse['player_alliance'] = $UsrRow['ally_name']; + } + $parse['player_points'] = pretty_number( $StatRow[ $Order ] ); + $parse['stat_values'] .= parsetemplate(gettemplate('stat_playertable'), $parse); + $start++; + } + } + + $page = parsetemplate( gettemplate('stat_body'), $parse ); + + display($page, $lang['stat_title']); + +// ----------------------------------------------------------------------------------------------------------- +// History version +// 1.0 - R��criture module +?> diff --git a/src/techdetails.php b/techdetails.php similarity index 94% rename from src/techdetails.php rename to techdetails.php index 62b92e2..fd02217 100644 --- a/src/techdetails.php +++ b/techdetails.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/src/techtree.php b/techtree.php similarity index 96% rename from src/techtree.php rename to techtree.php index 72920e9..617aa8e 100644 --- a/src/techtree.php +++ b/techtree.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify diff --git a/tests/.placeholder b/tests/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/src/verband.php b/verband.php similarity index 99% rename from src/verband.php rename to verband.php index e6e1809..1fcd63b 100644 --- a/src/verband.php +++ b/verband.php @@ -3,9 +3,9 @@ * This file is part of Wootook * * @license http://www.gnu.org/licenses/gpl-3.0.txt - * @see http://wootook.org/ + * @see http://www.wootook.com/ * - * Copyright (c) 2009-Present, Wootook Support Team + * Copyright (c) 2009-Present, Wootook Support Team * All rights reserved. * * This program is free software: you can redistribute it and/or modify