Updated install and fixed bugs
Added session messages display Fixed field and validator loading. Updated form validation Updated root config management Muted error reporting in file evaluation Added menu updates Fixed galaxy data access error Fixed config bug Added HTTP request method checks Added Form manager Fixed core bugs Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
c38e53706e
commit
9636b4bb00
69 changed files with 2434 additions and 789 deletions
|
|
@ -33,6 +33,8 @@ define('INSTALL' , false);
|
|||
define('IN_ADMIN', true);
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT);
|
||||
|
||||
if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) {
|
||||
includeLang('admin/fleets');
|
||||
$PageTPL = gettemplate('admin/fleet_body');
|
||||
|
|
@ -46,5 +48,3 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
|||
} else {
|
||||
AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -40,7 +40,7 @@ includeLang('leftmenu');
|
|||
$parse['mf'] = "Hauptframe";
|
||||
$parse['dpath'] = $dpath;
|
||||
$parse['WootookRelease'] = VERSION;
|
||||
$parse['servername'] = Wootook;
|
||||
$parse['servername'] = 'Wootook';
|
||||
$Page = parsetemplate(gettemplate('admin/left_menu'), $parse);
|
||||
display($Page, "", false, '', true);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -28,10 +28,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
defined('BCNUMBERS') || define('BCNUMBERS', true);
|
||||
defined('DEPRECATION') || define('DEPRECATION', true);
|
||||
defined('DEBUG') || define('DEBUG', true);
|
||||
|
||||
if (!defined('DEBUG') && ($env = getenv('DEBUG')) !== false && in_array(strtolower($env), array('1', 'on', 'true'))) {
|
||||
define('DEBUG', true);
|
||||
} else if (!defined('DEBUG') && isset($_SERVER['DEBUG']) && in_array(strtolower($_SERVER['DEBUG']), array('1', 'on', 'true'))) {
|
||||
|
|
@ -62,7 +58,7 @@ defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__) . DI
|
|||
|
||||
defined('PHPEXT') || define('PHPEXT', 'php');
|
||||
|
||||
defined('VERSION') || define('VERSION', '2011.1');
|
||||
defined('VERSION') || define('VERSION', '1.5.0-beta2');
|
||||
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR . 'libraries',
|
||||
|
|
@ -80,7 +76,8 @@ Wootook_Core_Time::init();
|
|||
Wootook_Core_ErrorProfiler::register();
|
||||
Wootook_Core_Model_Config_Events::registerEvents();
|
||||
|
||||
if (0 === filesize(ROOT_PATH . 'config.php')) {
|
||||
if (!defined('IN_INSTALL') && 0 === filesize(ROOT_PATH . 'config.php')) {
|
||||
header('HTTP/1.1 307 Temporary Redirect');
|
||||
header('Location: install/');
|
||||
die();
|
||||
}
|
||||
|
|
@ -100,6 +97,8 @@ include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
|
|||
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
|
||||
|
||||
if (!defined('IN_INSTALL')) {
|
||||
|
||||
$gameConfig = Wootook_Core_Model_Config::getSingleton();
|
||||
if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) {
|
||||
Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']);
|
||||
|
|
@ -140,3 +139,4 @@ if (($user !== null && $user->getId())) {
|
|||
));
|
||||
$planet->save();
|
||||
}
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ class Wootook
|
|||
return self::$_defaultLocale;
|
||||
}
|
||||
|
||||
public function getPreferredLocale($availableLocales = array())
|
||||
public static function getPreferredLocale($availableLocales = array())
|
||||
{
|
||||
if (empty($availableLocales)) {
|
||||
return self::getDefaultLocale();
|
||||
|
|
@ -255,6 +255,9 @@ class Wootook
|
|||
return self::$_now;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Wootook_Core_Controller_Request_Http
|
||||
*/
|
||||
public static function getRequest()
|
||||
{
|
||||
if (self::$_request === null) {
|
||||
|
|
@ -268,6 +271,9 @@ class Wootook
|
|||
self::$_request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Wootook_Core_Controller_Response_Http
|
||||
*/
|
||||
public static function getResponse()
|
||||
{
|
||||
if (self::$_response === null) {
|
||||
|
|
@ -281,11 +287,20 @@ class Wootook
|
|||
self::$_response = $response;
|
||||
}
|
||||
|
||||
public static function getConfig($path = null)
|
||||
private static function _loadConfig()
|
||||
{
|
||||
if (self::$_config === null) {
|
||||
self::$_config = include ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
|
||||
|
||||
if (!is_array(self::$_config)) {
|
||||
self::$_config = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getConfig($path = null)
|
||||
{
|
||||
self::_loadConfig();
|
||||
|
||||
if ($path === null || !is_string($path)) {
|
||||
return self::$_config;
|
||||
|
|
@ -300,6 +315,25 @@ class Wootook
|
|||
return $config;
|
||||
}
|
||||
|
||||
public static function setConfig($path = null, $value)
|
||||
{
|
||||
self::_loadConfig();
|
||||
|
||||
if ($path === null || !is_string($path)) {
|
||||
return self::$_config;
|
||||
}
|
||||
$config = &self::$_config;
|
||||
foreach (explode('/', $path) as $chunk) {
|
||||
if (!isset($config[$chunk])) {
|
||||
$config[$chunk] = array();
|
||||
}
|
||||
$config = &$config[$chunk];
|
||||
}
|
||||
$config = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getBaseUrl()
|
||||
{
|
||||
return self::getConfig('global/web/base_url');
|
||||
|
|
@ -333,10 +367,13 @@ class Wootook
|
|||
return false;
|
||||
}
|
||||
|
||||
Wootook_Core_ErrorProfiler::sleep();
|
||||
if (($fp = @fopen($path, 'r', true)) === false) {
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
return false;
|
||||
}
|
||||
fclose($fp);
|
||||
Wootook_Core_ErrorProfiler::wakeup();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
43
application/code/core/Wootook/Core/Block/Messages.php
Normal file
43
application/code/core/Wootook/Core/Block/Messages.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Block_Messages
|
||||
extends Wootook_Core_Block_Template
|
||||
{
|
||||
protected $_storages = array();
|
||||
|
||||
public function prepareMessages($namespace)
|
||||
{
|
||||
$this->_storages[] = $namespace;
|
||||
}
|
||||
|
||||
public function renderGroupedHtml()
|
||||
{
|
||||
$messages = array();
|
||||
|
||||
foreach ($this->_storages as $namespace) {
|
||||
$session = Wootook::getSession($namespace);
|
||||
|
||||
foreach ($session->getData('messages') as $messageLevel => $messageList) {
|
||||
if (!isset($messages[$messageLevel])) {
|
||||
$messages[$messageLevel] = $messageList;
|
||||
} else {
|
||||
$messages[$messageLevel] += $messageList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rsort($messages, SORT_NUMERIC);
|
||||
|
||||
$output = '<div class="messages">';
|
||||
foreach ($messages as $messageLevel => $messageList) {
|
||||
$output .= "<ul class=\"{$messageLevel}\">";
|
||||
foreach ($messageList as $message) {
|
||||
$output .= "<li>{$message}</li>";
|
||||
}
|
||||
$output .= '</ul>';
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +84,40 @@ class Wootook_Core_Controller_Request_Http
|
|||
return $_SERVER[$key];
|
||||
}
|
||||
|
||||
public function getAllQueryData()
|
||||
{
|
||||
return $_GET;
|
||||
}
|
||||
|
||||
public function getAllFilesData()
|
||||
{
|
||||
return $_FILES;
|
||||
}
|
||||
|
||||
public function getAllCookieData()
|
||||
{
|
||||
$data = array();
|
||||
foreach ($_COOKIE as $key => $value) {
|
||||
$data[$key] = unserialize(stripslashes($value));
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getAllRawCookieData()
|
||||
{
|
||||
return $_COOKIE;
|
||||
}
|
||||
|
||||
public function getAllPostData()
|
||||
{
|
||||
return $_POST;
|
||||
}
|
||||
|
||||
public function getAllServerData()
|
||||
{
|
||||
return $_SERVER;
|
||||
}
|
||||
|
||||
public function isPost()
|
||||
{
|
||||
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'POST') {
|
||||
|
|
@ -92,6 +126,22 @@ class Wootook_Core_Controller_Request_Http
|
|||
return false;
|
||||
}
|
||||
|
||||
public function isPut()
|
||||
{
|
||||
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'PUT') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isHead()
|
||||
{
|
||||
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'HEAD') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isGet()
|
||||
{
|
||||
if (strtoupper($this->getServer('REQUEST_METHOD')) == 'GET') {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class Wootook_Core_Controller_Response_Http
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setRawHeader($name, $value)
|
||||
public function setRawHeader($value)
|
||||
{
|
||||
if (!isset($this->_data['raw_headers']) || !is_array($this->_data['raw_headers'])) {
|
||||
$this->clearRawHeaders();
|
||||
|
|
|
|||
175
application/code/core/Wootook/Core/Form.php
Normal file
175
application/code/core/Wootook/Core/Form.php
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form
|
||||
{
|
||||
protected $_fields = array();
|
||||
|
||||
protected $_request = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* Field class loader
|
||||
* @var Wootook_Core_Form_FieldLoader
|
||||
*/
|
||||
protected $_fieldLoader = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* Validator class loader
|
||||
* @var Wootook_Core_Form_ValidatorLoader
|
||||
*/
|
||||
protected $_validatorLoader = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @var Wootook_Core_Model_Session
|
||||
*/
|
||||
protected $_session = null;
|
||||
|
||||
public function __construct(Wootook_Core_Model_Session $session, Array $fields = array())
|
||||
{
|
||||
$this->_session = $session;
|
||||
|
||||
$this->_fieldLoader = new Wootook_Core_Form_FieldLoader($this, array(
|
||||
'Wootook_Core_Form_Field_' => 'Wootook/Core/Form/Field'
|
||||
));
|
||||
|
||||
$this->_validatorLoader = new Wootook_Core_Form_ValidatorLoader($this, array(
|
||||
'Wootook_Core_Form_Validator_' => 'Wootook/Core/Form/Validator'
|
||||
));
|
||||
|
||||
$this->addField('__formkey', 'text', array('form_key' => 'formKey'));
|
||||
|
||||
foreach ($fields as $fieldName => $fieldConfig) {
|
||||
if (is_string($fieldConfig)) {
|
||||
$this->addField($fieldName, $fieldConfig);
|
||||
} else if ($fieldConfig instanceof Wootook_Core_Form_FieldAbstract) {
|
||||
$this->addField($fieldName, $fieldConfig);
|
||||
} else {
|
||||
if (isset($fieldConfig['validators'])) {
|
||||
$this->addField($fieldName, $fieldConfig['type'], $fieldConfig['validators']);
|
||||
} else {
|
||||
$this->addField($fieldName, $fieldConfig['type']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function validate()
|
||||
{
|
||||
foreach ($this->_fields as $field) {
|
||||
$field->validate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @param string $name
|
||||
* @param string|Wootook_Core_Form_FieldAbstract $type
|
||||
* @return Wootook_Core_Form
|
||||
*/
|
||||
public function addField($name, $type = 'text', Array $validators = array())
|
||||
{
|
||||
if ($type instanceof Wootook_Core_Form_FieldAbstract) {
|
||||
$this->_fields[$name] = $name;
|
||||
$this->_fields[$name]->setForm($this);
|
||||
} else {
|
||||
$field = $this->_fieldLoader->load($type);
|
||||
|
||||
if ($field === null) {
|
||||
trigger_error(sprintf('Field %1$s (type: %2$s) could not be created.', $name, $type), E_USER_WARNING);
|
||||
return $this;
|
||||
}
|
||||
$this->_fields[$name] = $field;
|
||||
}
|
||||
$this->_fields[$name]->setName($name);
|
||||
|
||||
foreach ($validators as $validatorName => $validatorType) {
|
||||
if ($validatorType instanceof Wootook_Core_Form_FieldAbstract) {
|
||||
$this->_fields[$name]->addValidator($validatorType, $validatorName);
|
||||
} else {
|
||||
$validator = $this->_validatorLoader->load($validatorType);
|
||||
|
||||
if ($validator === null) {
|
||||
trigger_error(sprintf('Validator %1$s (type: %2$s) could not be created.', $validatorName, $validatorType), E_USER_WARNING);
|
||||
return $this;
|
||||
}
|
||||
$this->_fields[$name]->addValidator($validator, $validatorName);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @param string $name
|
||||
* @return Wootook_Core_Form_FieldAbstract
|
||||
*/
|
||||
public function getField($name)
|
||||
{
|
||||
if (!isset($this->_fields[$name])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->_fields[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @param string $name
|
||||
* @return Wootook_Core_Model_Session
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
return $this->_session;
|
||||
}
|
||||
|
||||
public function setRequest(Wootook_Core_Controller_Request_Http $request)
|
||||
{
|
||||
$this->_request = $request;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
* @return Wootook_Core_Controller_Request_Http
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->_request;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
if ($request === null) {
|
||||
return array();
|
||||
}
|
||||
if ($request->isPost()) {
|
||||
return $request->getAllPostData();
|
||||
}
|
||||
return $request->getAllQueryData();
|
||||
}
|
||||
|
||||
public function populate(Array $datas = array())
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
foreach ($this->_fields as $fieldName => $field) {
|
||||
if (isset($datas[$fieldName])) {
|
||||
$field->populate($datas[$fieldName]);
|
||||
} else if ($request->isPost()) {
|
||||
$field->populate($request->getPost($fieldName));
|
||||
} else {
|
||||
$field->populate($request->getQuery($fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
application/code/core/Wootook/Core/Form/Field/Text.php
Normal file
11
application/code/core/Wootook/Core/Form/Field/Text.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
|
||||
class Wootook_Core_Form_Field_Text
|
||||
extends Wootook_Core_Form_FieldAbstract
|
||||
{
|
||||
public function getType()
|
||||
{
|
||||
return 'text';
|
||||
}
|
||||
}
|
||||
104
application/code/core/Wootook/Core/Form/FieldAbstract.php
Normal file
104
application/code/core/Wootook/Core/Form/FieldAbstract.php
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
|
||||
abstract class Wootook_Core_Form_FieldAbstract
|
||||
{
|
||||
protected $_name = null;
|
||||
protected $_form = null;
|
||||
protected $_value = null;
|
||||
|
||||
protected $_validators = array();
|
||||
|
||||
public function __construct(Wootook_Core_Form $form = null)
|
||||
{
|
||||
if ($form !== null) {
|
||||
$this->setForm($form);
|
||||
}
|
||||
}
|
||||
|
||||
abstract public function getType();
|
||||
|
||||
public function validate()
|
||||
{
|
||||
$data = $this->getData();
|
||||
|
||||
foreach ($this->_validators as $validator) {
|
||||
if (!$validator->validate($this, $data)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->_name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
public function setForm(Wootook_Core_Form $form)
|
||||
{
|
||||
$this->_form = $form;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->_form;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return $this->_value;
|
||||
}
|
||||
|
||||
public function populate($value)
|
||||
{
|
||||
$this->_value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addValidator(Wootook_Core_Form_ValidatorAbstract $validator, $name = null)
|
||||
{
|
||||
if ($name === null) {
|
||||
$this->_validators = array();
|
||||
$name = 'default';
|
||||
}
|
||||
|
||||
$this->_validators[$name] = $validator;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getValidator($name)
|
||||
{
|
||||
if (!isset($this->_validators[$name])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->_validators[$name];
|
||||
}
|
||||
|
||||
public function clearValidator($name)
|
||||
{
|
||||
if (isset($this->_validators[$name])) {
|
||||
unset($this->_validators[$name]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function clearAllValidators()
|
||||
{
|
||||
$this->_validators = array();
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
36
application/code/core/Wootook/Core/Form/FieldLoader.php
Normal file
36
application/code/core/Wootook/Core/Form/FieldLoader.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_FieldLoader
|
||||
extends Wootook_Core_Plugin_LoaderAbstract
|
||||
{
|
||||
protected $_form = null;
|
||||
|
||||
public function __construct(Wootook_Core_Form $form, Array $namespaces = array())
|
||||
{
|
||||
$this->_form = $form;
|
||||
|
||||
foreach ($namespaces as $namespace => $path) {
|
||||
if (is_int($namespace)) {
|
||||
$this->registerNamespace($path);
|
||||
} else {
|
||||
$this->registerNamespace($namespace, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function _load($className, $useSingleton)
|
||||
{
|
||||
$reflection = new ReflectionClass($className);
|
||||
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
|
||||
$method = $reflection->getMethod('getSingleton');
|
||||
return $method->invoke(null);
|
||||
}
|
||||
|
||||
try {
|
||||
return $reflection->newInstance($this->_form);
|
||||
} catch (ReflectionException $e) {
|
||||
trigger_error($e->getMessage(), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
application/code/core/Wootook/Core/Form/Validator/Alnum.php
Normal file
22
application/code/core/Wootook/Core/Form/Validator/Alnum.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Alnum
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#[^[:alnum:]]#');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if ($this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should only contain alphanumeric characters.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
22
application/code/core/Wootook/Core/Form/Validator/Alpha.php
Normal file
22
application/code/core/Wootook/Core/Form/Validator/Alpha.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Alnum
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#[^[:alpha:]]#');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if ($this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should only contain alphabetic characters.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
21
application/code/core/Wootook/Core/Form/Validator/Email.php
Normal file
21
application/code/core/Wootook/Core/Form/Validator/Email.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Email
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#^[[:alnum:]\._\-]@[[:alnum:]\._\-]\.[a-z]{2,}$#');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if (!$this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should contain an email.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_FormKey
|
||||
extends Wootook_Core_Form_ValidatorAbstract
|
||||
{
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
$form = $field->getForm();
|
||||
$session = $form->getSession();
|
||||
|
||||
if ($session->getFormKey(false) == $data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->_getSession($field)
|
||||
->addError('CSRF token failure.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
22
application/code/core/Wootook/Core/Form/Validator/Hex.php
Normal file
22
application/code/core/Wootook/Core/Form/Validator/Hex.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Hex
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#(?:0x)?[^0-9a-f]#i');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if ($this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should only contain numeric characters.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
21
application/code/core/Wootook/Core/Form/Validator/Host.php
Normal file
21
application/code/core/Wootook/Core/Form/Validator/Host.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Email
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#^[[:alnum:]\._\-]\.[a-z]{2,}$#');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if (!$this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should contain a host name.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Numeric
|
||||
extends Wootook_Core_Form_Validator_Regex
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('#[^[:digit:]]#');
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if ($this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" should only contain numeric characters.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
28
application/code/core/Wootook/Core/Form/Validator/Regex.php
Normal file
28
application/code/core/Wootook/Core/Form/Validator/Regex.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_Validator_Regex
|
||||
extends Wootook_Core_Form_ValidatorAbstract
|
||||
{
|
||||
protected $_expression = null;
|
||||
|
||||
public function __construct($expression)
|
||||
{
|
||||
$this->_expression = $expression;
|
||||
}
|
||||
|
||||
public function validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
if (!$this->_validate($field, $data)) {
|
||||
$this->_getSession($field)
|
||||
->addError('Field "%s" does not match the validation pattern.', $field->getName());
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function _validate(Wootook_Core_Form_FieldAbstract $field, $data)
|
||||
{
|
||||
return preg_match($this->_expression, $data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
abstract class Wootook_Core_Form_ValidatorAbstract
|
||||
{
|
||||
abstract public function validate(Wootook_Core_Form_FieldAbstract $field, $data);
|
||||
|
||||
protected function _getSession(Wootook_Core_Form_FieldAbstract $field)
|
||||
{
|
||||
$form = $field->getForm();
|
||||
if (!$form instanceof Wootook_Core_Form) {
|
||||
return null;
|
||||
}
|
||||
return $form->getSession();
|
||||
}
|
||||
}
|
||||
36
application/code/core/Wootook/Core/Form/ValidatorLoader.php
Normal file
36
application/code/core/Wootook/Core/Form/ValidatorLoader.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class Wootook_Core_Form_ValidatorLoader
|
||||
extends Wootook_Core_Plugin_LoaderAbstract
|
||||
{
|
||||
protected $_form = null;
|
||||
|
||||
public function __construct(Wootook_Core_Form $form, Array $namespaces = array())
|
||||
{
|
||||
$this->_form = $form;
|
||||
|
||||
foreach ($namespaces as $namespace => $path) {
|
||||
if (is_int($namespace)) {
|
||||
$this->registerNamespace($path);
|
||||
} else {
|
||||
$this->registerNamespace($namespace, $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function _load($className, $useSingleton)
|
||||
{
|
||||
$reflection = new ReflectionClass($className);
|
||||
if ($useSingleton && $reflection->implementsInterface('Wootook_Core_Singleton')) {
|
||||
$method = $reflection->getMethod('getSingleton');
|
||||
return $method->invoke(null);
|
||||
}
|
||||
|
||||
try {
|
||||
return $reflection->newInstance();
|
||||
} catch (ReflectionException $e) {
|
||||
trigger_error($e->getMessage(), E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,8 @@ class Wootook_Core_Layout
|
|||
|
||||
protected $_blocks = array();
|
||||
|
||||
protected $_messageBlock = null;
|
||||
|
||||
protected $_view = null;
|
||||
protected $_eventPrefix = 'layout';
|
||||
protected $_eventObject = 'layout';
|
||||
|
|
@ -31,19 +33,16 @@ class Wootook_Core_Layout
|
|||
}
|
||||
}
|
||||
|
||||
$config = include ROOT_PATH . 'config.php';
|
||||
$fileList = array();
|
||||
if (isset($config['global'])) {
|
||||
if (isset($config['global']['layout'])) {
|
||||
$fileList = $config['global']['layout'];
|
||||
}
|
||||
if (isset($config['global']['package'])) {
|
||||
$this->setPackage($config['global']['package']);
|
||||
}
|
||||
if (isset($config['global']['theme'])) {
|
||||
$this->setTheme($config['global']['theme']);
|
||||
}
|
||||
$fileList = Wootook::getConfig('global/layout');
|
||||
if (!is_array($fileList) || empty($fileList)) {
|
||||
$fileList = $this->getAllDatas();
|
||||
} else {
|
||||
$fileList = array_merge($fileList, $this->getAllDatas());
|
||||
}
|
||||
$this->_data = array();
|
||||
|
||||
$this->setPackage(Wootook::getConfig('global/package'));
|
||||
$this->setTheme(Wootook::getConfig('global/theme'));
|
||||
|
||||
foreach ($fileList as $layoutFile) {
|
||||
foreach (include $this->_getLayoutPath($layoutFile) as $layoutId => $layoutConfig) {
|
||||
|
|
@ -57,6 +56,8 @@ class Wootook_Core_Layout
|
|||
}
|
||||
}
|
||||
|
||||
$this->_messageBlock = $this->createBlock('core/messages', 'messages');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
@ -86,6 +87,9 @@ class Wootook_Core_Layout
|
|||
$layoutUpdates = array();
|
||||
$layoutConfig = array();
|
||||
foreach (array_reverse($layoutConfigs) as $config) {
|
||||
if (!is_array($config)) {
|
||||
continue;
|
||||
}
|
||||
$layoutConfig = array_merge($layoutConfig, $config);
|
||||
|
||||
if (isset($layoutConfig['reference'])) {
|
||||
|
|
@ -374,6 +378,10 @@ class Wootook_Core_Layout
|
|||
|
||||
public function render()
|
||||
{
|
||||
if (!$this->_view instanceof Wootook_Core_View) {
|
||||
throw new Wootook_Core_Exception_RuntimeException(Wootook::__('No root view declared.'));
|
||||
}
|
||||
|
||||
$scriptPath = $this->getScriptPath();
|
||||
foreach ($this->_blocks as $block) {
|
||||
if ($block instanceof Wootook_Core_Block_Template) {
|
||||
|
|
@ -407,8 +415,17 @@ class Wootook_Core_Layout
|
|||
return $path;
|
||||
}
|
||||
|
||||
trigger_error(Legacies::__("Layout file '%s' does not exist.", $file), E_USER_NOTICE);
|
||||
trigger_error(Wootook::__("Layout file '%s' does not exist.", $file), E_USER_NOTICE);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Wootook_Core_Block_Messages
|
||||
*/
|
||||
public function getMessagesblock()
|
||||
{
|
||||
return $this->_messageBlock;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,13 @@ abstract class Wootook_Core_Model_Config_Abstract
|
|||
{
|
||||
$config = Wootook::getConfig('global/storyline');
|
||||
|
||||
if ($config === null || empty($config)) {
|
||||
$config = array(
|
||||
'universe' => 'default',
|
||||
'episode' => 'default'
|
||||
);
|
||||
}
|
||||
|
||||
$path = 'gamedata' . DIRECTORY_SEPARATOR . $config['universe'] . DIRECTORY_SEPARATOR
|
||||
. $config['episode'] . DIRECTORY_SEPARATOR . $filename . '.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Wootook_Core_Model_Session
|
|||
return $this->addMessage(vsprintf($message, $args), self::DEBUG);
|
||||
}
|
||||
|
||||
public function getFormKey($reset = false)
|
||||
public function getFormKey($reset = true)
|
||||
{
|
||||
if (!$this->getData('form_key')) {
|
||||
$this->setData('form_key', uniqid());
|
||||
|
|
@ -136,10 +136,32 @@ class Wootook_Core_Model_Session
|
|||
}
|
||||
|
||||
$key = $this->getData('form_key');
|
||||
if ($reset == true) {
|
||||
if ($reset !== true) {
|
||||
$this->setData('form_key', uniqid());
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
public function setFormData(Array $data = array())
|
||||
{
|
||||
if (isset($data['__formkey'])) {
|
||||
unset($data['__formkey']);
|
||||
}
|
||||
|
||||
$this->setData('form_data', $data);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFormData($key = null, $default = null)
|
||||
{
|
||||
$data = $this->getData('form_data');
|
||||
if ($key === null) {
|
||||
return $data;
|
||||
} else if (isset($data[$key])) {
|
||||
return $data[$key];
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
|
|||
$className = $namespace . ucfirst($pluginName);
|
||||
$fileName = $path . DIRECTORY_SEPARATOR . ucfirst($pluginName) . '.php';
|
||||
|
||||
if (!file_exists($fileName)) {
|
||||
if (!Wootook::fileExists($fileName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
|
|||
return $this->_load($className, $useSingleton);
|
||||
}
|
||||
|
||||
return $this;
|
||||
return null;
|
||||
}
|
||||
|
||||
public function registerNamespace($namespace, $path = null)
|
||||
|
|
@ -48,7 +48,7 @@ abstract class Wootook_Core_Plugin_LoaderAbstract
|
|||
return $this;
|
||||
}
|
||||
|
||||
abstract protected function _load($className);
|
||||
abstract protected function _load($className, $useSingleton);
|
||||
|
||||
public function getPlugin($pluginName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,10 +3,14 @@
|
|||
|
||||
class Wootook_Core_Time
|
||||
{
|
||||
public static function init()
|
||||
public static function init($timezone = null)
|
||||
{
|
||||
$config = include ROOT_PATH . 'config.php';
|
||||
$timezone = $config['global']['date']['timezone'];
|
||||
if ($timezone === null) {
|
||||
$timezone = Wootook::getConfig('global/date/timezone');
|
||||
}
|
||||
if ($timezone === null) {
|
||||
$timezone = 'GMT';
|
||||
}
|
||||
|
||||
date_default_timezone_set($timezone);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,8 +142,17 @@ class Wootook_Core_View
|
|||
$theme = Wootook_Core_Layout::DEFAULT_THEME;
|
||||
}
|
||||
|
||||
$pattern = ROOT_PATH . DIRECTORY_SEPARATOR . 'skin/%s/%s/{$uri}';
|
||||
|
||||
if (Wootook::fileExists(sprintf($pattern, $package, $theme))) {
|
||||
return Wootook::getSkinUrl($package, $theme, $uri, $params);
|
||||
}
|
||||
if (Wootook::fileExists(sprintf($pattern, $package, Wootook_Core_Layout::DEFAULT_THEME))) {
|
||||
return Wootook::getSkinUrl($package, Wootook_Core_Layout::DEFAULT_THEME, $uri, $params);
|
||||
}
|
||||
|
||||
return Wootook::getSkinUrl(Wootook_Core_Layout::DEFAULT_PACKAGE, Wootook_Core_Layout::DEFAULT_THEME, $uri, $params);
|
||||
}
|
||||
|
||||
public function setPartial($name, $content)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ class Wootook_Empire_Model_Planet
|
|||
*/
|
||||
protected $_moon = null;
|
||||
|
||||
/**
|
||||
* @var Wootook_Empire_Model_Planet
|
||||
*/
|
||||
protected $_planet = null;
|
||||
|
||||
/**
|
||||
* @var Wootook_Empire_Model_Planet_Builder
|
||||
*/
|
||||
|
|
@ -175,12 +180,16 @@ class Wootook_Empire_Model_Planet
|
|||
|
||||
public function getGalaxyData()
|
||||
{
|
||||
if ($this->isPlanet()) {
|
||||
$entity = new Wootook_Empire_Model_Galaxy_Position();
|
||||
$entity->load(array('id_planet' => $this->getId()));
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
return $this->getPlanet()->getGalaxyData();
|
||||
}
|
||||
|
||||
public function updateStorages($time = null)
|
||||
{
|
||||
Math::setPrecision(50);
|
||||
|
|
@ -533,10 +542,62 @@ class Wootook_Empire_Model_Planet
|
|||
));
|
||||
|
||||
$this->_moon = $statement->current();
|
||||
|
||||
if ($this->_moon !== null && $this->_moon instanceof self) {
|
||||
$this->_moon->setPlanet($this);
|
||||
}
|
||||
}
|
||||
return $this->_moon;
|
||||
}
|
||||
|
||||
public function setMoon(Wootook_Empire_Model_Planet $moon)
|
||||
{
|
||||
$this->_moon = $moon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlanet()
|
||||
{
|
||||
static $statement = null;
|
||||
|
||||
if ($this->isPlanet()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->_planet === null) {
|
||||
if ($statement === null) {
|
||||
$statement = new Wootook_Core_Collection(array('planet' => 'planets'), get_class($this));
|
||||
$statement
|
||||
->where('galaxy=:galaxy')
|
||||
->where('system=:system')
|
||||
->where('planet=:position')
|
||||
->where('planet_type=' . strval(self::TYPE_PLANET))
|
||||
;
|
||||
}
|
||||
|
||||
$statement->load(array(
|
||||
'galaxy' => $this->getGalaxy(),
|
||||
'system' => $this->getSystem(),
|
||||
'position' => $this->getPosition()
|
||||
));
|
||||
|
||||
$this->_planet = $statement->current();
|
||||
|
||||
if ($this->_planet !== null && $this->_planet instanceof self) {
|
||||
$this->_planet->setMoon($this);
|
||||
}
|
||||
}
|
||||
return $this->_planet;
|
||||
}
|
||||
|
||||
public function setPlanet(Wootook_Empire_Model_Planet $planet)
|
||||
{
|
||||
$this->_planet = $planet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setGalaxy($galaxy)
|
||||
{
|
||||
$this->setData('galaxy', $galaxy);
|
||||
|
|
|
|||
|
|
@ -555,6 +555,10 @@ class Wootook_Empire_Model_User
|
|||
$layout = $eventData['layout'];
|
||||
$navigation = $layout->getBlock('navigation');
|
||||
|
||||
$navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/index.php', array(), array('admin'));
|
||||
if (!defined('IN_ADMIN')) {
|
||||
$navigation->addLink('tools/admin', 'Admin Panel', 'Admin Panel', 'admin/overview.php', array(), array('admin'));
|
||||
} else {
|
||||
$navigation->addLink('tools/back', 'Go back to the game', 'Go back to the game', 'overview.php', array(), array('admin'));
|
||||
}
|
||||
}
|
||||
}
|
||||
243
application/design/base/default/layouts/admin.php
Normal file
243
application/design/base/default/layouts/admin.php
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
<?php return array(
|
||||
'admin' => array(
|
||||
'update' => '1column',
|
||||
'reference' => array(
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'navigation' => array(
|
||||
'type' => 'core/html.navigation',
|
||||
'template' => 'page/html/navigation.phtml',
|
||||
'actions' => array(
|
||||
array(
|
||||
'method' => 'setNodeTitle',
|
||||
'params' => array(
|
||||
'path' => 'system',
|
||||
'title' => 'System'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'system/overview',
|
||||
'label' => 'Overview',
|
||||
'title' => 'Overview',
|
||||
'uri' => 'admin/overview.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'system/settings',
|
||||
'label' => 'Settings',
|
||||
'title' => 'Settings',
|
||||
'uri' => 'admin/settings.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'system/reset-universe',
|
||||
'label' => 'Reset Universe',
|
||||
'title' => 'Reset Universe',
|
||||
'uri' => 'admin/XNovaResetUnivers.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'setNodeTitle',
|
||||
'params' => array(
|
||||
'path' => 'players',
|
||||
'title' => 'Player Accounts'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/list',
|
||||
'label' => 'List',
|
||||
'title' => 'List',
|
||||
'uri' => 'admin/userlist.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/password-recovery',
|
||||
'label' => 'Change a password',
|
||||
'title' => 'Change a password',
|
||||
'uri' => 'admin/md5changepass.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/search',
|
||||
'label' => 'Search',
|
||||
'title' => 'Search',
|
||||
'uri' => 'admin/paneladmina.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/multi-account-alerts',
|
||||
'label' => 'Multi account alerts',
|
||||
'title' => 'Multi account alerts',
|
||||
'uri' => 'admin/multi.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/declared-multi-account',
|
||||
'label' => 'Declared multi accounts',
|
||||
'title' => 'Declared multi accounts',
|
||||
'uri' => 'admin/declare_list.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/add-resources',
|
||||
'label' => 'Add Resources',
|
||||
'title' => 'Add Resources',
|
||||
'uri' => 'admin/add_money.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/messages',
|
||||
'label' => 'Private messages management',
|
||||
'title' => 'Private messages management',
|
||||
'uri' => 'admin/messagelist.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/chat',
|
||||
'label' => 'Manage Chat',
|
||||
'title' => 'Manage Chat',
|
||||
'uri' => 'chat.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/ban',
|
||||
'label' => 'Ban Player',
|
||||
'title' => 'Ban Player',
|
||||
'uri' => 'admin/banned.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'players/unban',
|
||||
'label' => 'Unban Player',
|
||||
'title' => 'Unban Player',
|
||||
'uri' => 'admin/unbanned.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'setNodeTitle',
|
||||
'params' => array(
|
||||
'path' => 'empire',
|
||||
'title' => 'Empires'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'empire/planet-list',
|
||||
'label' => 'Planet List',
|
||||
'title' => 'Planet List',
|
||||
'uri' => 'admin/planetlist.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'empire/moon-list',
|
||||
'label' => 'Moon List',
|
||||
'title' => 'Moon List',
|
||||
'uri' => 'admin/moonlist.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'empire/add-moon',
|
||||
'label' => 'Add a moon',
|
||||
'title' => 'Add a moon',
|
||||
'uri' => 'admin/add_moon.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'empire/planet-activity',
|
||||
'label' => 'Planet Activity',
|
||||
'title' => 'Planet Activity',
|
||||
'uri' => 'admin/activeplanet.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'empire/fleet-list',
|
||||
'label' => 'Fleet list',
|
||||
'title' => 'Fleet list',
|
||||
'uri' => 'admin/ShowFlyingFleets.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'setNodeTitle',
|
||||
'params' => array(
|
||||
'path' => 'tools',
|
||||
'title' => 'Tools'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'tools/phpinfo',
|
||||
'label' => 'PHP Info',
|
||||
'title' => 'PHP Info',
|
||||
'uri' => 'variables.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'tools/stats',
|
||||
'label' => 'Stats updater',
|
||||
'title' => 'Stats updater',
|
||||
'uri' => 'statbuilder.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addLink',
|
||||
'params' => array(
|
||||
'name' => 'tools/errors',
|
||||
'label' => 'Error reporting',
|
||||
'title' => 'Error reporting',
|
||||
'uri' => 'errors.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'method' => 'addExternalLink',
|
||||
'params' => array(
|
||||
'name' => 'tools/help',
|
||||
'label' => 'Need help?',
|
||||
'title' => 'Need help?',
|
||||
'url' => 'http://wootook.org/board/'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
@ -2,7 +2,11 @@
|
|||
'empire' => array(
|
||||
'update' => '1column',
|
||||
'reference' => array(
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'navigation' => array(
|
||||
'type' => 'core/html.navigation',
|
||||
'template' => 'page/html/navigation.phtml',
|
||||
'actions' => array(
|
||||
array(
|
||||
'method' => 'setNodeTitle',
|
||||
|
|
@ -71,7 +75,7 @@
|
|||
'name' => 'development/officers',
|
||||
'label' => 'Officers',
|
||||
'title' => 'Officers',
|
||||
'uri' => 'officers.php'
|
||||
'uri' => 'officier.php'
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
|
@ -287,6 +291,8 @@
|
|||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'overview' => array(
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
<?php return array(
|
||||
'1column' => array(
|
||||
'update' => 'default',
|
||||
'reference' => array(
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'navigation' => array(
|
||||
'type' => 'core/html.navigation',
|
||||
'template' => 'page/html/navigation.phtml'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
'update' => 'default'
|
||||
),
|
||||
|
||||
'2columns-left' => array(
|
||||
|
|
@ -20,13 +10,7 @@
|
|||
'root' => array(
|
||||
'children' => array(
|
||||
'left' => array(
|
||||
'type' => 'core/concat',
|
||||
'children' => array(
|
||||
'navigation' => array(
|
||||
'type' => 'core/html.navigation',
|
||||
'template' => 'page/html/navigation.phtml'
|
||||
)
|
||||
)
|
||||
'type' => 'core/concat'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
<form name="rename-planet" id="overview:rename-planet" method="post" action="">
|
||||
<form name="rename-planet" class="form rename-planet" id="overview:rename-planet" method="post" action="">
|
||||
<fieldset>
|
||||
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
|
||||
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
|
||||
<input id="overview:rename-planet:password" type="password" name="password" />
|
||||
<p>
|
||||
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
|
||||
<input id="overview:rename-planet:name" type="text" name="name" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
|
||||
<input id="overview:rename-planet:password" type="password" name="password" />
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<form action="reg.php" method="post" class="registration">
|
||||
<form action="reg.php" method="post" class="form registration">
|
||||
<h1>Wootook!</h1>
|
||||
<fieldset>
|
||||
<legend><?php echo $this->__('User data:')?></legend>
|
||||
|
|
|
|||
84
application/design/install/default/layouts/install.php
Normal file
84
application/design/install/default/layouts/install.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php return array(
|
||||
'install' => array(
|
||||
'update' => '2columns-left',
|
||||
'reference' => array(
|
||||
'messages' => array(
|
||||
'actions' => array(
|
||||
array(
|
||||
'method' => 'prepareMessages',
|
||||
'params' => array(
|
||||
'namespace' => 'install'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'navigation' => array(
|
||||
'type' => 'core/html.navigation',
|
||||
'template' => 'page/html/navigation.phtml',
|
||||
'actions' => array()
|
||||
)
|
||||
)
|
||||
),
|
||||
'left' => array(
|
||||
'children' => array(
|
||||
'status' => array(
|
||||
'type' => 'core/template',
|
||||
'template' => 'status.phtml'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'install.intro' => array(
|
||||
'update' => 'install',
|
||||
'reference' => array(
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'overview' => array(
|
||||
'type' => 'core/template',
|
||||
'template' => 'intro.phtml'
|
||||
),
|
||||
)
|
||||
),
|
||||
'status' => array(
|
||||
'actions' => array(
|
||||
array(
|
||||
'method' => 'setData',
|
||||
'params' => array(
|
||||
'key' => 'step',
|
||||
'value' => 'intro'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'install.step.system' => array(
|
||||
'update' => 'install',
|
||||
'reference' => array(
|
||||
'content' => array(
|
||||
'children' => array(
|
||||
'overview' => array(
|
||||
'type' => 'core/template',
|
||||
'template' => 'step/system.phtml'
|
||||
),
|
||||
)
|
||||
),
|
||||
'status' => array(
|
||||
'actions' => array(
|
||||
array(
|
||||
'method' => 'setData',
|
||||
'params' => array(
|
||||
'key' => 'step',
|
||||
'value' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_acc1')?><br>
|
||||
<?php echo $this->getData('ins_tx_acc2')?><br><br>
|
||||
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_acc_user')?>:</td>
|
||||
<td><input name="adm_user" size="20" maxlength="20" type="text" onKeypress="
|
||||
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
|
||||
if (event.which==60 || event.which==62) return false;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_acc_pass')?>:</td>
|
||||
<td><input name="adm_pass" size="20" maxlength="20" type="password" onKeypress="
|
||||
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
|
||||
if (event.which==60 || event.which==62) return false;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_acc_email')?>:</td>
|
||||
<td><input name="adm_email" size="20" maxlength="40" type="text" onKeypress="
|
||||
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
|
||||
if (event.which==60 || event.which==62) return false;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_acc_planet')?>:</td>
|
||||
<td><input name="adm_planet" size="20" maxlength="20" type="text" onKeypress="
|
||||
if (event.keyCode==60 || event.keyCode==62) event.returnValue = false;
|
||||
if (event.which==60 || event.which==62) return false;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_acc_sex')?>:</td>
|
||||
<td><select name="adm_sex">
|
||||
<option value=""><?php echo $this->getData('ins_acc_sex0')?></option>
|
||||
<option value="M"><?php echo $this->getData('ins_acc_sex1')?></option>
|
||||
<option value="F"><?php echo $this->getData('ins_acc_sex2')?></option>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_creat')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_done2')?><br>
|
||||
<?php echo $this->getData('ins_tx_done3')?><br><br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<br><br>
|
||||
<table width="700">
|
||||
<tbody><tr>
|
||||
<td width="120px" class="c" align="left"><font size="2px"><?php echo $this->getData('ins_appname')?></font></td>
|
||||
<td width="580px" rowspan="2" class="c" align="right"><font size="2px"><?php echo $this->getData('ins_tx_sys')?></font><br /><?php echo $this->getData('ins_tx_state')?> <?php echo $this->getData('ins_state')?></td>
|
||||
</tr><tr>
|
||||
<th rowspan="4"><table border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="124" align="center"><a href="index.php?mode=intro" accesskey="i"><?php echo $this->getData('ins_mnu_intro')?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="index.php?mode=ins&page=1" accesskey="i"><?php echo $this->getData('ins_mnu_inst')?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="index.php?mode=goto&page=1" accesskey="b"><?php echo $this->getData('ins_mnu_goto')?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="index.php?mode=upg" accesskey="u"><?php echo $this->getData('ins_mnu_upgr')?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="index.php?mode=bye" accesskey="b"><?php echo $this->getData('ins_mnu_quit')?></a></td>
|
||||
</tr>
|
||||
</table></th>
|
||||
</tr>
|
||||
<form action="<?php echo $this->getData('dis_ins_btn')?>" method="post">
|
||||
<?php echo $this->getData('ins_page')?>
|
||||
</form>
|
||||
</table>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_inst1')?><br>
|
||||
<?php echo $this->getData('ins_tx_inst2')?><br>
|
||||
<?php echo $this->getData('ins_tx_inst3')?><br><br>
|
||||
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_server')?>:</td>
|
||||
<td><input type="text" name="host" value="localhost" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_db')?>:</td>
|
||||
<td><input type="text" name="db" value="" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
|
||||
<td><input type="text" name="prefix" value="game_" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_login')?>:</td>
|
||||
<td><input type="text" name="user" value="" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_pass')?>:</td>
|
||||
<td><input type="password" name="passwort" value="" size="20"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><br><?php echo $this->getData('ins_tx_done1')?><br><br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_done4')?><br>
|
||||
<?php echo $this->getData('ins_tx_done3')?><br><br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="self.location.href='../'" value="<?php echo $this->getData('ins_btn_login')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_inst1')?><br>
|
||||
<?php echo $this->getData('ins_tx_goto4')?><br>
|
||||
<?php echo $this->getData('ins_tx_goto5')?><br><br>
|
||||
<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_server')?>:</td>
|
||||
<td><input type="text" name="host" value="localhost" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_db')?>:</td>
|
||||
<td><input type="text" name="db" value="" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_prefix')?>:</td>
|
||||
<td><input type="text" name="prefix" value="game_" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_login')?>:</td>
|
||||
<td><input type="text" name="user" value="" size="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $this->getData('ins_form_pass')?>:</td>
|
||||
<td><input type="password" name="passwort" value="" size="20"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_inst')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_goto1')?><br>
|
||||
<?php echo $this->getData('ins_tx_goto2')?><br>
|
||||
<?php echo $this->getData('ins_tx_goto3')?><br><br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="submit();" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
|
||||
</tr>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<tr>
|
||||
<th colspan="2">
|
||||
<br><?php echo $this->getData('ins_tx_welco')?><br>
|
||||
<?php echo $this->getData('ins_tx_intr1')?><br>
|
||||
<?php echo $this->getData('ins_tx_intr2')?><br>
|
||||
<?php echo $this->getData('ins_tx_intr3')?><br><br>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><input type="button" name="next" onclick="self.location.href='index.php?mode=ins&page=1'" value="<?php echo $this->getData('ins_btn_next')?>" ></th>
|
||||
</tr>
|
||||
7
application/design/install/default/scripts/intro.phtml
Normal file
7
application/design/install/default/scripts/intro.phtml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<div class="install">
|
||||
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
|
||||
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
|
||||
<p><?php echo $this->__('This page will guide you through the installation proces of Wootook! the MMO game engine platform.')?></p>
|
||||
<p><?php echo $this->__('Feel free to ask for help at any time at <a href="%s">wootook.org</a>.', 'http://wootook.org/board/')?></p>
|
||||
<p><button onclick="document.location.href='?mode=install&step=1'"><?php echo $this->__('Next step')?></button></p>
|
||||
</div>
|
||||
13
application/design/install/default/scripts/step/system.phtml
Normal file
13
application/design/install/default/scripts/step/system.phtml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php $session = Wootook::getSession('install')?>
|
||||
<div class="install">
|
||||
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
|
||||
<h2><?php echo $this->__('System Config')?></h2>
|
||||
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
|
||||
<form method="post" action="?mode=install&step=1">
|
||||
<p>
|
||||
<label for="system:url_path"><?php echo $this->__('Base URL path for the game:')?></label>
|
||||
<input type="text" id="system:url_path" name="url_path" value="<?php echo $session->getFormData('url_path', Wootook::getBaseUrl())?>" />
|
||||
</p>
|
||||
<p><input type="submit" value="<?php echo $this->__('Next step')?>" /></p>
|
||||
</form>
|
||||
</div>
|
||||
1
application/gamedata/default/default/combat.php
Normal file
1
application/gamedata/default/default/combat.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
2
application/gamedata/default/default/events.php
Normal file
2
application/gamedata/default/default/events.php
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?php return array(
|
||||
);
|
||||
1
application/gamedata/default/default/fields-alias.php
Normal file
1
application/gamedata/default/default/fields-alias.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
6
application/gamedata/default/default/modules.php
Normal file
6
application/gamedata/default/default/modules.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php return array(
|
||||
'block' => array(
|
||||
'core' => array('Wootook_Core_Block_' => 'Wootook/Core/Block'),
|
||||
'empire' => array('Wootook_Empire_Block_' => 'Wootook/Empire/Block')
|
||||
)
|
||||
);
|
||||
2
application/gamedata/default/default/prices.php
Normal file
2
application/gamedata/default/default/prices.php
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?php return array(
|
||||
);
|
||||
1
application/gamedata/default/default/production.php
Normal file
1
application/gamedata/default/default/production.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
1
application/gamedata/default/default/requirements.php
Normal file
1
application/gamedata/default/default/requirements.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
1
application/gamedata/default/default/resources.php
Normal file
1
application/gamedata/default/default/resources.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
1
application/gamedata/default/default/types.php
Normal file
1
application/gamedata/default/default/types.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array();
|
||||
39
application/locale/fr_FR/Legacies.csv
Normal file
39
application/locale/fr_FR/Legacies.csv
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"Your session has expired, please login.","Votre session a expiré, veuillez vous reconnecter."
|
||||
"Your username or credential is invalid, please check your input.","Votre nom d'utilisateur ou votre mot de passe n'est pas valide, veuillez vérifier votre saisie."
|
||||
"No such user.","Cet utilisateur n'existe pas."
|
||||
"You were banned, please contact admin for more information.","Vous ont été banni, veuillez contacter l'admin pour plus d'informations."
|
||||
"You have 1 unread message.","Vous avez un message non lu."
|
||||
"You have 1 new message.","Vous avez un nouveau message."
|
||||
"You have no new message.","Vous n'avez pas de nouveau message."
|
||||
"You have %1$d new messages","Vous avez %1$d nouveaux messages"
|
||||
"You have %1$d unread messages.","Vous avez %1$d messages non lus."
|
||||
"You have ""%1$d"" unread messages.","Vous avez ""%1$d"" messages non lus."
|
||||
"No message.","Aucun message"
|
||||
"1 messages.","Un message"
|
||||
"%1$d messages.","%1$d messages."
|
||||
"instantaneous","instantanné"
|
||||
"Attack","Attaquer"
|
||||
"Transport","Transporter"
|
||||
"Station","Stationner"
|
||||
"Settle","Coloniser"
|
||||
"Recycle","Recycler"
|
||||
"Destroy","Détruire"
|
||||
"Missiles Launch","Attaque de missiles"
|
||||
"Expedition","Expédition"
|
||||
"Unknown","Inconnu"
|
||||
"Planet is already destroyed","La planète est déjà détruite"
|
||||
"Password:","Mot de passe :"
|
||||
"I want to destroy this planet","Je confirme vouloir détruire cette planète"
|
||||
"New name","Nouveau nom"
|
||||
"Idle.","Inactif."
|
||||
"Cancel","Annuler"
|
||||
"Work in progress","Travail en cours"
|
||||
"Buildings","Bâtiments"
|
||||
"Research Laboratory","Laboratoire de recherches"
|
||||
"Shipyard","Chantier spatial"
|
||||
"Build","Construire"
|
||||
"Metal","Métal"
|
||||
"Cristal","Cristal"
|
||||
"Deuterium","Deutérium"
|
||||
"Energy","Energie"
|
||||
"Messages","Messages"
|
||||
|
Can't render this file because it contains an unexpected character in line 13 and column 33.
|
|
|
@ -37,10 +37,6 @@ if (0 === filesize(ROOT_PATH . 'config.php')) {
|
|||
die();
|
||||
}
|
||||
|
||||
foreach (include ROOT_PATH . 'includes/data/events.php' as $event => $listenerList) {
|
||||
foreach ($listenerList as $listener) {
|
||||
Wootook::registerListener($event, $listener);
|
||||
}
|
||||
}
|
||||
Wootook_Core_Model_Config_Events::registerEvents();
|
||||
|
||||
include ROOT_PATH . 'includes/constants.php';
|
||||
|
|
@ -62,6 +62,11 @@ case 'fleet':
|
|||
$shipyard->appendQueue($shipId, $count);
|
||||
}
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout = new Wootook_Core_Layout();
|
||||
|
|
@ -87,9 +92,19 @@ case 'research':
|
|||
$data = $planet->getAllDatas();
|
||||
$planet->appendBuildingQueue(intval($_GET['research']), isset($_GET['destroy']));
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
|
||||
$planet->dequeueItem($_GET['cancel']);
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout = new Wootook_Core_Layout();
|
||||
|
|
@ -121,6 +136,11 @@ case 'defense':
|
|||
$shipyard->appendQueue($defenseId, $count);
|
||||
}
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout = new Wootook_Core_Layout();
|
||||
|
|
@ -138,9 +158,19 @@ default:
|
|||
$data = $planet->getAllDatas();
|
||||
$planet->appendBuildingQueue(intval($_GET['building']), isset($_GET['destroy']));
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
} else if (isset($_GET['cancel']) && !empty($_GET['cancel'])) {
|
||||
$planet->dequeueItem($_GET['cancel']);
|
||||
$planet->save();
|
||||
|
||||
Wootook::getResponse()
|
||||
->setRedirect(Wootook::getUrl('buildings.php', array('mode' => $mode)))
|
||||
->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout = new Wootook_Core_Layout();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
),
|
||||
'layout' => array(
|
||||
'page' => 'page.php',
|
||||
'admin' => 'admin.php',
|
||||
'empire' => 'empire.php'
|
||||
),
|
||||
'locales' => array(
|
||||
|
|
|
|||
|
|
@ -33,66 +33,108 @@ define('INSTALL' , false);
|
|||
require_once dirname(__FILE__) .'/application/bootstrap.php';
|
||||
|
||||
|
||||
$mode = $_GET['mode'];
|
||||
$a = $_GET['a'];
|
||||
/*
|
||||
Este script es original xD
|
||||
La funcion de este script es administrar una variable del $user
|
||||
Permite agregar y quitar arrays...
|
||||
*/
|
||||
//Lets start!
|
||||
if(isset($_GET['mode'])){
|
||||
$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
|
||||
$a = isset($_GET['a']) ? $_GET['a'] : null;
|
||||
|
||||
$user = Wootook_Empire_Model_User::getSingleton();
|
||||
|
||||
if ($mode) {
|
||||
if ($_POST) {
|
||||
//Pegamos el texto :P
|
||||
if($_POST["n"] == ""){$_POST["n"] = "Unbenannt";}
|
||||
if (!isset($_POST["n"]) || empty($_POST["n"])) {
|
||||
$name = Wootook::__("Unnamed");
|
||||
} else {
|
||||
$name = $_POST["n"];
|
||||
}
|
||||
|
||||
$r = strip_tags($_POST[n]).",".intval($_POST[g]).",".intval($_POST[s]).",".intval($_POST[p]).",".intval($_POST[t])."\r\n";
|
||||
$user['fleet_shortcut'] .= $r;
|
||||
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||
message("Le raccourcis a été enregistré !","Enregistrment","fleetshortcut.php");
|
||||
if (($offset = strpos($name, "\n")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
if (($offset = strpos($name, "\r")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
if (($offset = strpos($name, ",")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
$planetTypes = array(
|
||||
Wootook_Empire_Model_Planet::TYPE_PLANET,
|
||||
Wootook_Empire_Model_Planet::TYPE_DEBRIS,
|
||||
Wootook_Empire_Model_Planet::TYPE_MOON
|
||||
);
|
||||
|
||||
$r = array();
|
||||
$r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name);
|
||||
$r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= MAX_GALAXY_IN_WORLD) ? intval($_POST['g']) : '1';
|
||||
$r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= MAX_SYSTEM_IN_GALAXY) ? intval($_POST['s']) : '1';
|
||||
$r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= MAX_PLANET_IN_SYSTEM) ? intval($_POST['p']) : '1';
|
||||
$r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : '1';
|
||||
|
||||
$user['fleet_shortcut'] .= implode(",", $r);
|
||||
$user->save();
|
||||
message(Wootook::__("The shortcut has been saved."), Wootook::__("Success"), "fleetshortcut.php");
|
||||
}
|
||||
$page = "<form method=POST><table border=0 cellpadding=0 cellspacing=1 width=519>
|
||||
<tr height=20>
|
||||
<td colspan=2 class=c>Nom [Galaxie/Système solaire/Planète]</td>
|
||||
</tr><tr height=\"20\"><th>
|
||||
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"Name\">
|
||||
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"Galaxie\">
|
||||
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"Sonnensystem\">
|
||||
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"Planet\">
|
||||
<input type=text name=n value=\"$g\" size=32 maxlength=32 title=\"" . Wootook::__('Name') . "\">
|
||||
<input type=text name=g value=\"$s\" size=3 maxlength=1 title=\"" . Wootook::__('Galaxy') . "\">
|
||||
<input type=text name=s value=\"$p\" size=3 maxlength=3 title=\"" . Wootook::__('System') . "\">
|
||||
<input type=text name=p value=\"$t\" size=3 maxlength=3 title=\"" . Wootook::__('Planet') . "\">
|
||||
<select name=t>";
|
||||
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">Planète</option>";
|
||||
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">Débris</option>";
|
||||
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">Lune</option>";
|
||||
$page .= '<option value="1"'.(($c[4]==1)?" SELECTED":"").">" . Wootook::__('Planet') . "</option>";
|
||||
$page .= '<option value="2"'.(($c[4]==2)?" SELECTED":"").">" . Wootook::__('Debris') . "</option>";
|
||||
$page .= '<option value="3"'.(($c[4]==3)?" SELECTED":"").">" . Wootook::__('Moon') . "</option>";
|
||||
$page .= "</select>
|
||||
</th></tr><tr>
|
||||
<th><input type=\"reset\" value=\"Zurücksetzen\"> <input type=\"submit\" value=\"Enregistrer\">";
|
||||
<th><input type=\"reset\" value=\"" . Wootook::__('Reset') . "\"> <input type=\"submit\" value=\"" . Wootook::__('Save') . "\">";
|
||||
//Muestra un (L) si el destino pertenece a luna, lo mismo para escombros
|
||||
$page .= "</th></tr>";
|
||||
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Effacer</a></td></tr></tr></table></form>';
|
||||
}
|
||||
elseif(isset($_GET['a'])){
|
||||
} else if ($a !== null) {
|
||||
if ($_POST) {
|
||||
//Armamos el array...
|
||||
$scarray = explode("\r\n", $user['fleet_shortcut']);
|
||||
if($_POST["delete"]){
|
||||
if (isset($_POST["delete"])) {
|
||||
unset($scarray[$a]);
|
||||
$user['fleet_shortcut'] = implode("\r\n", $scarray);
|
||||
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||
message("Shortcut wurde gelöscht","Gelöscht","fleetshortcut.php");
|
||||
}
|
||||
else{
|
||||
doquery("UPDATE {{table}} SET fleet_shortcut={$db->quote($user['fleet_shortcut'])} WHERE id={$user['id']}", "users");
|
||||
message(Wootook::__("The shortcut has been deleted"), Wootook::__("Success"), "fleetshortcut.php");
|
||||
} else {
|
||||
$r = explode(",", $scarray[$a]);
|
||||
$r[0] = strip_tags($_POST['n']);
|
||||
$r[1] = intval($_POST['g']);
|
||||
$r[2] = intval($_POST['s']);
|
||||
$r[3] = intval($_POST['p']);
|
||||
$r[4] = intval($_POST['t']);
|
||||
if (!isset($_POST["n"]) || empty($_POST["n"])) {
|
||||
$name = $r[0];
|
||||
} else {
|
||||
$name = $_POST["n"];
|
||||
}
|
||||
|
||||
if (($offset = strpos($name, "\n")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
if (($offset = strpos($name, "\r")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
if (($offset = strpos($name, ",")) !== false) {
|
||||
$name = substr($name, 0, $offset);
|
||||
}
|
||||
$planetTypes = array(
|
||||
Wootook_Empire_Model_Planet::TYPE_PLANET,
|
||||
Wootook_Empire_Model_Planet::TYPE_DEBRIS,
|
||||
Wootook_Empire_Model_Planet::TYPE_MOON
|
||||
);
|
||||
$r[0] = preg_replace('#[^[:alnum:]\s\-\_\']#', '', $name);
|
||||
$r[1] = (isset($_POST['g']) && intval($_POST['g']) > 0 && intval($_POST['g']) <= MAX_GALAXY_IN_WORLD) ? intval($_POST['g']) : $r[1];
|
||||
$r[2] = (isset($_POST['s']) && intval($_POST['s']) > 0 && intval($_POST['s']) <= MAX_SYSTEM_IN_GALAXY) ? intval($_POST['s']) : $r[2];
|
||||
$r[3] = (isset($_POST['p']) && intval($_POST['p']) > 0 && intval($_POST['p']) <= MAX_PLANET_IN_SYSTEM) ? intval($_POST['p']) : $r[3];
|
||||
$r[4] = (isset($_POST['t']) && intval($_POST['t']) > 0 && in_array(intval($_POST['t']), $planetTypes)) ? intval($_POST['t']) : $r[4];
|
||||
|
||||
$scarray[$a] = implode(",", $r);
|
||||
$user['fleet_shortcut'] = implode("\r\n", $scarray);
|
||||
doquery("UPDATE {{table}} SET fleet_shortcut='{$user[fleet_shortcut]}' WHERE id={$user[id]}","users");
|
||||
message("Le raccourcis a été édité !.","Editer","fleetshortcut.php");
|
||||
$user->save();
|
||||
message(Wootook::__("The shortcut has been updated."), Wootook::__("Success"), "fleetshortcut.php");
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['fleet_shortcut']) {
|
||||
|
||||
$scarray = explode("\r\n",$user['fleet_shortcut']);
|
||||
|
|
@ -118,13 +160,14 @@ elseif(isset($_GET['a'])){
|
|||
<th><input type=reset value=\"Reset\"> <input type=submit value=\"Enregistrer\"> <input type=submit name=delete value=\"Supprimer\">";
|
||||
$page .= "</th></tr>";
|
||||
|
||||
}else{$page .= message("Le raccourcis a été enregistré !","Enregistrer","fleetshortcut.php");}
|
||||
} else {
|
||||
$page .= message("Le raccourcis a été enregistré !","Enregistrer","fleetshortcut.php");
|
||||
}
|
||||
|
||||
$page .= '<tr><td colspan=2 class=c><a href=fleetshortcut.php>Retour</a></td></tr></tr></table></form>';
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
|
||||
$page = '<table border="0" cellpadding="0" cellspacing="1" width="519">
|
||||
<tr height="20">
|
||||
|
|
|
|||
|
|
@ -503,11 +503,15 @@ class Deprecated
|
|||
/**
|
||||
* @return Wootook_Core_Layout
|
||||
*/
|
||||
public static function getLayout()
|
||||
public static function getLayout($adminPage = false)
|
||||
{
|
||||
if (self::$layout === null) {
|
||||
self::$layout = new Wootook_Core_Layout();
|
||||
self::$layout->load('empire');
|
||||
|
||||
if (defined('IN_INSTALL')) {
|
||||
self::$layout->setPackage('install');
|
||||
self::$layout->setTheme('default');
|
||||
}
|
||||
}
|
||||
|
||||
return self::$layout;
|
||||
|
|
@ -528,7 +532,13 @@ function display($page, $title = '', $topnav = true, $metatags = '', $adminPage
|
|||
defined('DEPRECATION') || trigger_error(sprintf('%s is deprecated', __FUNCTION__), E_USER_DEPRECATED);
|
||||
|
||||
// TODO: implement extra meta tags
|
||||
$layout = Deprecated::getLayout();
|
||||
$layout = Deprecated::getLayout($adminPage);
|
||||
if ($adminPage === false) {
|
||||
$layout->load('empire');
|
||||
} else {
|
||||
$layout->load('admin');
|
||||
}
|
||||
|
||||
$content = $layout->getBlock('content');
|
||||
|
||||
if ($topnav) {
|
||||
|
|
|
|||
|
|
@ -63,17 +63,17 @@ function GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy,
|
|||
$Result .= " onmouseover='return overlib(\"";
|
||||
$Result .= "<table width=240>";
|
||||
$Result .= "<tr>";
|
||||
$Result .= "<td class=c>".$lang['Alliance']." ". $allyquery['ally_name'] ." ".$lang['gl_with']." ". $members_count[0] ." ". $lang['gl_membre'] . $add ."</td>";
|
||||
$Result .= "<td class=c>".htmlspecialchars($lang['Alliance'], ENT_QUOTES, 'UTF-8')." ". htmlspecialchars($allyquery['ally_name'], ENT_QUOTES, 'UTF-8') ." ".$lang['gl_with']." ". $members_count[0] ." ". $lang['gl_membre'] . $add ."</td>";
|
||||
$Result .= "</tr>";
|
||||
$Result .= "<th>";
|
||||
$Result .= "<table>";
|
||||
$Result .= "<tr>";
|
||||
$Result .= "<td><a href=alliance.php?mode=ainfo&a=". $allyquery['id'] .">".$lang['gl_ally_internal']."</a></td>";
|
||||
$Result .= "<td><a href=alliance.php?mode=ainfo&a=". intval($allyquery['id']) .">".$lang['gl_ally_internal']."</a></td>";
|
||||
$Result .= "</tr><tr>";
|
||||
$Result .= "<td><a href=stat.php?start=101&who=ally>".$lang['gl_stats']."</a></td>";
|
||||
if ($allyquery["ally_web"] != "") {
|
||||
$Result .= "</tr><tr>";
|
||||
$Result .= "<td><a href=". $allyquery["ally_web"] ." target=_new>".$lang['gl_ally_web']."</td>";
|
||||
$Result .= "<td><a href=". htmlspecialchars($allyquery["ally_web"], ENT_QUOTES, 'UTF-8') ." target=_new>".$lang['gl_ally_web']."</td>";
|
||||
}
|
||||
$Result .= "</tr>";
|
||||
$Result .= "</table>";
|
||||
|
|
@ -82,7 +82,7 @@ function GalaxyRowAlly ( $GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy,
|
|||
$Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
|
||||
$Result .= " onmouseout='return nd();'>";
|
||||
if ($user['ally_id'] == $GalaxyRowUser['ally_id']) {
|
||||
$Result .= "<span class=\"allymember\">". $allyquery['ally_tag'] ."</span></a>";
|
||||
$Result .= "<span class=\"allymember\">". htmlspecialchars($allyquery['ally_tag'], ENT_QUOTES, 'UTF-8') ."</span></a>";
|
||||
} else {
|
||||
$Result .= $allyquery['ally_tag'] ."</a>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,25 +48,17 @@ include(ROOT_PATH . 'includes/functions/SendSimpleMessage.'.PHPEXT);
|
|||
include(ROOT_PATH . 'includes/functions/SpyTarget.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/RestoreFleetToPlanet.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/StoreGoodsToPlanet.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/CheckPlanetBuildingQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/CheckPlanetUsedFields.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/CreateOneMoonRecord.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/CreateOneMoonRecord.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/CreateOnePlanetRecord.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/InsertJavaScriptChronoApplet.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/IsTechnologieAccessible.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetBuildingTime.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetBuildingTimeLevel.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GetRestPrice.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetElementPrice.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetBuildingPrice.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/IsTechnologieAccessible.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/GetRestPrice.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/IsElementBuyable.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/CheckCookies.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ChekUser.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/InsertGalaxyScripts.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GalaxyCheckFunctions.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/ShowGalaxyRows.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GetPhalanxRange.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/GetMissileRange.'.PHPEXT); // <- TODO: delete
|
||||
include(ROOT_PATH . 'includes/functions/GalaxyRowPos.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanet.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GalaxyRowPlanetName.'.PHPEXT);
|
||||
|
|
@ -80,30 +72,8 @@ include(ROOT_PATH . 'includes/functions/ShowGalaxyMISelector.'.PHPEXT);
|
|||
include(ROOT_PATH . 'includes/functions/ShowGalaxyTitles.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/GalaxyLegendPopup.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/ShowGalaxyFooter.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetMaxConstructibleElements.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/GetElementRessources.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ElementBuildListBox.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ElementBuildListQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/FleetBuildingPage.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/DefensesBuildingPage.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ResearchBuildingPage.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/BatimentBuildingPage.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/CheckLabSettingsInQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/InsertBuildListScript.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/AddBuildingToQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ShowBuildingQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/HandleTechnologieBuild.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/BuildingSavePlanetRecord.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/BuildingSaveUserRecord.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/RemoveBuildingFromQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/CancelBuildingFromQueue.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/SetNextQueueElementOnTop.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/ShowTopNavigationBar.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/SetSelectedPlanet.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/MessageForm.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/SendNewPassword.'.PHPEXT);
|
||||
//include(ROOT_PATH . 'includes/functions/UpdatePlanetBatimentQueueList.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/IsOfficierAccessible.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/CheckInputStrings.'.PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions/MipCombatEngine.'.PHPEXT);
|
||||
|
|
|
|||
|
|
@ -32,43 +32,157 @@ define('INSIDE' , true);
|
|||
define('INSTALL', false);
|
||||
define('IN_INSTALL', true);
|
||||
|
||||
define('ROOT_PATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
|
||||
define('PHPEXT', include ROOT_PATH . 'extension.inc');
|
||||
define('STEP_SYSTEM', 1);
|
||||
define('STEP_DATABASE', 2);
|
||||
define('STEP_PROFILE', 3);
|
||||
define('STEP_UNIVERSE', 4);
|
||||
define('STEP_CONFIG', 5);
|
||||
|
||||
define('DEFAULT_SKINPATH', '../skins/xnova/');
|
||||
define('TEMPLATE_DIR', realpath(ROOT_PATH . '/templates/'));
|
||||
define('TEMPLATE_NAME', 'OpenGame');
|
||||
define('DEFAULT_LANG', 'fr');
|
||||
$dpath = DEFAULT_SKINPATH;
|
||||
require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php';
|
||||
|
||||
include(ROOT_PATH . 'includes/debug.class.'.PHPEXT);
|
||||
$debug = new debug();
|
||||
|
||||
include(ROOT_PATH . 'includes/constants.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/functions.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/unlocalised.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/todofleetcontrol.' . PHPEXT);
|
||||
include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg');
|
||||
include(ROOT_PATH . 'includes/vars.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/db.' . PHPEXT);
|
||||
include(ROOT_PATH . 'includes/strings.' . PHPEXT);
|
||||
|
||||
include(ROOT_PATH . 'includes/databaseinfos.php');
|
||||
include(ROOT_PATH . 'includes/migrateinfo.php');
|
||||
//include(ROOT_PATH . 'includes/databaseinfos.php');
|
||||
//include(ROOT_PATH . 'includes/migrateinfo.php');
|
||||
|
||||
$mode = isset($_GET['mode']) ? strval($_GET['mode']) : 'intro';
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
|
||||
$nextPage = $page + 1;
|
||||
$step = isset($_GET['step']) ? intval($_GET['step']) : 1;
|
||||
$prevStep = $step - 1;
|
||||
$nextStep = $step + 1;
|
||||
|
||||
$mainTpl = gettemplate('install/ins_body');
|
||||
includeLang('install/install');
|
||||
|
||||
$baseUrl = (isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) == "on" ? 'https://' : 'http://')
|
||||
. $_SERVER["SERVER_NAME"] . ($_SERVER["SERVER_PORT"] != "80" ? ":{$_SERVER["SERVER_PORT"]}" : '');
|
||||
if (isset($_SERVER['REQUEST_URI'])) {
|
||||
if (strrpos($_SERVER['REQUEST_URI'], '/') == (strlen($_SERVER['REQUEST_URI']) - 1)) {
|
||||
$baseUrl .= dirname($_SERVER['REQUEST_URI']) . '/';
|
||||
} else {
|
||||
$baseUrl .= dirname(dirname($_SERVER['REQUEST_URI'])) . '/';
|
||||
}
|
||||
}
|
||||
Wootook::setConfig('global/web/base_url', $baseUrl);
|
||||
|
||||
Wootook::setConfig('global/package', 'install');
|
||||
Wootook::setConfig('global/theme', 'default');
|
||||
Wootook::setconfig('global/layout', array(
|
||||
'page' => 'page.php',
|
||||
'install' => 'install.php'
|
||||
));
|
||||
|
||||
$session = Wootook::getSession('install');
|
||||
$layout = new Wootook_Core_Layout();
|
||||
$request = new Wootook_Core_Controller_Request_Http();
|
||||
$response = new Wootook_Core_Controller_Response_Http();
|
||||
|
||||
switch ($mode) {
|
||||
case 'intro':
|
||||
$subTpl = gettemplate('install/ins_intro');
|
||||
$bloc = $lang;
|
||||
$bloc['dpath'] = $dpath;
|
||||
$frame = parsetemplate($subTpl, $bloc);
|
||||
$layout->load('install.intro');
|
||||
$session->setData('step', 1);
|
||||
break;
|
||||
|
||||
case 'install':
|
||||
$session->addError('Test %s', 'Hello world!');
|
||||
if ($step != $session->getData('step')) {
|
||||
$session->setData('step', 0);
|
||||
$response->setRedirect("?mode=intro", Wootook_Core_Controller_Response_Http::REDIRECT_TEMPORARY);
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
switch ($step) {
|
||||
case STEP_SYSTEM:
|
||||
if ($request->isPost()) {
|
||||
$form = new Wootook_Core_Form($session, array(
|
||||
'url_path' => 'text'
|
||||
));
|
||||
$form->addField('url_path');
|
||||
$form->setRequest($request);
|
||||
$form->populate();
|
||||
|
||||
if (!$form->validate()) {
|
||||
$session->setData('step', $step);
|
||||
$session->setFormData($form->getData());
|
||||
var_dump($session);
|
||||
$response->setRedirect("?mode=install&step={$step}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->getMessagesblock()->prepareMessages('install');
|
||||
$session->setBaseUrl($request->getPost('url_path'));
|
||||
|
||||
$session->setStep(STEP_DATABASE);
|
||||
$response->setRedirect("?mode=install&step={$nextStep}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->load('install.step.system');
|
||||
break;
|
||||
|
||||
case STEP_DATABASE:
|
||||
if ($request->isPost()) {
|
||||
$form = new Wootook_Core_Form($session, array(
|
||||
'host' => 'text',
|
||||
'port' => 'text',
|
||||
'user' => 'text',
|
||||
'password' => 'text',
|
||||
'dbname' => 'text',
|
||||
'prefix' => 'text',
|
||||
));
|
||||
$form->setRequest($request);
|
||||
$form->populate();
|
||||
|
||||
if (!$form->validate()) {
|
||||
$session->setData('step', $step);
|
||||
$session->setFormData($request->getPost());
|
||||
$response->setRedirect("?mode=install&step={$step}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->getMessagesblock()->prepareMessages('install');
|
||||
$session->setStep(STEP_PROFILE);
|
||||
$response->setRedirect("?mode=install&step={$nextStep}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->load('install.database');
|
||||
break;
|
||||
|
||||
case STEP_PROFILE:
|
||||
if (empty($_POST)) {
|
||||
$session->setData('step', $step);
|
||||
$response->setRedirect("?mode=install&step={$nextStep}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->load('install.profile');
|
||||
break;
|
||||
|
||||
case STEP_UNIVERSE:
|
||||
if (empty($_POST)) {
|
||||
$session->setData('step', $step);
|
||||
$response->setRedirect("?mode=install&step={$nextStep}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->load('install.universe');
|
||||
break;
|
||||
|
||||
case STEP_CONFIG:
|
||||
if (empty($_POST)) {
|
||||
$session->setData('step', $step);
|
||||
$response->setRedirect("?mode=install&step={$nextStep}");
|
||||
$response->sendHeaders();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$layout->load('install.config');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'ins':
|
||||
|
|
@ -345,12 +459,4 @@ EOF;
|
|||
die();
|
||||
}
|
||||
|
||||
|
||||
$parse = $lang;
|
||||
$parse['ins_state'] = $page;
|
||||
$parse['ins_page'] = $frame;
|
||||
$parse['dis_ins_btn'] = "?mode=$mode&page=$nextPage";
|
||||
$parse['dpath'] = $dpath;
|
||||
$data = parsetemplate($mainTpl, $parse);
|
||||
|
||||
display($data, "Installeur", false, '', true);
|
||||
echo $layout->render();
|
||||
|
|
|
|||
98
install/upgrade-galaxy.php
Normal file
98
install/upgrade-galaxy.php
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
$galaxyCount = 3;
|
||||
$systemCount = 100;
|
||||
|
||||
$sql = <<<SQL_EOF
|
||||
INSERT INTO `game_galaxy` (`galaxy`, `system`, `planet`, `id_planet`, `metal`, `crystal`, `id_luna`, `luna`)
|
||||
SELECT _increment.galaxy, _increment.system, 0, 0, 0, 0, 0, 0
|
||||
FROM (
|
||||
SELECT _galaxy.galaxy, (1 + _10e0.system + _10e1.system + _10e2.system) system
|
||||
FROM (
|
||||
SELECT 0 AS system
|
||||
UNION ALL
|
||||
SELECT 1 AS system
|
||||
UNION ALL
|
||||
SELECT 2 AS system
|
||||
UNION ALL
|
||||
SELECT 3 AS system
|
||||
UNION ALL
|
||||
SELECT 4 AS system
|
||||
UNION ALL
|
||||
SELECT 5 AS system
|
||||
UNION ALL
|
||||
SELECT 6 AS system
|
||||
UNION ALL
|
||||
SELECT 7 AS system
|
||||
UNION ALL
|
||||
SELECT 8 AS system
|
||||
UNION ALL
|
||||
SELECT 9 AS system
|
||||
) _10e0
|
||||
CROSS JOIN (
|
||||
SELECT 0 AS system
|
||||
UNION ALL
|
||||
SELECT 10 AS system
|
||||
UNION ALL
|
||||
SELECT 20 AS system
|
||||
UNION ALL
|
||||
SELECT 30 AS system
|
||||
UNION ALL
|
||||
SELECT 40 AS system
|
||||
UNION ALL
|
||||
SELECT 50 AS system
|
||||
UNION ALL
|
||||
SELECT 60 AS system
|
||||
UNION ALL
|
||||
SELECT 70 AS system
|
||||
UNION ALL
|
||||
SELECT 80 AS system
|
||||
UNION ALL
|
||||
SELECT 90 AS system
|
||||
) _10e1
|
||||
CROSS JOIN (
|
||||
SELECT 0 AS system
|
||||
UNION ALL
|
||||
SELECT 100 AS system
|
||||
UNION ALL
|
||||
SELECT 200 AS system
|
||||
UNION ALL
|
||||
SELECT 300 AS system
|
||||
UNION ALL
|
||||
SELECT 400 AS system
|
||||
UNION ALL
|
||||
SELECT 500 AS system
|
||||
UNION ALL
|
||||
SELECT 600 AS system
|
||||
UNION ALL
|
||||
SELECT 700 AS system
|
||||
UNION ALL
|
||||
SELECT 800 AS system
|
||||
UNION ALL
|
||||
SELECT 900 AS system
|
||||
) _10e2
|
||||
CROSS JOIN (
|
||||
SELECT 1 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 2 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 3 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 4 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 5 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 6 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 7 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 8 AS galaxy
|
||||
UNION ALL
|
||||
SELECT 9 AS galaxy
|
||||
) _galaxy
|
||||
) _increment
|
||||
|
||||
WHERE _increment.galaxy<={$galaxyCount}
|
||||
AND _increment.system<={$systemCount}
|
||||
SQL_EOF;
|
||||
|
||||
16
overview.php
16
overview.php
|
|
@ -44,18 +44,10 @@ if (isset($_POST) && !empty($_POST)) {
|
|||
if ($formKey == Wootook::getSession('security')->getData('form_key')) {
|
||||
if ($action == 'rename' && isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
$planet->setData('name', $_POST['name'])->save();
|
||||
|
||||
header('302 Found');
|
||||
header('Location: ' . basename(__FILE__));
|
||||
exit(0);
|
||||
} else if ($action == 'destroy' && isset($_POST['password']) && !empty($_POST['password']) && isset($_POST['confirm'])) {
|
||||
if (!$user->checkPassword($_POST['password'])) {
|
||||
Wootook::getSession('user')
|
||||
->addError(Wootook::__('Password was not correct.'));
|
||||
|
||||
header('302 Found');
|
||||
header('Location: ' . basename(__FILE__));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -67,15 +59,15 @@ if (isset($_POST) && !empty($_POST)) {
|
|||
Wootook::getSession('user')
|
||||
->addError($e->getMessage());
|
||||
}
|
||||
|
||||
header('302 Found');
|
||||
header('Location: ' . basename(__FILE__));
|
||||
exit(0);
|
||||
}
|
||||
} else {
|
||||
Wootook::getSession('user')
|
||||
->addError(Wootook::__('Invalid security key.'));
|
||||
}
|
||||
|
||||
header('HTTP/1.1 302 Found');
|
||||
header('Location: ' . Wootook::getUrl(basename(__FILE__)));
|
||||
exit(0);
|
||||
} else if ($action == 'rename') {
|
||||
$layout = new Wootook_Core_Layout();
|
||||
$layout->load('overview.rename-planet');
|
||||
|
|
|
|||
|
|
@ -280,12 +280,3 @@ a:hover
|
|||
{
|
||||
margin-top : 10px;
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-size : 14px;
|
||||
font-family : Tahoma,sans-serif;
|
||||
border-bottom : 0px #344566; solid;
|
||||
width : 98%;
|
||||
text-align : center;
|
||||
}
|
||||
|
|
@ -1,5 +1,19 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
* {font-size:10px;font-family:Arial,Tahoma,sans-serif;text-align:left;}
|
||||
h1 {font-size:2em;border:#6AB 0 solid;border-width:1px 10px;border-radius:20px;text-align:center;color:#156;background:#EEE;}
|
||||
h1:hover {color:#6AB;background:#CCC;}
|
||||
h2,h3 {text-decoration:underline;font-weight:bold;}
|
||||
h4,h5,h6 {font-style:italic;}
|
||||
h2 {font-size:2em;}
|
||||
h3 {font-size:2em;}
|
||||
h4 {font-size:2em;}
|
||||
h5 {font-size:2em;}
|
||||
h6 {font-size:2em;}
|
||||
|
||||
input[type=text] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;}
|
||||
input[type=submit] {height:2em;border:#156 0 solid;border-width:.1em 1em;border-radius:.9em;}
|
||||
|
||||
.global .content .navigation {margin:0pt auto;width:1000px;height:30px;display:block;padding:0 40px;position:relative;border-width:0 1px;border-style:none solid;border-color:#FFF;background-color:#933;border-radius:10px;}
|
||||
.global .content .navigation .navigation-node {margin:0;height:30px;width:250px;color:#FFF;float:left;}
|
||||
.global .content .navigation .navigation-node .title {margin:5px 20px;font-size:1.5em;}
|
||||
|
|
@ -39,13 +53,15 @@
|
|||
.global .content .item-list .item {width:780px;margin:0 10px;border:0;box-shadow:none;border-radius:0;}
|
||||
.global .content .item-list .item,.global .content .item-list .item * {color:#000;}
|
||||
|
||||
.global .content form.registration {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
|
||||
.global .content form.registration h1 {font-size:2em;}
|
||||
.global .content form.registration fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;}
|
||||
.global .content form.registration fieldset legend {font-size:1.2em;font-weight:bold;}
|
||||
.global .content form.registration fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;}
|
||||
.global .content form.registration input {width:150px;display:block;margin:10px auto;}
|
||||
.global .content form.registration fieldset p input {width:100px;display:block;}
|
||||
.global .content form.form {background:#FFF;width:300px;margin:10px auto;padding:10px 0;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
|
||||
.global .content form.form h1 {font-size:2em;}
|
||||
.global .content form.form fieldset {margin:20px 30px;width:220px;border:1px solid #000;padding:4px 9px;}
|
||||
.global .content form.form fieldset legend {font-size:1.2em;font-weight:bold;}
|
||||
.global .content form.form fieldset p label {width:100px;display:block;float:left;margin:0 10px;text-align:right;}
|
||||
.global .content form.form input {width:150px;display:block;margin:10px auto;}
|
||||
.global .content form.form fieldset p input {width:100px;display:block;}
|
||||
|
||||
.global .content .install {background:#FFF;width:600px;margin:10px auto;padding:20px;border-radius:20px;box-shadow:0 -4px 8px #115566 inset, 20px 20px 40px #115566, -20px 20px 40px #115566, 0 -20px 40px #115566;}
|
||||
|
||||
/**
|
||||
* Galaxy user name display colors
|
||||
|
|
|
|||
2
stat.php
2
stat.php
|
|
@ -90,7 +90,7 @@ require_once dirname(__FILE__) .'/application/bootstrap.php';
|
|||
}
|
||||
|
||||
if ($who == 2) {
|
||||
$MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}} WHERE 1;", 'alliance', true);
|
||||
$MaxAllys = doquery ("SELECT COUNT(*) AS `count` FROM {{table}}", 'alliance', true);
|
||||
if ($MaxAllys['count'] > 100) {
|
||||
$LastPage = floor($MaxAllys['count'] / 100);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue