diff --git a/admin/ShowFlyingFleets.php b/admin/ShowFlyingFleets.php index 89f1eb1..828246e 100644 --- a/admin/ShowFlyingFleets.php +++ b/admin/ShowFlyingFleets.php @@ -33,18 +33,18 @@ define('INSTALL' , false); define('IN_ADMIN', true); require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; - if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - includeLang('admin/fleets'); - $PageTPL = gettemplate('admin/fleet_body'); +include(ROOT_PATH . 'includes/functions/BuildFlyingFleetTable.'.PHPEXT); - $parse = $lang; - $parse['flt_table'] = BuildFlyingFleetTable (); +if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { + includeLang('admin/fleets'); + $PageTPL = gettemplate('admin/fleet_body'); - $page = parsetemplate( $PageTPL, $parse ); - display ( $page, $lang['flt_title'], false, '', true); + $parse = $lang; + $parse['flt_table'] = BuildFlyingFleetTable (); - } else { - AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); - } + $page = parsetemplate( $PageTPL, $parse ); + display ( $page, $lang['flt_title'], false, '', true); -?> \ No newline at end of file +} else { + AdminMessage ( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); +} diff --git a/admin/leftmenu.php b/admin/leftmenu.php index 180034a..40c0a0d 100644 --- a/admin/leftmenu.php +++ b/admin/leftmenu.php @@ -36,13 +36,13 @@ require_once dirname(dirname(__FILE__)) .'/application/bootstrap.php'; includeLang('leftmenu'); if (in_array($user['authlevel'], array(LEVEL_ADMIN, LEVEL_OPERATOR, LEVEL_MODERATOR))) { - $parse = $lang; - $parse['mf'] = "Hauptframe"; - $parse['dpath'] = $dpath; + $parse = $lang; + $parse['mf'] = "Hauptframe"; + $parse['dpath'] = $dpath; $parse['WootookRelease'] = VERSION; - $parse['servername'] = Wootook; - $Page = parsetemplate(gettemplate('admin/left_menu'), $parse); - display( $Page, "", false, '', true); + $parse['servername'] = 'Wootook'; + $Page = parsetemplate(gettemplate('admin/left_menu'), $parse); + display($Page, "", false, '', true); } else { message( $lang['sys_noalloaw'], $lang['sys_noaccess'] ); } diff --git a/application/bootstrap.php b/application/bootstrap.php index fd5a0f1..abd1b68 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -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,43 +97,46 @@ include(ROOT_PATH . 'language/' . DEFAULT_LANG . '/lang_info.cfg'); include(ROOT_PATH . 'includes/vars.' . PHPEXT); include(ROOT_PATH . 'includes/strings.' . PHPEXT); -$gameConfig = Wootook_Core_Model_Config::getSingleton(); -if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) { - Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']); -} -$user = Wootook_Empire_Model_User::getSingleton(); +if (!defined('IN_INSTALL')) { -if (!defined('DISABLE_IDENTITY_CHECK')) { - if (($user === null || !$user->getId())) { - header('Location: login.php'); - exit(0); + $gameConfig = Wootook_Core_Model_Config::getSingleton(); + if (isset($gameConfig['cookie_name']) && !empty($gameConfig['cookie_name'])) { + Wootook_Empire_Model_User::setCookieName($gameConfig['cookie_name']); + } + $user = Wootook_Empire_Model_User::getSingleton(); + + if (!defined('DISABLE_IDENTITY_CHECK')) { + if (($user === null || !$user->getId())) { + header('Location: login.php'); + exit(0); + } + + if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) { + message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name')); + exit(0); + } } - if ($gameConfig->isEnabled() && $user !== null && !in_array($user->getData('authlevel'), array(LEVEL_ADMIN, LEVEL_MODERATOR, LEVEL_OPERATOR))) { - message(stripslashes($gameConfig->getData('close_reason')), $gameConfig->getData('game_name')); - exit(0); + includeLang('system'); + includeLang('tech'); + + if (($user !== null && $user->getId())) { + if (isset($_GET['cp']) && !empty($_GET['cp'])) { + $user->updateCurrentPlanet((int) $_GET['cp']); + } + + $planet = $user->getCurrentPlanet(); + + foreach ($user->getPlanetCollection() as $userPlanet) { + FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model + } + + /* + * Update planet resources and constructions + */ + Wootook::dispatchEvent('planet.update', array( + 'planet' => $planet + )); + $planet->save(); } -} - -includeLang('system'); -includeLang('tech'); - -if (($user !== null && $user->getId())) { - if (isset($_GET['cp']) && !empty($_GET['cp'])) { - $user->updateCurrentPlanet((int) $_GET['cp']); - } - - $planet = $user->getCurrentPlanet(); - - foreach ($user->getPlanetCollection() as $userPlanet) { - FlyingFleetHandler($userPlanet); // TODO: implement logic into a refactored model - } - - /* - * Update planet resources and constructions - */ - Wootook::dispatchEvent('planet.update', array( - 'planet' => $planet - )); - $planet->save(); } \ No newline at end of file diff --git a/application/code/core/Wootook.php b/application/code/core/Wootook.php index 4197254..1e58ee0 100644 --- a/application/code/core/Wootook.php +++ b/application/code/core/Wootook.php @@ -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; } } \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Block/Messages.php b/application/code/core/Wootook/Core/Block/Messages.php new file mode 100644 index 0000000..a214dec --- /dev/null +++ b/application/code/core/Wootook/Core/Block/Messages.php @@ -0,0 +1,43 @@ +_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 = '
'; + + return $output; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Controller/Request/Http.php b/application/code/core/Wootook/Core/Controller/Request/Http.php index 611294f..db84156 100644 --- a/application/code/core/Wootook/Core/Controller/Request/Http.php +++ b/application/code/core/Wootook/Core/Controller/Request/Http.php @@ -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') { diff --git a/application/code/core/Wootook/Core/Controller/Response/Http.php b/application/code/core/Wootook/Core/Controller/Response/Http.php index 2e4ffcd..442759a 100644 --- a/application/code/core/Wootook/Core/Controller/Response/Http.php +++ b/application/code/core/Wootook/Core/Controller/Response/Http.php @@ -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(); diff --git a/application/code/core/Wootook/Core/Form.php b/application/code/core/Wootook/Core/Form.php new file mode 100644 index 0000000..6c7aec1 --- /dev/null +++ b/application/code/core/Wootook/Core/Form.php @@ -0,0 +1,175 @@ +_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)); + } + } + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Field/Text.php b/application/code/core/Wootook/Core/Form/Field/Text.php new file mode 100644 index 0000000..e70f30b --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Field/Text.php @@ -0,0 +1,11 @@ +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; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/FieldLoader.php b/application/code/core/Wootook/Core/Form/FieldLoader.php new file mode 100644 index 0000000..06fa14d --- /dev/null +++ b/application/code/core/Wootook/Core/Form/FieldLoader.php @@ -0,0 +1,36 @@ +_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; + } + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Alnum.php b/application/code/core/Wootook/Core/Form/Validator/Alnum.php new file mode 100644 index 0000000..6b6515b --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Alnum.php @@ -0,0 +1,22 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should only contain alphanumeric characters.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Alpha.php b/application/code/core/Wootook/Core/Form/Validator/Alpha.php new file mode 100644 index 0000000..1e0920b --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Alpha.php @@ -0,0 +1,22 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should only contain alphabetic characters.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Email.php b/application/code/core/Wootook/Core/Form/Validator/Email.php new file mode 100644 index 0000000..7dbb232 --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Email.php @@ -0,0 +1,21 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should contain an email.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/FormKey.php b/application/code/core/Wootook/Core/Form/Validator/FormKey.php new file mode 100644 index 0000000..0d3c0ff --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/FormKey.php @@ -0,0 +1,20 @@ +getForm(); + $session = $form->getSession(); + + if ($session->getFormKey(false) == $data) { + return true; + } + + $this->_getSession($field) + ->addError('CSRF token failure.', $field->getName()); + + return false; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Hex.php b/application/code/core/Wootook/Core/Form/Validator/Hex.php new file mode 100644 index 0000000..9025b70 --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Hex.php @@ -0,0 +1,22 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should only contain numeric characters.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Host.php b/application/code/core/Wootook/Core/Form/Validator/Host.php new file mode 100644 index 0000000..270124e --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Host.php @@ -0,0 +1,21 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should contain a host name.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Numeric.php b/application/code/core/Wootook/Core/Form/Validator/Numeric.php new file mode 100644 index 0000000..cd2fd56 --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Numeric.php @@ -0,0 +1,22 @@ +_validate($field, $data)) { + $this->_getSession($field) + ->addError('Field "%s" should only contain numeric characters.', $field->getName()); + + return false; + } + return true; + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/Validator/Regex.php b/application/code/core/Wootook/Core/Form/Validator/Regex.php new file mode 100644 index 0000000..a2d76e5 --- /dev/null +++ b/application/code/core/Wootook/Core/Form/Validator/Regex.php @@ -0,0 +1,28 @@ +_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); + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/ValidatorAbstract.php b/application/code/core/Wootook/Core/Form/ValidatorAbstract.php new file mode 100644 index 0000000..5f7239b --- /dev/null +++ b/application/code/core/Wootook/Core/Form/ValidatorAbstract.php @@ -0,0 +1,15 @@ +getForm(); + if (!$form instanceof Wootook_Core_Form) { + return null; + } + return $form->getSession(); + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Form/ValidatorLoader.php b/application/code/core/Wootook/Core/Form/ValidatorLoader.php new file mode 100644 index 0000000..f95d439 --- /dev/null +++ b/application/code/core/Wootook/Core/Form/ValidatorLoader.php @@ -0,0 +1,36 @@ +_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; + } + } +} \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Layout.php b/application/code/core/Wootook/Core/Layout.php index 5b4f179..15297d9 100644 --- a/application/code/core/Wootook/Core/Layout.php +++ b/application/code/core/Wootook/Core/Layout.php @@ -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; + } } \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Model/Config/Abstract.php b/application/code/core/Wootook/Core/Model/Config/Abstract.php index ebebf65..ef946a8 100644 --- a/application/code/core/Wootook/Core/Model/Config/Abstract.php +++ b/application/code/core/Wootook/Core/Model/Config/Abstract.php @@ -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'; diff --git a/application/code/core/Wootook/Core/Model/Session.php b/application/code/core/Wootook/Core/Model/Session.php index 5199542..62f0455 100644 --- a/application/code/core/Wootook/Core/Model/Session.php +++ b/application/code/core/Wootook/Core/Model/Session.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; + } } \ No newline at end of file diff --git a/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php b/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php index 211f572..37b4da1 100644 --- a/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php +++ b/application/code/core/Wootook/Core/Plugin/LoaderAbstract.php @@ -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) { diff --git a/application/code/core/Wootook/Core/Time.php b/application/code/core/Wootook/Core/Time.php index 069867c..62b9952 100644 --- a/application/code/core/Wootook/Core/Time.php +++ b/application/code/core/Wootook/Core/Time.php @@ -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); } diff --git a/application/code/core/Wootook/Core/View.php b/application/code/core/Wootook/Core/View.php index e7b0cc6..1c75663 100644 --- a/application/code/core/Wootook/Core/View.php +++ b/application/code/core/Wootook/Core/View.php @@ -142,7 +142,16 @@ class Wootook_Core_View $theme = Wootook_Core_Layout::DEFAULT_THEME; } - return Wootook::getSkinUrl($package, $theme, $uri, $params); + $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) diff --git a/application/code/core/Wootook/Empire/Model/Planet.php b/application/code/core/Wootook/Empire/Model/Planet.php index c013667..7cf15bb 100644 --- a/application/code/core/Wootook/Empire/Model/Planet.php +++ b/application/code/core/Wootook/Empire/Model/Planet.php @@ -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,10 +180,14 @@ class Wootook_Empire_Model_Planet public function getGalaxyData() { - $entity = new Wootook_Empire_Model_Galaxy_Position(); - $entity->load(array('id_planet' => $this->getId())); + if ($this->isPlanet()) { + $entity = new Wootook_Empire_Model_Galaxy_Position(); + $entity->load(array('id_planet' => $this->getId())); - return $entity; + return $entity; + } + + return $this->getPlanet()->getGalaxyData(); } public function updateStorages($time = null) @@ -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); diff --git a/application/code/core/Wootook/Empire/Model/User.php b/application/code/core/Wootook/Empire/Model/User.php index f96fd60..b7bb9e8 100644 --- a/application/code/core/Wootook/Empire/Model/User.php +++ b/application/code/core/Wootook/Empire/Model/User.php @@ -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')); + } } } \ No newline at end of file diff --git a/application/design/base/default/layouts/admin.php b/application/design/base/default/layouts/admin.php new file mode 100644 index 0000000..9e6ebdd --- /dev/null +++ b/application/design/base/default/layouts/admin.php @@ -0,0 +1,243 @@ + 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/' + ) + ) + ) + ) + ) + ) + ) + ) + ); diff --git a/application/design/base/default/layouts/empire.php b/application/design/base/default/layouts/empire.php index 6c8391a..e6f34d2 100644 --- a/application/design/base/default/layouts/empire.php +++ b/application/design/base/default/layouts/empire.php @@ -2,287 +2,293 @@ 'empire' => array( 'update' => '1column', 'reference' => array( - 'navigation' => array( - 'actions' => array( - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'development', - 'title' => 'Development' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/overview', - 'label' => 'Overview', - 'title' => 'Overview', - 'uri' => 'overview.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/buildings', - 'label' => 'Buildings', - 'title' => 'Buildings', - 'uri' => 'buildings.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/research-lab', - 'label' => 'Research Lab', - 'title' => 'Research Lab', - 'uri' => 'buildings.php', - 'params' => array( - 'mode' => 'research' + 'content' => array( + 'children' => array( + 'navigation' => array( + 'type' => 'core/html.navigation', + 'template' => 'page/html/navigation.phtml', + 'actions' => array( + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'development', + 'title' => 'Development' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/overview', + 'label' => 'Overview', + 'title' => 'Overview', + 'uri' => 'overview.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/buildings', + 'label' => 'Buildings', + 'title' => 'Buildings', + 'uri' => 'buildings.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/research-lab', + 'label' => 'Research Lab', + 'title' => 'Research Lab', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'research' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/shipyard', + 'label' => 'Shipyard', + 'title' => 'Shipyard', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'fleet' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/defenses', + 'label' => 'Defenses', + 'title' => 'Defenses', + 'uri' => 'buildings.php', + 'params' => array( + 'mode' => 'defense' + ) + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/officers', + 'label' => 'Officers', + 'title' => 'Officers', + 'uri' => 'officier.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'navigation', + 'title' => 'Navigation' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/alliance', + 'label' => 'Alliance', + 'title' => 'Alliance', + 'uri' => 'alliance.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/fleet', + 'label' => 'Fleet', + 'title' => 'Fleet', + 'uri' => 'fleet.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/galaxy', + 'label' => 'Galaxy', + 'title' => 'Galaxy', + 'uri' => 'galaxy.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/empire', + 'label' => 'Empire', + 'title' => 'Empire', + 'uri' => 'imperium.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/resources', + 'label' => 'Resources Production', + 'title' => 'Resources Production', + 'uri' => 'resources.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'development/retailer', + 'label' => 'Retailer', + 'title' => 'Retailer', + 'uri' => 'marchand.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'navigation/tech-tree', + 'label' => 'Technology Tree', + 'title' => 'Technology Tree', + 'uri' => 'techtree.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'tools', + 'title' => 'Tools' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/messages', + 'label' => 'Messages', + 'title' => 'Messages', + 'uri' => 'messages.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/records', + 'label' => 'Records', + 'title' => 'Records', + 'uri' => 'records.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/statistics', + 'label' => 'Stats', + 'title' => 'Stats', + 'uri' => 'stat.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/banned', + 'label' => 'Banned Players', + 'title' => 'Banned Players', + 'uri' => 'banned.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/announcement', + 'label' => 'Announcements', + 'title' => 'Announcements', + 'uri' => 'annonce.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/notes', + 'label' => 'Note Pad', + 'title' => 'Note Pad', + 'uri' => 'notes.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/options', + 'label' => 'Account Options', + 'title' => 'Account Options', + 'uri' => 'options.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'tools/logout', + 'label' => 'Log Out', + 'title' => 'Log Out', + 'uri' => 'logout.php' + ) + ), + array( + 'method' => 'setNodeTitle', + 'params' => array( + 'path' => 'community', + 'title' => 'Community' + ) + ), + array( + 'method' => 'addExternalLink', + 'params' => array( + 'name' => 'community/board', + 'label' => 'Forum board', + 'title' => 'Forum board', + 'url' => 'http://www.wootook.org/' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/search-player', + 'label' => 'Search Player', + 'title' => 'Search Player', + 'uri' => 'search.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/chat', + 'label' => 'Chat', + 'title' => 'Chat', + 'uri' => 'chat.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/multi', + 'label' => 'Declare Multi-account', + 'title' => 'Declare Multi-account', + 'uri' => 'delclare_multi.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/rules', + 'label' => 'Rules', + 'title' => 'Rules', + 'uri' => 'rules.php' + ) + ), + array( + 'method' => 'addLink', + 'params' => array( + 'name' => 'community/contact', + 'label' => 'Contact Admin', + 'title' => 'Contact Admin', + 'uri' => 'contact.php' + ) ) ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/shipyard', - 'label' => 'Shipyard', - 'title' => 'Shipyard', - 'uri' => 'buildings.php', - 'params' => array( - 'mode' => 'fleet' - ) - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/defenses', - 'label' => 'Defenses', - 'title' => 'Defenses', - 'uri' => 'buildings.php', - 'params' => array( - 'mode' => 'defense' - ) - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/officers', - 'label' => 'Officers', - 'title' => 'Officers', - 'uri' => 'officers.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'navigation', - 'title' => 'Navigation' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/alliance', - 'label' => 'Alliance', - 'title' => 'Alliance', - 'uri' => 'alliance.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/fleet', - 'label' => 'Fleet', - 'title' => 'Fleet', - 'uri' => 'fleet.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/galaxy', - 'label' => 'Galaxy', - 'title' => 'Galaxy', - 'uri' => 'galaxy.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/empire', - 'label' => 'Empire', - 'title' => 'Empire', - 'uri' => 'imperium.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/resources', - 'label' => 'Resources Production', - 'title' => 'Resources Production', - 'uri' => 'resources.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'development/retailer', - 'label' => 'Retailer', - 'title' => 'Retailer', - 'uri' => 'marchand.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'navigation/tech-tree', - 'label' => 'Technology Tree', - 'title' => 'Technology Tree', - 'uri' => 'techtree.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'tools', - 'title' => 'Tools' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/messages', - 'label' => 'Messages', - 'title' => 'Messages', - 'uri' => 'messages.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/records', - 'label' => 'Records', - 'title' => 'Records', - 'uri' => 'records.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/statistics', - 'label' => 'Stats', - 'title' => 'Stats', - 'uri' => 'stat.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/banned', - 'label' => 'Banned Players', - 'title' => 'Banned Players', - 'uri' => 'banned.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/announcement', - 'label' => 'Announcements', - 'title' => 'Announcements', - 'uri' => 'annonce.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/notes', - 'label' => 'Note Pad', - 'title' => 'Note Pad', - 'uri' => 'notes.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/options', - 'label' => 'Account Options', - 'title' => 'Account Options', - 'uri' => 'options.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'tools/logout', - 'label' => 'Log Out', - 'title' => 'Log Out', - 'uri' => 'logout.php' - ) - ), - array( - 'method' => 'setNodeTitle', - 'params' => array( - 'path' => 'community', - 'title' => 'Community' - ) - ), - array( - 'method' => 'addExternalLink', - 'params' => array( - 'name' => 'community/board', - 'label' => 'Forum board', - 'title' => 'Forum board', - 'url' => 'http://www.wootook.org/' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'community/search-player', - 'label' => 'Search Player', - 'title' => 'Search Player', - 'uri' => 'search.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'community/chat', - 'label' => 'Chat', - 'title' => 'Chat', - 'uri' => 'chat.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'community/multi', - 'label' => 'Declare Multi-account', - 'title' => 'Declare Multi-account', - 'uri' => 'delclare_multi.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'community/rules', - 'label' => 'Rules', - 'title' => 'Rules', - 'uri' => 'rules.php' - ) - ), - array( - 'method' => 'addLink', - 'params' => array( - 'name' => 'community/contact', - 'label' => 'Contact Admin', - 'title' => 'Contact Admin', - 'uri' => 'contact.php' - ) ) ) ) diff --git a/application/design/base/default/layouts/page.php b/application/design/base/default/layouts/page.php index 32b0013..9f0a95d 100644 --- a/application/design/base/default/layouts/page.php +++ b/application/design/base/default/layouts/page.php @@ -1,16 +1,6 @@ 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' ) ) ) diff --git a/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml b/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml index 45ba7da..94f0148 100644 --- a/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml +++ b/application/design/base/default/scripts/empire/overview/form/rename-planet.phtml @@ -1,10 +1,16 @@ - \ No newline at end of file diff --git a/application/design/base/default/scripts/user/registration.phtml b/application/design/base/default/scripts/user/registration.phtml index 50b9876..f141946 100644 --- a/application/design/base/default/scripts/user/registration.phtml +++ b/application/design/base/default/scripts/user/registration.phtml @@ -1,4 +1,4 @@ -