Refactored to 2 namespaces: Wootook & Legacies
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
cfeb6aca6d
commit
ec7e40e1aa
1004 changed files with 4808 additions and 2971 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,13 +24,13 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||
includeLang('admin/Queries');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin/fleets');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,18 +24,18 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
includeLang('admin');
|
||||
|
||||
function XNovaResetUnivers ( $CurrentUser ) {
|
||||
function WootookResetUnivers ( $CurrentUser ) {
|
||||
global $lang;
|
||||
|
||||
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN))) {
|
||||
|
|
@ -129,7 +129,7 @@ function XNovaResetUnivers ( $CurrentUser ) {
|
|||
$parse = $lang;
|
||||
|
||||
if ($mode == 'reset') {
|
||||
XNovaResetUnivers ( $user );
|
||||
WootookResetUnivers ( $user );
|
||||
} else {
|
||||
$Page = parsetemplate($PageTpl, $parse);
|
||||
display ($Page, $lang['Reset'], false, '', true);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if ($user['authlevel'] >= 1) {
|
||||
includeLang('admin/add_fleet');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin/addmoon');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN))) {
|
||||
$lang['PHP_SELF'] = 'options.'.PHPEXT;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
includeLang('changelog');
|
||||
$template = gettemplate('changelog_table');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
includeLang('admin');
|
||||
$parse = $lang;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
includeLang('credit');
|
||||
$parse = $lang;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($CurrentUser['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
$PageTpl = gettemplate( "admin/deletuser" );
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
includeLang('admin');
|
||||
$parse = $lang;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
includeLang('leftmenu');
|
||||
|
||||
|
|
@ -39,8 +39,8 @@ includeLang('leftmenu');
|
|||
$parse = $lang;
|
||||
$parse['mf'] = "Hauptframe";
|
||||
$parse['dpath'] = $dpath;
|
||||
$parse['XNovaRelease'] = VERSION;
|
||||
$parse['servername'] = XNova;
|
||||
$parse['WootookRelease'] = VERSION;
|
||||
$parse['servername'] = Wootook;
|
||||
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
|
||||
display( $Page, "", false, '', true);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin/changepass');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin/md5enc');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin/messagelist');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
if ($_POST && $mode == "change") {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('overview');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin/multi');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ define('INSIDE' , true);
|
|||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
|
||||
|
|
@ -59,5 +59,5 @@ require_once dirname(dirname(__FILE__)) .'/common.php';
|
|||
message($lang['sys_noalloaw'], $lang['sys_noaccess']);
|
||||
}
|
||||
|
||||
// Created by e-Zobar. All rights reversed (C) XNova Team 2008
|
||||
// Created by e-Zobar. All rights reversed (C) Wootook Team 2008
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
|
||||
function DisplayGameSettingsPage ( $CurrentUser ) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ define('INSIDE' , true);
|
|||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
include(ROOT_PATH . 'admin/statfunctions.' . PHPEXT);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR))) {
|
||||
includeLang('admin');
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,14 +24,14 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/common.php';
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
|
||||
|
|
|
|||
10
ainfo.php
10
ainfo.php
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,13 +24,13 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
$dpath = (!$userrow["dpath"]) ? DEFAULT_SKINPATH : $userrow["dpath"];
|
||||
|
||||
|
|
|
|||
16
alliance.php
16
alliance.php
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,16 +24,16 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSTALL' , false);
|
||||
define('INSIDE' , true);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
$user = Legacies_Empire_Model_User::getSingleton();
|
||||
$db = Legacies_Database::getSingleton();
|
||||
$user = Wootook_Empire_Model_User::getSingleton();
|
||||
$db = Wootook_Database::getSingleton();
|
||||
|
||||
if(!$user->getId()){
|
||||
echo '<script language="javascript">';
|
||||
|
|
@ -930,7 +930,7 @@ elseif ($user->getData('ally_id') != 0 && $user->getData('ally_request') == 0) {
|
|||
$lang['Set_range'] = 'Set rang';
|
||||
$f['Set_range'] = $lang['Set_range'];
|
||||
$f['Expel_user'] = $lang['Expel_user'];
|
||||
|
||||
|
||||
$f['You_are_sure_want_kick_to'] = str_replace("%s", $u['username'], $lang['You_are_sure_want_kick_to']);
|
||||
$f['id'] = $u['id'];
|
||||
$u["functions"] = parsetemplate($f_template, $f);
|
||||
|
|
|
|||
10
annonce.php
10
annonce.php
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,13 +24,13 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users');
|
||||
$annonce = doquery("SELECT * FROM {{table}} ", 'annonce');
|
||||
$action = $_GET['action'];
|
||||
|
|
|
|||
10
annonce2.php
10
annonce2.php
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,13 +24,13 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
define('INSIDE' , true);
|
||||
define('INSTALL' , false);
|
||||
require_once dirname(__FILE__) .'/common.php';
|
||||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
$actions = $_GET['action'];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -57,8 +57,8 @@ if (!defined('DEBUG')) {
|
|||
@error_reporting(E_ALL | E_STRICT);
|
||||
}
|
||||
|
||||
defined('ROOT_PATH') || define('ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||
defined('APPLICATION_PATH') || define('APPLICATION_PATH', ROOT_PATH . 'includes' . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR);
|
||||
defined('ROOT_PATH') || define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
|
||||
defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
|
||||
|
||||
defined('PHPEXT') || define('PHPEXT', require 'extension.inc');
|
||||
|
||||
|
|
@ -76,20 +76,15 @@ function __autoload($class) {
|
|||
include_once str_replace('_', '/', $class) . '.php';
|
||||
}
|
||||
|
||||
Legacies_Core_Time::init();
|
||||
Legacies_Core_ErrorProfiler::register();
|
||||
Wootook_Core_Time::init();
|
||||
Wootook_Core_ErrorProfiler::register();
|
||||
Wootook_Core_Model_Config_Events::registerEvents();
|
||||
|
||||
if (0 === filesize(ROOT_PATH . 'config.php')) {
|
||||
header('Location: install/');
|
||||
die();
|
||||
}
|
||||
|
||||
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
|
||||
foreach ($listenerList as $listener) {
|
||||
Legacies::registerListener($event, $listener);
|
||||
}
|
||||
}
|
||||
|
||||
$lang = array();
|
||||
|
||||
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
|
||||
|
|
@ -105,14 +100,13 @@ include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT);
|
|||
include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT);
|
||||
include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
|
||||
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
|
||||
include(ROOT_PATH . 'db/mysql.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
|
||||
|
||||
$gameConfig = Legacies_Core_Model_Config::getSingleton();
|
||||
$gameConfig = Wootook_Core_Model_Config::getSingleton();
|
||||
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
|
||||
Legacies_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
|
||||
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
|
||||
}
|
||||
$user = Legacies_Empire_Model_User::getSingleton();
|
||||
$user = Wootook_Empire_Model_User::getSingleton();
|
||||
|
||||
if (!defined('DISABLE_IDENTITY_CHECK')) {
|
||||
if (($user === null || !$user->getId())) {
|
||||
|
|
@ -143,7 +137,7 @@ if (($user !== null && $user->getId())) {
|
|||
/*
|
||||
* Update planet resources and constructions
|
||||
*/
|
||||
Legacies::dispatchEvent('planet.update', array(
|
||||
Wootook::dispatchEvent('planet.update', array(
|
||||
'planet' => $planet
|
||||
));
|
||||
$planet->save();
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
* 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
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ class Legacies_Empire
|
|||
|
||||
public static function getFieldName($id)
|
||||
{
|
||||
$fieldsAlias = Legacies_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
$fieldsAlias = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
|
||||
if (!isset($fieldsAlias[$id])) {
|
||||
return null;
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_ResearchLab
|
||||
extends Wootook_Empire_Block_Planet_BuilderAbstract
|
||||
{
|
||||
protected $_planet = null;
|
||||
|
||||
public function setPlanet(Wootook_Empire_Model_Planet $planet)
|
||||
{
|
||||
$this->_planet = $planet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlanet()
|
||||
{
|
||||
if ($this->_planet === null) {
|
||||
$this->_planet = Wootook_Empire_Model_User::getSingleton()
|
||||
->getCurrentPlanet()
|
||||
;
|
||||
}
|
||||
return $this->_planet;
|
||||
}
|
||||
|
||||
public function _initChildBlocks()
|
||||
{
|
||||
$types = Wootook_Empire_Model_Game_Types::getSingleton();
|
||||
|
||||
/** @var Wootook_Core_Block_Concat $parentBlock */
|
||||
$parentBlock = $this->getLayout()->getBlock('item-list.items');
|
||||
foreach ($types->getData(Legacies_Empire::TYPE_RESEARCH) as $itemId) {
|
||||
if (!$this->getPlanet()->getResearchLab()->checkAvailability($itemId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$block = $this->getItemBlock($itemId);
|
||||
$parentBlock->setPartial($block->getName(), $block);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_ResearchLab_Item
|
||||
extends Legacies_Empire_Block_Planet_Builder_ItemAbstract
|
||||
extends Wootook_Empire_Block_Planet_Builder_ItemAbstract
|
||||
{
|
||||
public function getLevel()
|
||||
{
|
||||
|
|
@ -29,7 +62,7 @@ class Legacies_Empire_Block_Planet_ResearchLab_Item
|
|||
|
||||
$resourceConfig = array();
|
||||
foreach ($resources as $resourceId => $resourceValue) {
|
||||
$resourceConfig[$resourceId] = new Legacies_Object(array(
|
||||
$resourceConfig[$resourceId] = new Wootook_Object(array(
|
||||
'resource_id' => $resourceId,
|
||||
'value' => $resourceValue
|
||||
));
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_ResearchLab_Queue
|
||||
extends Wootook_Empire_Block_Planet_Builder_QueueAbstract
|
||||
{
|
||||
public function getQueue()
|
||||
{
|
||||
return $this->getPlanet()->getResearchLab()->getBuilder();
|
||||
}
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return $this->getQueue()->count() == 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_ResearchLab_Queue_Item
|
||||
extends Legacies_Empire_Block_Planet_Builder_Queue_ItemAbstract
|
||||
extends Wootook_Empire_Block_Planet_Builder_Queue_ItemAbstract
|
||||
{
|
||||
protected $_itemIdField = 'research_id';
|
||||
|
||||
|
|
@ -36,7 +70,7 @@ class Legacies_Empire_Block_Planet_ResearchLab_Queue_Item
|
|||
|
||||
$resourceConfig = array();
|
||||
foreach ($resources as $resourceId => $resourceValue) {
|
||||
$resourceConfig[$resourceId] = new Legacies_Object(array(
|
||||
$resourceConfig[$resourceId] = new Wootook_Object(array(
|
||||
'resource_id' => $resourceId,
|
||||
'value' => $resourceValue
|
||||
));
|
||||
|
|
@ -1,7 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_Shipyard
|
||||
extends Legacies_Empire_Block_Planet_BuilderAbstract
|
||||
extends Wootook_Empire_Block_Planet_BuilderAbstract
|
||||
{
|
||||
protected $_planet = null;
|
||||
protected $_type = Legacies_Empire::TYPE_SHIP;
|
||||
|
|
@ -11,7 +44,7 @@ class Legacies_Empire_Block_Planet_Shipyard
|
|||
Legacies_Empire::TYPE_DEFENSE
|
||||
);
|
||||
|
||||
public function setPlanet(Legacies_Empire_Model_Planet $planet)
|
||||
public function setPlanet(Wootook_Empire_Model_Planet $planet)
|
||||
{
|
||||
$this->_planet = $planet;
|
||||
|
||||
|
|
@ -21,7 +54,7 @@ class Legacies_Empire_Block_Planet_Shipyard
|
|||
public function getPlanet()
|
||||
{
|
||||
if ($this->_planet === null) {
|
||||
$this->_planet = Legacies_Empire_Model_User::getSingleton()
|
||||
$this->_planet = Wootook_Empire_Model_User::getSingleton()
|
||||
->getCurrentPlanet()
|
||||
;
|
||||
}
|
||||
|
|
@ -64,9 +97,9 @@ class Legacies_Empire_Block_Planet_Shipyard
|
|||
|
||||
public function _initChildBlocks()
|
||||
{
|
||||
$types = Legacies_Empire_Model_Game_Types::getSingleton();
|
||||
$types = Wootook_Empire_Model_Game_Types::getSingleton();
|
||||
|
||||
/** @var Legacies_Core_Block_Concat $parentBlock */
|
||||
/** @var Wootook_Core_Block_Concat $parentBlock */
|
||||
$parentBlock = $this->getLayout()->getBlock('item-list.items');
|
||||
foreach ($types->getData($this->getType()) as $itemId) {
|
||||
if (!$this->getPlanet()->getShipyard()->checkAvailability($itemId)) {
|
||||
|
|
@ -1,7 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_Shipyard_Item
|
||||
extends Legacies_Empire_Block_Planet_Builder_ItemAbstract
|
||||
extends Wootook_Empire_Block_Planet_Builder_ItemAbstract
|
||||
{
|
||||
public function getQty()
|
||||
{
|
||||
|
|
@ -29,7 +63,7 @@ class Legacies_Empire_Block_Planet_Shipyard_Item
|
|||
|
||||
$resourceConfig = array();
|
||||
foreach ($resources as $resourceId => $resourceValue) {
|
||||
$resourceConfig[$resourceId] = new Legacies_Object(array(
|
||||
$resourceConfig[$resourceId] = new Wootook_Object(array(
|
||||
'resource_id' => $resourceId,
|
||||
'value' => $resourceValue
|
||||
));
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Block_Planet_Shipyard_Queue
|
||||
extends Wootook_Empire_Block_Planet_Builder_QueueAbstract
|
||||
{
|
||||
public function getQueue()
|
||||
{
|
||||
return $this->getPlanet()->getShipyard()->getBuilder();
|
||||
}
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return $this->getQueue()->count() == 0;
|
||||
}
|
||||
}
|
||||
37
application/code/core/Legacies/Empire/Exception.php
Normal file
37
application/code/core/Legacies/Empire/Exception.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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 Legacies_Empire_Exception {}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_CristalMine
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
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),
|
||||
Legacies_Empire::RESOURCE_ENERGY => -10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_DeuteriumSynthetiser
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
public function getProductionRatios($level, $produtionRatio, $planet, $user)
|
||||
{
|
||||
return array(
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => 10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio),
|
||||
Legacies_Empire::RESOURCE_ENERGY => -30 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_FusionReactor
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
public function getProductionRatios($level, $produtionRatio, $planet, $user)
|
||||
{
|
||||
return array(
|
||||
Legacies_Empire::RESOURCE_DEUTERIUM => -10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio),
|
||||
Legacies_Empire::RESOURCE_ENERGY => 50 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_MetalMine
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
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),
|
||||
Legacies_Empire::RESOURCE_ENERGY => -10 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_NaniteFactory
|
||||
implements Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
public static function buildingTimeListener($event)
|
||||
{
|
||||
$planet = $event->getData('planet');
|
||||
|
||||
if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_NANITE_FACTORY)) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$time = $event->getData('time');
|
||||
|
||||
$speedFactor = pow(2, $level);
|
||||
$event->setData('time', $time / $speedFactor);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
* 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
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
* @subpackage Legacies_Empire
|
||||
*/
|
||||
class Legacies_Empire_Model_Planet_Building_ResearchLab
|
||||
implements Legacies_Empire_Model_Planet_BuildingInterface
|
||||
implements Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
private $_eventPrefix = 'planet.laboratory.';
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
public function appendQueue($researchId, $destroy = false, $time = null)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = Legacies::now();
|
||||
$time = Wootook::now();
|
||||
}
|
||||
|
||||
if ($destroy === false) {
|
||||
|
|
@ -132,7 +132,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
}
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
'research_id' => $researchId,
|
||||
'level' => &$level,
|
||||
'time' => &$time,
|
||||
|
|
@ -144,7 +144,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
$this->_builder->appendQueue($researchId, $level, $time);
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'append-queue.after', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'append-queue.after', array(
|
||||
'research_id' => $researchId,
|
||||
'level' => $level,
|
||||
'time' => $time,
|
||||
|
|
@ -164,11 +164,11 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
public function updateQueue($time = null)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = Legacies::now();
|
||||
$time = Wootook::now();
|
||||
}
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.before', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'update-queue.before', array(
|
||||
'time' => &$time,
|
||||
'laboratory' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -178,7 +178,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
$this->_builder->updateQueue($time);
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.after', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'update-queue.after', array(
|
||||
'time' => $time,
|
||||
'laboratory' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -210,7 +210,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab
|
|||
{
|
||||
try {
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'check-availability', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'check-availability', array(
|
||||
'research_id' => $researchId,
|
||||
'laboratory' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -1,7 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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 Legacies_Empire_Model_BuilderAbstract
|
||||
extends Wootook_Empire_Model_BuilderAbstract
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
|
|
@ -54,7 +87,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
|
|||
*/
|
||||
public function checkAvailability($technologyId)
|
||||
{
|
||||
$types = Legacies_Empire_Model_Game_Types::getSingleton();
|
||||
$types = Wootook_Empire_Model_Game_Types::getSingleton();
|
||||
|
||||
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
|
||||
return false;
|
||||
|
|
@ -73,9 +106,9 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
|
|||
*/
|
||||
public function getBuildingTime($technologyId, $level)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$types = Legacies_Empire_Model_Game_Types::getSingleton();
|
||||
$gameConfig = Legacies_Core_Model_Config::getSingleton();
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
$types = Wootook_Empire_Model_Game_Types::getSingleton();
|
||||
$gameConfig = Wootook_Core_Model_Config::getSingleton();
|
||||
|
||||
Math::setPrecision(50);
|
||||
|
||||
|
|
@ -116,8 +149,8 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
|
|||
*/
|
||||
public function getResourcesNeeded($technologyId, $level)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$resources = Legacies_Empire_Model_Game_Resources::getSingleton();
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
$resources = Wootook_Empire_Model_Game_Resources::getSingleton();
|
||||
|
||||
if (!isset($prices[$technologyId])) {
|
||||
return array();
|
||||
|
|
@ -144,7 +177,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
|
|||
*/
|
||||
public function updateQueue($time)
|
||||
{
|
||||
$fields = Legacies_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
|
||||
$elapsedTime = $time - $this->_currentUser->getData('b_laboratory');
|
||||
|
||||
|
|
@ -192,7 +225,7 @@ class Legacies_Empire_Model_Planet_Building_ResearchLab_Builder
|
|||
return $this;
|
||||
}
|
||||
|
||||
$types = Legacies_Empire_Model_Game_Types::getSingleton();
|
||||
$types = Wootook_Empire_Model_Game_Types::getSingleton();
|
||||
if (!$types->is($technologyId, Legacies_Empire::TYPE_RESEARCH)) {
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Item
|
||||
extends Wootook_Empire_Model_Builder_Item
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_RoboticFactory
|
||||
implements Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
public static function buildingTimeListener($event)
|
||||
{
|
||||
$planet = $event->getData('planet');
|
||||
|
||||
if (!$planet->getId() || ($level = $planet->getElement(Legacies_Empire::ID_BUILDING_ROBOTIC_FACTORY)) <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$time = $event->getData('time');
|
||||
|
||||
$speedFactor = 1 + $level;
|
||||
$event->setData('time', $time / $speedFactor);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
* 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
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
* @subpackage Legacies_Empire
|
||||
*/
|
||||
class Legacies_Empire_Model_Planet_Building_Shipyard
|
||||
implements Legacies_Empire_Model_Planet_BuildingInterface
|
||||
implements Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
private $_eventPrefix = 'planet.shipyard.';
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
*/
|
||||
protected function _now()
|
||||
{
|
||||
return Legacies::now();
|
||||
return Wootook::now();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -145,11 +145,11 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
public function appendQueue($shipId, $qty, $time = null)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = Legacies::now();
|
||||
$time = Wootook::now();
|
||||
}
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
'ship_id' => $shipId,
|
||||
'qty' => &$qty,
|
||||
'time' => &$time,
|
||||
|
|
@ -161,7 +161,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
$this->_builder->appendQueue($shipId, $qty, $time);
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'append-queue.before', array(
|
||||
'ship_id' => $shipId,
|
||||
'qty' => $qty,
|
||||
'time' => $time,
|
||||
|
|
@ -181,11 +181,11 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
public function updateQueue($time = null)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = Legacies::now();
|
||||
$time = Wootook::now();
|
||||
}
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.before', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'update-queue.before', array(
|
||||
'time' => &$time,
|
||||
'shipyard' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -195,7 +195,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
$this->_builder->updateQueue($time);
|
||||
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'update-queue.after', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'update-queue.after', array(
|
||||
'time' => $time,
|
||||
'shipyard' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -227,7 +227,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard
|
|||
{
|
||||
try {
|
||||
// Dispatch event
|
||||
Legacies::dispatchEvent($this->_eventPrefix . 'check-availability', array(
|
||||
Wootook::dispatchEvent($this->_eventPrefix . 'check-availability', array(
|
||||
'ship_id' => $shipId,
|
||||
'shipyard' => $this,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -1,7 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Shipyard_Builder
|
||||
extends Legacies_Empire_Model_BuilderAbstract
|
||||
extends Wootook_Empire_Model_BuilderAbstract
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
|
|
@ -54,7 +88,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
*/
|
||||
public function checkAvailability($shipId)
|
||||
{
|
||||
$types = Legacies_Empire_Model_Game_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;
|
||||
|
|
@ -74,9 +108,9 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
*/
|
||||
public function getMaximumBuildableElementsCount($shipId)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$fields = Legacies_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
$resources = Legacies_Empire_Model_Game_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 => $_) {
|
||||
|
|
@ -150,8 +184,8 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
*/
|
||||
public function getBuildingTime($shipId, $qty)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$gameConfig = Legacies_Core_Model_Config::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], $qty);
|
||||
|
|
@ -161,7 +195,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
|
||||
Math::setPrecision();
|
||||
|
||||
$event = Legacies::dispatchEvent('planet.shipyard.building-time', array(
|
||||
$event = Wootook::dispatchEvent('planet.shipyard.building-time', array(
|
||||
'time' => $baseTime,
|
||||
'base_time' => $baseTime,
|
||||
'planet' => $this->_currentPlanet,
|
||||
|
|
@ -179,8 +213,8 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
*/
|
||||
public function getResourcesNeeded($shipId, $qty)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$resources = Legacies_Empire_Model_Game_Resources::getSingleton();
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
$resources = Wootook_Empire_Model_Game_Resources::getSingleton();
|
||||
|
||||
if (!isset($prices[$shipId])) {
|
||||
return array();
|
||||
|
|
@ -218,7 +252,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
*/
|
||||
public function updateQueue($time)
|
||||
{
|
||||
$fields = Legacies_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
$fields = Wootook_Empire_Model_Game_FieldsAlias::getSingleton();
|
||||
|
||||
$elapsedTime = $time - $this->_currentPlanet->getData('b_hangar');
|
||||
|
||||
|
|
@ -266,7 +300,7 @@ class Legacies_Empire_Model_Planet_Building_Shipyard_Builder
|
|||
return $this;
|
||||
}
|
||||
|
||||
$types = Legacies_Empire_Model_Game_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;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Shipyard_Item
|
||||
extends Wootook_Empire_Model_Builder_Item
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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.
|
||||
*
|
||||
*/
|
||||
|
||||
class Legacies_Empire_Model_Planet_Building_SolarPlant
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface, Wootook_Empire_Model_Planet_BuildingInterface
|
||||
{
|
||||
public function getProductionRatios($level, $produtionRatio, $planet, $user)
|
||||
{
|
||||
return array(
|
||||
Legacies_Empire::RESOURCE_ENERGY => 20 * floatval($level) * pow(1.1, floatval($level)) * (0.1 * $produtionRatio)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Ship_LargeTransport
|
||||
extends Wootook_Empire_Model_Planet_ShipAbstract
|
||||
{
|
||||
const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE = 4;
|
||||
|
||||
public function getBaseSpeed(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
|
||||
return $prices[Legacies_Empire::ID_SHIP_LARGE_TRANSPORT][Legacies_Empire::SHIPS_CELERITY_PRIMARY];
|
||||
}
|
||||
|
||||
public function getSpeedMultiplier(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
return pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_COMBUSTION_DRIVE));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Ship_LightTransport
|
||||
extends Wootook_Empire_Model_Planet_ShipAbstract
|
||||
{
|
||||
const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_IMPULSE_DRIVE = 4;
|
||||
|
||||
public function getBaseSpeed(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
|
||||
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_Empire_Model_User $user)
|
||||
{
|
||||
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, $user->getElement(Legacies_Empire::ID_RESEARCH_IMPULSE_DRIVE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Ship_SolarSatellite
|
||||
extends Wootook_Empire_Model_Planet_ShipAbstract
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface
|
||||
{
|
||||
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_Empire_Model_User $user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getSpeedMultiplier(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getActualSpeed(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getBaseConsumption(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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_Ship_Supernova
|
||||
extends Legacies_Empire_Model_Planet_ShipAbstract
|
||||
implements Legacies_Empire_Model_Planet_ResourceProductionInterface
|
||||
extends Wootook_Empire_Model_Planet_ShipAbstract
|
||||
implements Wootook_Empire_Model_Planet_ResourceProductionInterface
|
||||
{
|
||||
const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_DRIVE = 20;
|
||||
const REQUIREMENT_TO_UPGRADE_CELERITY__RESEARCH_HYPERSPACE_TECHNOLOGY = 15;
|
||||
|
|
@ -14,9 +47,9 @@ class Legacies_Empire_Model_Planet_Ship_Supernova
|
|||
);
|
||||
}
|
||||
|
||||
public function getBaseSpeed(Legacies_Empire_Model_User $user)
|
||||
public function getBaseSpeed(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
$prices = Legacies_Empire_Model_Game_Prices::getSingleton();
|
||||
$prices = Wootook_Empire_Model_Game_Prices::getSingleton();
|
||||
|
||||
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) {
|
||||
|
|
@ -26,7 +59,7 @@ class Legacies_Empire_Model_Planet_Ship_Supernova
|
|||
}
|
||||
}
|
||||
|
||||
public function getSpeedMultiplier(Legacies_Empire_Model_User $user)
|
||||
public function getSpeedMultiplier(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
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) {
|
||||
|
|
@ -36,4 +69,9 @@ class Legacies_Empire_Model_Planet_Ship_Supernova
|
|||
pow(1.1, $user->getElement(Legacies_Empire::ID_RESEARCH_HYPERSPACE_TECHNOLOGY));
|
||||
}
|
||||
}
|
||||
|
||||
public function getBaseConsumption(Wootook_Empire_Model_User $user)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
37
application/code/core/Legacies/Exception.php
Normal file
37
application/code/core/Legacies/Exception.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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 Legacies_Exception {}
|
||||
37
application/code/core/Legacies/Officers/Exception.php
Normal file
37
application/code/core/Legacies/Officers/Exception.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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 Legacies_Officers_Exception {}
|
||||
70
application/code/core/Legacies/Officers/Model/Observer.php
Normal file
70
application/code/core/Legacies/Officers/Model/Observer.php
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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(Legacies_Empire_Model_User::SESSION_KEY)
|
||||
->addInfo('You gained 1 miner level.');
|
||||
} else {
|
||||
Wootook::getSession(Legacies_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(Legacies_Empire_Model_User::SESSION_KEY)
|
||||
->addInfo('You gained 1 raider level.');
|
||||
} else {
|
||||
Wootook::getSession(Legacies_Empire_Model_User::SESSION_KEY)
|
||||
->addInfo('You gained %1$d raider level.', (int) $difference);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
40
application/code/core/Legacies/Oficers.php
Normal file
40
application/code/core/Legacies/Oficers.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of XNova:Legacies
|
||||
* This file is part of Wootook
|
||||
*
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
* @see http://www.xnova-ng.org/
|
||||
* @license http://www.gnu.org/licenses/agpl-3.0.txt
|
||||
* @see http://www.wootook.com/
|
||||
*
|
||||
* Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
|
||||
* Copyright (c) 2011-Present, Grégory PLANCHAT <g.planchat@gmail.com>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
|
@ -18,23 +18,23 @@
|
|||
* 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
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --> 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.
|
||||
* documentation for further information about customizing Wootook.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Bootstrap class, used to access main and global functionalities
|
||||
*
|
||||
* @package Legacies
|
||||
* @package Wootook
|
||||
* @category core
|
||||
*/
|
||||
class Legacies
|
||||
class Wootook
|
||||
{
|
||||
/**
|
||||
* Static list of application event listeners
|
||||
|
|
@ -78,6 +78,13 @@ class Legacies
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
|
@ -120,7 +127,7 @@ class Legacies
|
|||
*/
|
||||
public static function dispatchEvent($event, $params)
|
||||
{
|
||||
$eventObject = new Legacies_Core_Event($params);
|
||||
$eventObject = new Wootook_Core_Event($params);
|
||||
|
||||
if (!isset(self::$_listeners[$event])) {
|
||||
return $eventObject;
|
||||
|
|
@ -141,7 +148,7 @@ class Legacies
|
|||
*/
|
||||
public static function getSession($namespace)
|
||||
{
|
||||
return Legacies_Core_Model_Session::factory($namespace);
|
||||
return Wootook_Core_Model_Session::factory($namespace);
|
||||
}
|
||||
|
||||
public static function getTranslator($locale = null)
|
||||
|
|
@ -152,7 +159,7 @@ class Legacies
|
|||
|
||||
if (!isset($translator[$locale])) {
|
||||
$path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'locale';
|
||||
$translator[$locale] = new Legacies_Core_Model_Translator($path, $locale);
|
||||
$translator[$locale] = new Wootook_Core_Model_Translator($path, $locale);
|
||||
}
|
||||
return $translator[$locale];
|
||||
}
|
||||
|
|
@ -194,7 +201,7 @@ class Legacies
|
|||
public static function getRequest()
|
||||
{
|
||||
if (self::$_request === null) {
|
||||
self::$_request = new Legacies_Core_Controller_Request_Http();
|
||||
self::$_request = new Wootook_Core_Controller_Request_Http();
|
||||
}
|
||||
return self::$_request;
|
||||
}
|
||||
|
|
@ -207,7 +214,7 @@ class Legacies
|
|||
public static function getResponse()
|
||||
{
|
||||
if (self::$_response === null) {
|
||||
self::$_response = new Legacies_Core_Controller_Response_Http();
|
||||
self::$_response = new Wootook_Core_Controller_Response_Http();
|
||||
}
|
||||
return self::$_response;
|
||||
}
|
||||
|
|
@ -217,9 +224,39 @@ class Legacies
|
|||
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())
|
||||
{
|
||||
// TODO: base path integration
|
||||
$baseUrl = self::getBaseUrl();
|
||||
|
||||
$serializedParams = array();
|
||||
foreach ($params as $paramKey => $paramValue) {
|
||||
if ($paramValue) {
|
||||
|
|
@ -228,8 +265,21 @@ class Legacies
|
|||
}
|
||||
|
||||
if (count($serializedParams) > 0) {
|
||||
return $uri . '?' . implode('&', $serializedParams);
|
||||
return $baseUrl . $uri . '?' . implode('&', $serializedParams);
|
||||
}
|
||||
return $uri;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Concat
|
||||
extends Legacies_Core_View
|
||||
class Wootook_Core_Block_Concat
|
||||
extends Wootook_Core_View
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
10
application/code/core/Wootook/Core/Block/Deprecated.php
Normal file
10
application/code/core/Wootook/Core/Block/Deprecated.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Block_Deprecated
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
public function getScriptPath()
|
||||
{
|
||||
return $this->getLayout()->getScriptPath();
|
||||
}
|
||||
}
|
||||
11
application/code/core/Wootook/Core/Block/Html/Form.php
Normal file
11
application/code/core/Wootook/Core/Block/Html/Form.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Block_Html_Form
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
public function getFormKey()
|
||||
{
|
||||
$session = Wootook::getSession('security');
|
||||
return $session->getFormKey(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Html_Head
|
||||
extends Legacies_Core_Block_Template
|
||||
class Wootook_Core_Block_Html_Head
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
const TYPE_GLOBAL_JS = 'global_js';
|
||||
|
||||
|
|
@ -133,8 +133,8 @@ HTML_EOF;
|
|||
{
|
||||
$render = '';
|
||||
foreach ($this->getJs() as $js) {
|
||||
if (!isset($css['media'])) {
|
||||
$css['media'] = 'all';
|
||||
if (!isset($js['type'])) {
|
||||
$js['type'] = 'text/javascript';
|
||||
}
|
||||
$render .=<<<HTML_EOF
|
||||
<script type="{$js['type']}" src="{$js['path']}"></script>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Html_Navigation
|
||||
extends Legacies_Core_Block_Template
|
||||
class Wootook_Core_Block_Html_Navigation
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
public function addLink($name, $label, $title, $uri, Array $params = array(), Array $classes = array(), $template = null)
|
||||
{
|
||||
|
|
@ -54,8 +54,8 @@ class Legacies_Core_Block_Html_Navigation
|
|||
->createBlock('core/html.navigation.node', $this->getNameInLayout() . '.' . $name);
|
||||
}
|
||||
|
||||
if ($child instanceof Legacies_Core_Block_Html_Navigation_Link) {
|
||||
throw new RuntimeException('Node is a link. Could not append a child node to a link node.');
|
||||
if ($child instanceof Wootook_Core_Block_Html_Navigation_Link) {
|
||||
throw new Wootook_Core_Exception_RuntimeException('Node is a link. Could not append a child node to a link node.');
|
||||
}
|
||||
|
||||
if (count($explodedPath) == 0) {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Html_Navigation_Link
|
||||
extends Legacies_Core_Block_Template
|
||||
class Wootook_Core_Block_Html_Navigation_Link
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
protected $_label = '';
|
||||
protected $_title = '';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Html_Navigation_Node
|
||||
extends Legacies_Core_Block_Html_Navigation
|
||||
class Wootook_Core_Block_Html_Navigation_Node
|
||||
extends Wootook_Core_Block_Html_Navigation
|
||||
{
|
||||
protected $_title = '';
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Html_Page
|
||||
extends Legacies_Core_Block_Template
|
||||
class Wootook_Core_Block_Html_Page
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
protected $_bodyClasses = array();
|
||||
|
||||
36
application/code/core/Wootook/Core/Block/Template.php
Normal file
36
application/code/core/Wootook/Core/Block/Template.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Block_Template
|
||||
extends Wootook_Core_View
|
||||
{
|
||||
protected function _getTemplatePath($file)
|
||||
{
|
||||
$pattern = "{$this->getScriptPath()}/%s/%s/scripts/{$file}";
|
||||
if (($layout = $this->getLayout()) !== null) {
|
||||
$package = $this->getLayout()->getPackage();
|
||||
$theme = $this->getLayout()->getTheme();
|
||||
|
||||
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_Layout::DEFAULT_THEME);
|
||||
if (Wootook::fileExists($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$path = sprintf($pattern, Wootook_Core_Layout::DEFAULT_PACKAGE, Wootook_Core_Layout::DEFAULT_THEME);
|
||||
if (Wootook::fileExists($path)) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
trigger_error("Template '{$file}' could not be found.", E_USER_ERROR);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Block_Text
|
||||
extends Legacies_Core_View
|
||||
class Wootook_Core_Block_Text
|
||||
extends Wootook_Core_View
|
||||
{
|
||||
protected $_content = null;
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Collection
|
||||
extends Legacies_Core_Model
|
||||
class Wootook_Core_Collection
|
||||
extends Wootook_Core_Model
|
||||
implements Iterator, Countable
|
||||
{
|
||||
protected $_tableName = null;
|
||||
protected $_tableAlias = null;
|
||||
protected $_entityClassName = 'Legacies_Object';
|
||||
protected $_entityClassName = 'Wootook_Object';
|
||||
|
||||
protected $_columns = array();
|
||||
protected $_where = array();
|
||||
|
|
@ -68,7 +68,7 @@ class Legacies_Core_Collection
|
|||
static $database = null;
|
||||
|
||||
if ($database === null) {
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
}
|
||||
|
||||
return $database->quote($data);
|
||||
|
|
@ -105,7 +105,7 @@ class Legacies_Core_Collection
|
|||
static $database = null;
|
||||
|
||||
if ($database === null) {
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
}
|
||||
|
||||
if (is_array($table)) {
|
||||
|
|
@ -160,7 +160,7 @@ class Legacies_Core_Collection
|
|||
protected function _prepareSql()
|
||||
{
|
||||
if (empty($this->_union)) {
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
|
||||
$fields = array();
|
||||
foreach ($this->_columns as $field) {
|
||||
|
|
@ -254,7 +254,7 @@ SQL_EOF;
|
|||
{
|
||||
$sql = $this->_prepareSql();
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$statement = $database->prepare($sql);
|
||||
|
||||
$args = func_get_args();
|
||||
|
|
@ -301,7 +301,7 @@ SQL_EOF;
|
|||
|
||||
$sql = $clone->_prepareSql();
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$statement = $database->prepare($sql);
|
||||
|
||||
$args = func_get_args();
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Controller_Action
|
||||
class Wootook_Core_Controller_Action
|
||||
{
|
||||
private $_request = null;
|
||||
private $_response = null;
|
||||
|
|
@ -43,11 +43,7 @@ class Legacies_Core_Controller_Action
|
|||
|
||||
protected function _redirect($url)
|
||||
{
|
||||
$this->getResponse()
|
||||
->setRawHeader('HTTP/1.1 302 Found')
|
||||
->setHeader('Location', $url)
|
||||
->setIsRedirect(true)
|
||||
;
|
||||
$this->getResponse()->setRedirect($url);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Controller_Request_Http
|
||||
extends Legacies_Object
|
||||
class Wootook_Core_Controller_Request_Http
|
||||
extends Wootook_Object
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -83,4 +83,20 @@ class Legacies_Core_Controller_Request_Http
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,20 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Controller_Response_Http
|
||||
extends Legacies_Object
|
||||
class Wootook_Core_Controller_Response_Http
|
||||
extends Wootook_Object
|
||||
{
|
||||
const REDIRECT_MOVED_PERMANENTLY = 301;
|
||||
const REDIRECT_FOUND = 302;
|
||||
const REDIRECT_SEE_OTHER = 303;
|
||||
const REDIRECT_TEMPORARY = 307;
|
||||
|
||||
protected static $_redirectCodes = array(
|
||||
REDIRECT_MOVED_PERMANENTLY => 'Moved Permanently',
|
||||
REDIRECT_FOUND => 'Found',
|
||||
REDIRECT_SEE_OTHER => 'See Other',
|
||||
REDIRECT_TEMPORARY => 'Temporary Redirect'
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(array());
|
||||
|
|
@ -129,4 +141,18 @@ class Legacies_Core_Controller_Response_Http
|
|||
setcookie($name, $value, time() + $lifetime, $path, $domain);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setRedirect($url, $code = self::REDIRECT_FOUND)
|
||||
{
|
||||
if (!in_array($code, self::$_redirectCodes)) {
|
||||
$code = self::REDIRECT_FOUND;
|
||||
}
|
||||
|
||||
$statusText = self::$_redirectCodes[$code];
|
||||
$this->setRawHeader("HTTP/1.1 {$code} {$statusText}")
|
||||
->setHeader('Location', $url)
|
||||
->setIsRedirect(true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Email
|
||||
class Wootook_Core_Email
|
||||
{
|
||||
protected static $_defaultHeadrs = array(
|
||||
);
|
||||
|
|
@ -23,7 +23,7 @@ class Legacies_Core_Email
|
|||
$this->setHeader($name, $value);
|
||||
}
|
||||
|
||||
$this->addHeader('X-Mailer', 'PHP/' . PHP_VERSION . ' Legacies/' . VERSION);
|
||||
$this->addHeader('X-Mailer', 'PHP/' . PHP_VERSION . ' Wootook/' . VERSION);
|
||||
$this->addHeader('Content-Transfer-Encoding', '7bit');
|
||||
$this->addHeader('Content-Type', 'text/plain; charset=utf-8');
|
||||
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
<?php
|
||||
|
||||
abstract class Legacies_Core_Entity
|
||||
extends Legacies_Core_Model
|
||||
implements Legacies_Core_EntityInterface
|
||||
abstract class Wootook_Core_Entity
|
||||
extends Wootook_Core_Model
|
||||
implements Wootook_Core_EntityInterface
|
||||
{
|
||||
protected $_idFieldName = null;
|
||||
protected $_tableName = null;
|
||||
|
||||
protected $_eventPrefix = 'entity';
|
||||
|
||||
public function setIdFieldName($fieldName)
|
||||
{
|
||||
$this->_idFieldName = $fieldName;
|
||||
|
|
@ -50,7 +48,7 @@ abstract class Legacies_Core_Entity
|
|||
$id = func_get_arg(0);
|
||||
|
||||
$idFieldName = self::getIdFieldName();
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
|
||||
$sql =<<<SQL_EOF
|
||||
SELECT * FROM {$database->getTable(self::getTableName())}
|
||||
|
|
@ -64,7 +62,7 @@ SQL_EOF;
|
|||
|
||||
$datas = $statement->fetch(PDO::FETCH_ASSOC);
|
||||
if (!is_array($datas) || empty($datas)) {
|
||||
throw new Legacies_Core_Model_Exception('Could not load data: this id could not be found.');
|
||||
throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id could not be found.');
|
||||
}
|
||||
unset($datas[self::getIdFieldName()]);
|
||||
|
||||
|
|
@ -91,7 +89,7 @@ SQL_EOF;
|
|||
$idFieldName = self::getIdFieldName();
|
||||
$values[$idFieldName] = $this->getId();
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$sql =<<<SQL_EOF
|
||||
UPDATE {$database->getTable(self::getTableName())}
|
||||
SET {$fieldsImploded}
|
||||
|
|
@ -115,7 +113,7 @@ SQL_EOF;
|
|||
}
|
||||
$tokensImploded = implode(', ', $tokens);
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$sql =<<<SQL_EOF
|
||||
INSERT INTO {$database->getTable(self::getTableName())} ($fieldsImploded)
|
||||
VALUES ({$tokensImploded})
|
||||
|
|
@ -142,7 +140,7 @@ SQL_EOF;
|
|||
|
||||
$fieldsImploded = implod(', ', $fields);
|
||||
$idFieldName = self::getIdFieldName();
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$sql =<<<SQL_EOF
|
||||
DELETE {$database->getTable(self::getTableName())}
|
||||
WHERE {$idFieldName}=:{$idFieldName}
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* @uses Legacies_Object
|
||||
* @uses Wootook_Object
|
||||
* @uses Legacies_Empire
|
||||
* @uses Legacies_Empire_User
|
||||
* @uses Wootook_Empire_Model_User
|
||||
*/
|
||||
abstract class Legacies_Core_Entity_SubTable
|
||||
extends Legacies_Core_Model
|
||||
abstract class Wootook_Core_Entity_SubTable
|
||||
extends Wootook_Core_Model
|
||||
{
|
||||
private $_isLoaded = false;
|
||||
protected $_tableName = null;
|
||||
|
|
@ -32,7 +32,7 @@ abstract class Legacies_Core_Entity_SubTable
|
|||
$idFields = '(' . implode(') AND (', $idFields) . ')';
|
||||
$fields = implode(', ', $fields);
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$sql =<<<SQL_EOF
|
||||
UPDATE {$database->getTable(self::getTableName())}
|
||||
SET {$fields}
|
||||
|
|
@ -51,7 +51,7 @@ SQL_EOF;
|
|||
}
|
||||
$tokens = implode(', ', $tokens);
|
||||
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$sql =<<<SQL_EOF
|
||||
INSERT INTO {$database->getTable(self::getTableName())} ($fields)
|
||||
VALUES ({$tokens})
|
||||
|
|
@ -66,7 +66,7 @@ SQL_EOF;
|
|||
protected function _load()
|
||||
{
|
||||
$idValues = func_get_arg(0);
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
|
||||
$idFields = array();
|
||||
foreach ($this->_idFieldNames as $field) {
|
||||
|
|
@ -84,7 +84,7 @@ SQL_EOF;
|
|||
|
||||
$datas = $statement->fetch(PDO::FETCH_ASSOC);
|
||||
if (!is_array($datas) || empty($datas)) {
|
||||
throw new Legacies_Core_Model_Exception('Could not load data: this id combination could not be found.');
|
||||
throw new Wootook_Core_Exception_DataAccessException('Could not load data: this id combination could not be found.');
|
||||
}
|
||||
|
||||
$this->_data = $datas;
|
||||
|
|
@ -95,7 +95,7 @@ SQL_EOF;
|
|||
|
||||
protected function _delete()
|
||||
{
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
|
||||
$idFields = array();
|
||||
$idValues = array();
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
interface Legacies_Core_EntityInterface
|
||||
interface Wootook_Core_EntityInterface
|
||||
{
|
||||
public function getId();
|
||||
public function setId($id);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_ErrorProfiler
|
||||
class Wootook_Core_ErrorProfiler
|
||||
{
|
||||
private static $_singleton = null;
|
||||
|
||||
|
|
@ -12,6 +12,8 @@ class Legacies_Core_ErrorProfiler
|
|||
|
||||
private static $_isTraceRegistered = false;
|
||||
|
||||
private static $_listen = true;
|
||||
|
||||
public static function getSingleton()
|
||||
{
|
||||
if (self::$_singleton === null) {
|
||||
|
|
@ -22,6 +24,10 @@ class Legacies_Core_ErrorProfiler
|
|||
|
||||
public function errorManager($errno, $errstr, $errfile = null, $errline = null, Array $errcontext = array())
|
||||
{
|
||||
if (!self::$_listen) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ($errno) {
|
||||
case E_USER_ERROR:
|
||||
case E_ERROR:
|
||||
|
|
@ -80,10 +86,13 @@ class Legacies_Core_ErrorProfiler
|
|||
|
||||
public function exceptionManager($exception)
|
||||
{
|
||||
if (!self::$_listen) {
|
||||
return;
|
||||
}
|
||||
$this->_exceptions[] = $exception;
|
||||
}
|
||||
|
||||
protected function _renderError($error)
|
||||
protected function _renderError($id, $error)
|
||||
{
|
||||
$types = array(
|
||||
0x0001 => 'E_ERROR',
|
||||
|
|
@ -113,6 +122,7 @@ class Legacies_Core_ErrorProfiler
|
|||
$microsec = (int) ($error['time'][0] * 1000000);
|
||||
|
||||
return <<<ERROR_EOF
|
||||
Message #{$id}
|
||||
On: {$date} +{$microsec}µs
|
||||
Type: {$code}
|
||||
Message: {$error['message']}
|
||||
|
|
@ -124,6 +134,7 @@ ERROR_EOF;
|
|||
|
||||
public function shutdownManager()
|
||||
{
|
||||
$index = 0;
|
||||
echo '<div style="background:#FFF;border:1px solid #F00;color:#000;padding:10px;margin:20px;text-align:left;">';
|
||||
echo '<h1>Debug profiler</h1>';
|
||||
if (count($this->_errors) <= 0 && count($this->_warnings) <= 0 &&
|
||||
|
|
@ -133,20 +144,22 @@ ERROR_EOF;
|
|||
} else {
|
||||
echo '<pre>';
|
||||
foreach ($this->_errors as $error) {
|
||||
echo $this->_renderError($error);
|
||||
echo $this->_renderError(++$index, $error);
|
||||
}
|
||||
foreach ($this->_warnings as $error) {
|
||||
echo $this->_renderError($error);
|
||||
echo $this->_renderError(++$index, $error);
|
||||
}
|
||||
foreach ($this->_notices as $error) {
|
||||
echo $this->_renderError($error);
|
||||
echo $this->_renderError(++$index, $error);
|
||||
}
|
||||
foreach ($this->_otherErrors as $errorList) {
|
||||
foreach ($errorList as $error) {
|
||||
echo $this->_renderError($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();
|
||||
}
|
||||
|
|
@ -176,4 +189,14 @@ ERROR_EOF;
|
|||
register_shutdown_function(array(self::getSingleton(), 'shutdownManager'));
|
||||
}
|
||||
}
|
||||
|
||||
public static function sleep()
|
||||
{
|
||||
self::$_listen = false;
|
||||
}
|
||||
|
||||
public static function wakeup()
|
||||
{
|
||||
self::$_listen = true;
|
||||
}
|
||||
}
|
||||
6
application/code/core/Wootook/Core/Event.php
Normal file
6
application/code/core/Wootook/Core/Event.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Event
|
||||
extends Wootook_Object
|
||||
{
|
||||
}
|
||||
7
application/code/core/Wootook/Core/Event/Break.php
Normal file
7
application/code/core/Wootook/Core/Event/Break.php
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Event_Break
|
||||
extends Exception
|
||||
implements Wootook_Core_Exception
|
||||
{
|
||||
}
|
||||
3
application/code/core/Wootook/Core/Exception.php
Normal file
3
application/code/core/Wootook/Core/Exception.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
interface Wootook_Core_Exception extends Wootook_Exception {}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Exception_DataAccessException
|
||||
extends Wootook_Core_Exception_RuntimeException
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Exception_Exception
|
||||
extends Exception
|
||||
implements Wootook_Core_Exception
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Exception_RuntimeException
|
||||
extends RuntimeException
|
||||
implements Wootook_Core_Exception
|
||||
{
|
||||
}
|
||||
|
|
@ -1,22 +1,52 @@
|
|||
<?php
|
||||
|
||||
class Legacies_Core_Layout
|
||||
extends Legacies_Core_Model
|
||||
class Wootook_Core_Layout
|
||||
extends Wootook_Core_Model
|
||||
{
|
||||
const DEFAULT_PACKAGE = 'base';
|
||||
const DEFAULT_THEME = 'default';
|
||||
|
||||
protected $_blocks = array();
|
||||
|
||||
protected $_view = null;
|
||||
protected $_eventPrefix = 'layout';
|
||||
protected $_eventObject = 'layout';
|
||||
|
||||
protected $_package = self::DEFAULT_PACKAGE;
|
||||
protected $_theme = self::DEFAULT_THEME;
|
||||
|
||||
protected $_namespaces = array(
|
||||
'core' => array(
|
||||
'Wootook_Core_Block_' => 'Wootook/core/Block'
|
||||
)
|
||||
);
|
||||
|
||||
public function _init()
|
||||
{
|
||||
$path = APPLICATION_PATH . 'design/layouts/';
|
||||
$modules = Wootook_Core_Model_Config_Modules::getSingleton();
|
||||
|
||||
foreach ($modules['block'] as $module => $moduleNamespaces) {
|
||||
foreach ($moduleNamespaces as $namespace => $path) {
|
||||
$this->registerBlockNamespace($module, $namespace, $path);
|
||||
}
|
||||
}
|
||||
|
||||
$config = include ROOT_PATH . 'config.php';
|
||||
$fileList = $config['global']['layout'];
|
||||
$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']);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fileList as $layoutFile) {
|
||||
foreach (include $path . $layoutFile as $layoutId => $layoutConfig) {
|
||||
foreach (include $this->_getLayoutPath($layoutFile) as $layoutId => $layoutConfig) {
|
||||
if ($this->hasData($layoutId)) {
|
||||
$declared = $this->getData($layoutId);
|
||||
|
||||
|
|
@ -30,7 +60,7 @@ class Legacies_Core_Layout
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function _load()
|
||||
protected function _load()
|
||||
{
|
||||
$layoutId = func_get_arg(0);
|
||||
|
||||
|
|
@ -70,10 +100,14 @@ class Legacies_Core_Layout
|
|||
}
|
||||
unset($layoutConfigs, $layoutConfig['update']);
|
||||
|
||||
$type = $layoutConfig['type'];
|
||||
$name = isset($layoutConfig['name']) ? $layoutConfig['name'] : 'root';
|
||||
if (isset($layoutConfig['type'])) {
|
||||
$type = $layoutConfig['type'];
|
||||
$name = isset($layoutConfig['name']) ? $layoutConfig['name'] : 'root';
|
||||
|
||||
$this->_view = $this->_createBlock($type, $name, $layoutConfig);
|
||||
$this->_view = $this->_createBlock($type, $name, $layoutConfig);
|
||||
} else if (!isset($this->_view)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
foreach ($layoutUpdates as $block => $updates) {
|
||||
if (!isset($this->_blocks[$block])) {
|
||||
|
|
@ -110,11 +144,11 @@ class Legacies_Core_Layout
|
|||
}
|
||||
}
|
||||
|
||||
public function _save()
|
||||
protected function _save()
|
||||
{
|
||||
}
|
||||
|
||||
public function _delete()
|
||||
protected function _delete()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -128,12 +162,58 @@ class Legacies_Core_Layout
|
|||
$module = substr($type, 0, $offset);
|
||||
$block = substr($type, $offset + 1);
|
||||
|
||||
/*
|
||||
$module = str_replace(' ', '', ucwords(str_replace('-', ' ', $module)));
|
||||
$module = str_replace(' ', '_', ucwords(str_replace('.', ' ', $module)));
|
||||
*/
|
||||
$block = str_replace(' ', '', ucwords(str_replace('-', ' ', $block)));
|
||||
$block = str_replace(' ', '_', ucwords(str_replace('.', ' ', $block)));
|
||||
|
||||
return 'Legacies_' . $module . '_Block_' . $block;
|
||||
if (isset($this->_namespaces[$module])) {
|
||||
foreach ($this->_namespaces[$module] as $namespace => $path) {
|
||||
$className = $namespace . $block;
|
||||
$fileName = $path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $block) . '.php';
|
||||
|
||||
Wootook_Core_ErrorProfiler::sleep();
|
||||
if (!($fp = @fopen($fileName, 'r', true))) {
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
continue;
|
||||
}
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
fclose($fp);
|
||||
|
||||
if (!class_exists($className, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return $className;
|
||||
}
|
||||
}
|
||||
|
||||
trigger_error(Wootook::__('Class type "%s" could not be resolved.', $type), E_USER_INFO);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function registerBlockNamespace($module, $namespace, $path = null)
|
||||
{
|
||||
if ($path === null) {
|
||||
$path = str_replace('_', DIRECTORY_SEPARATOR, $namespace);
|
||||
}
|
||||
if (!isset($this->_namespaces[$module])) {
|
||||
$this->_namespaces[$module] = array();
|
||||
}
|
||||
$this->_namespaces[$module][$namespace] = $path;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function unregisterBlockNamespace($module, $namespace)
|
||||
{
|
||||
if (isset($this->_namespaces[$module]) && isset($this->_namespaces[$module][$namespace])) {
|
||||
unset($this->_namespaces[$module][$namespace]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function createBlock($type, $name, $config = array())
|
||||
|
|
@ -149,6 +229,10 @@ class Legacies_Core_Layout
|
|||
{
|
||||
$className = $this->_resolveBlockClassType($type);
|
||||
|
||||
if ($className === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$children = array();
|
||||
if (isset($config['children'])) {
|
||||
$children = $config['children'];
|
||||
|
|
@ -177,13 +261,13 @@ class Legacies_Core_Layout
|
|||
}
|
||||
|
||||
if (!isset($config['type'])) {
|
||||
$instance->$alias = new Legacies_Core_View($config);
|
||||
$instance->$alias = new Wootook_Core_View($config);
|
||||
} else {
|
||||
$instance->$alias = $this->_createBlock($config['type'], $name, $config);
|
||||
}
|
||||
}
|
||||
} catch (ReflectionException $e) {
|
||||
var_dump($e);
|
||||
trigger_error($e->getMessage(), E_USER_INFO);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -221,19 +305,50 @@ class Legacies_Core_Layout
|
|||
$callParamaters[$paramterPosition] = $parameter->getDefaultValue();
|
||||
//} else if (!$parameter->isOptionnal()) {
|
||||
} else if ($paramterPosition <= $requiredParameterCount) {
|
||||
throw new RuntimeException();
|
||||
throw new Wootook_Core_Exception_RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
$reflectionMethod->invokeArgs($block, $callParamaters);
|
||||
} catch (ReflectionException $e) {
|
||||
trigger_error($e->getMessage(), E_USER_INFO);
|
||||
continue;
|
||||
} catch (RuntimeException $e) {
|
||||
trigger_error($e->getMessage(), E_USER_WARNING);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getPackage()
|
||||
{
|
||||
return $this->_package;
|
||||
}
|
||||
|
||||
public function setPackage($package)
|
||||
{
|
||||
$this->_package = $package;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTheme()
|
||||
{
|
||||
return $this->_theme;
|
||||
}
|
||||
|
||||
public function setTheme($theme)
|
||||
{
|
||||
$this->_theme = $theme;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScriptPath()
|
||||
{
|
||||
return APPLICATION_PATH . DIRECTORY_SEPARATOR . 'design';
|
||||
}
|
||||
|
||||
public function getBlock($code)
|
||||
{
|
||||
if (isset($this->_blocks[$code])) {
|
||||
|
|
@ -244,11 +359,41 @@ class Legacies_Core_Layout
|
|||
|
||||
public function render()
|
||||
{
|
||||
$scriptPath = $this->getScriptPath();
|
||||
foreach ($this->_blocks as $block) {
|
||||
if ($block instanceof Wootook_Core_Block_Template) {
|
||||
$block->setScriptPath($scriptPath);
|
||||
}
|
||||
$block->beforeToHtml();
|
||||
}
|
||||
unset($block);
|
||||
|
||||
return $this->_view->render();
|
||||
}
|
||||
|
||||
protected function _getLayoutPath($file)
|
||||
{
|
||||
$package = $this->getPackage();
|
||||
$theme = $this->getTheme();
|
||||
$pattern = "{$this->getScriptPath()}/%s/%s/layouts/{$file}";
|
||||
|
||||
$path = sprintf($pattern, $package, $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);
|
||||
if (Wootook::fileExists($path)) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
trigger_error(Legacies::__("Layout file '%s' does not exist.", $file), E_USER_INFO);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
abstract class Legacies_Core_Model
|
||||
extends Legacies_Object
|
||||
abstract class Wootook_Core_Model
|
||||
extends Wootook_Object
|
||||
{
|
||||
protected $_originalData = array();
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ abstract class Legacies_Core_Model
|
|||
call_user_func_array(array($this, '_afterSave'), $params);
|
||||
$this->_setOriginalData($this->_data);
|
||||
} catch (PDOException $e) {
|
||||
throw new Legacies_Core_Model_Exception('Could not save data: ' . $e->getMessage(), 0);
|
||||
throw new Wootook_Core_Exception_DataAccessException('Could not save data: ' . $e->getMessage(), 0);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -41,10 +41,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _beforeSave()
|
||||
{
|
||||
Legacies::dispatchEvent('model.before-save', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.before-save', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.before-save', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.before-save', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -52,10 +52,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _afterSave()
|
||||
{
|
||||
Legacies::dispatchEvent('model.after-save', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.after-save', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.after-save', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.after-save', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -70,7 +70,7 @@ abstract class Legacies_Core_Model
|
|||
call_user_func_array(array($this, '_afterLoad'), $params);
|
||||
$this->_setOriginalData($this->_data);
|
||||
} catch (PDOException $e) {
|
||||
throw new Legacies_Core_Model_Exception('Could not load data: ' . $e->getMessage(), 0);
|
||||
throw new Wootook_Core_Exception_DataAccessException('Could not load data: ' . $e->getMessage(), 0);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -79,10 +79,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _beforeLoad()
|
||||
{
|
||||
Legacies::dispatchEvent('model.before-load', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.before-load', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.before-load', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.before-load', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -90,10 +90,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _afterLoad()
|
||||
{
|
||||
Legacies::dispatchEvent('model.after-load', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.after-load', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.after-load', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.after-load', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -107,7 +107,7 @@ abstract class Legacies_Core_Model
|
|||
call_user_func_array(array($this, '_delete'), $params);
|
||||
call_user_func_array(array($this, '_afterDelete'), $params);
|
||||
} catch (PDOException $e) {
|
||||
throw new Legacies_Core_Model_Exception('Could not delete entity: ' . $e->getMessage(), 0);
|
||||
throw new Wootook_Core_Exception_DataAccessException('Could not delete entity: ' . $e->getMessage(), 0);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -116,10 +116,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _beforeDelete()
|
||||
{
|
||||
Legacies::dispatchEvent('model.before-delete', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.before-delete', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.before-delete', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.before-delete', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -127,10 +127,10 @@ abstract class Legacies_Core_Model
|
|||
|
||||
protected function _afterDelete()
|
||||
{
|
||||
Legacies::dispatchEvent('model.after-delete', array('model' => $this));
|
||||
Wootook::dispatchEvent('model.after-delete', array('model' => $this));
|
||||
|
||||
if ($this->_eventPrefix !== null && $this->_eventObject !== null) {
|
||||
Legacies::dispatchEvent($this->_eventPrefix . '.after-delete', array($this->_eventObject => $this));
|
||||
Wootook::dispatchEvent($this->_eventPrefix . '.after-delete', array($this->_eventObject => $this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -4,12 +4,12 @@
|
|||
*
|
||||
* Enter description here ...
|
||||
*
|
||||
* @uses Legacies_Object
|
||||
* @uses Wootook_Object
|
||||
* @uses Legacies_Empire
|
||||
*/
|
||||
class Legacies_Core_Model_Config
|
||||
extends Legacies_Core_Model
|
||||
implements Legacies_Core_Singleton
|
||||
class Wootook_Core_Model_Config
|
||||
extends Wootook_Core_Model
|
||||
implements Wootook_Core_Singleton
|
||||
{
|
||||
private static $_singleton = null;
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class Legacies_Core_Model_Config
|
|||
|
||||
protected function _load()
|
||||
{
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
|
||||
$sql =<<<SQL_EOF
|
||||
SELECT config_name AS attribute, config_value AS value
|
||||
|
|
@ -55,7 +55,7 @@ SQL_EOF;
|
|||
|
||||
protected function _save()
|
||||
{
|
||||
$database = Legacies_Database::getSingleton();
|
||||
$database = Wootook_Database::getSingleton();
|
||||
$fields = array();
|
||||
|
||||
$sql =<<<SQL_EOF
|
||||
52
application/code/core/Wootook/Core/Model/Config/Abstract.php
Normal file
52
application/code/core/Wootook/Core/Model/Config/Abstract.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
abstract class Wootook_Core_Model_Config_Abstract
|
||||
extends Wootook_Core_Model
|
||||
implements Iterator, Countable
|
||||
{
|
||||
protected function _initData($filename)
|
||||
{
|
||||
$config = include ROOT_PATH . 'config.php';
|
||||
$universe = $config['global']['storyline']['universe'];
|
||||
$episode = $config['global']['storyline']['episode'];
|
||||
|
||||
$path = 'gamedata' . DIRECTORY_SEPARATOR . $universe . DIRECTORY_SEPARATOR
|
||||
. $episode . DIRECTORY_SEPARATOR . $filename . '.php';
|
||||
|
||||
foreach (include APPLICATION_PATH . $path as $elementId => $fieldName) {
|
||||
$this->setData($elementId, $fieldName);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->_data);
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
return current($this->_data);
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
return next($this->_data);
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
return key($this->_data);
|
||||
}
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return $this->current() !== false;
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
reset($this->_data);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue