From: Roland Haeder Date: Sun, 22 Mar 2015 20:21:22 +0000 (+0100) Subject: Renamed 'ship-simu' to 'shipsimu' + added 'core' and symlink to core/inc X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=commitdiff_plain;h=02a6b02f96d2193d2161e70477bf8f18a199389f Renamed 'ship-simu' to 'shipsimu' + added 'core' and symlink to core/inc Signed-off-by: Roland Haeder --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7b054c7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "core"] + path = core + url = git://git.mxchange.org/core.git diff --git a/application/ship-simu/.htaccess b/application/ship-simu/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/admin/.htaccess b/application/ship-simu/admin/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/admin/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php deleted file mode 100644 index 7000c38..0000000 --- a/application/ship-simu/class_ApplicationHelper.php +++ /dev/null @@ -1,227 +0,0 @@ - - * @version 0.0 - * @copyright Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication, Registerable { - /** - * The version number of this application - */ - private $appVersion = ''; - - /** - * The human-readable name for this application - */ - private $appName = ''; - - /** - * The short uni*-like name for this application - */ - private $shortName = ''; - - /** - * An instance of this class - */ - private static $selfInstance = NULL; - - /** - * Private constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Getter for an instance of this class - * - * @return $selfInstance An instance of this class - */ - public static final function getSelfInstance () { - // Is the instance there? - if (is_null(self::$selfInstance)) { - self::$selfInstance = new ApplicationHelper(); - } // END - if - - // Return the instance - return self::$selfInstance; - } - - /** - * Getter for the version number - * - * @return $appVersion The application's version number - */ - public final function getAppVersion () { - return $this->appVersion; - } - /** - * Setter for the version number - * - * @param $appVersion The application's version number - * @return void - */ - public final function setAppVersion ($appVersion) { - // Cast and set it - $this->appVersion = (string) $appVersion; - } - - /** - * Getter for human-readable name - * - * @return $appName The application's human-readable name - */ - public final function getAppName () { - return $this->appName; - } - - /** - * Setter for human-readable name - * - * @param $appName The application's human-readable name - * @return void - */ - public final function setAppName ($appName) { - // Cast and set it - $this->appName = (string) $appName;; - } - - /** - * Getter for short uni*-like name - * - * @return $shortName The application's short uni*-like name - */ - public final function getAppShortName () { - return $this->shortName; - } - - /** - * Setter for short uni*-like name - * - * @param $shortName The application's short uni*-like name - * @return void - */ - public final function setAppShortName ($shortName) { - // Cast and set it - $this->shortName = (string) $shortName; - } - - /** - * Launches the application - * - * @return void - */ - public final function entryPoint () { - // Set this application in registry - Registry::getRegistry()->addInstance('app', $this); - - // Default response is console - $response = $this->getResponseTypeFromSystem(); - $responseType = $this->getResponseTypeFromSystem(); - - // Create a new request object - $requestInstance = ObjectFactory::createObjectByName($this->convertToClassName($response) . 'Request'); - - // Remember request instance here - $this->setRequestInstance($requestInstance); - - // Do we have another response? - if ($requestInstance->isRequestElementSet('request')) { - // Then use it - $response = strtolower($requestInstance->getRequestElement('request')); - $responseType = $response; - } // END - if - - // ... and a new response object - $responseClass = sprintf("%sResponse", $this->convertToClassName($response)); - $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this)); - - // Remember response instance here - $this->setResponseInstance($responseInstance); - - // Get the parameter from the request - $commandName = $requestInstance->getRequestElement('command'); - - // If it is null then get default command - if (is_null($commandName)) { - // Get default command - $commandName = $responseInstance->getDefaultCommand(); - - // Set it in request - $requestInstance->setRequestElement('command', $commandName); - } // END - if - - // Get a controller resolver - $resolverClass = $this->convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver'); - $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this)); - - // Get a controller instance as well - $this->setControllerInstance($resolverInstance->resolveController()); - - // Launch the main routine here - $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance); - } - - /** - * Handle the indexed array of fatal messages and puts them out in an - * acceptable fasion - * - * @param $messageList An array of fatal messages - * @return void - */ - public function handleFatalMessages (array $messageList) { - // Walk through all messages - foreach ($messageList as $message) { - exit(__METHOD__ . ':MSG:' . $message); - } // END - foreach - } - - /** - * Builds the master template's name - * - * @return $masterTemplateName Name of the master template - */ - public function buildMasterTemplateName () { - return 'node_main'; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php deleted file mode 100644 index b37151f..0000000 --- a/application/ship-simu/config.php +++ /dev/null @@ -1,539 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Get a configuration instance for shorter lines -$cfg = FrameworkConfiguration::getSelfInstance(); - -// CFG: HEADER-CHARSET -$cfg->setConfigEntry('header_charset', 'utf-8'); - -// CFG: DEFAULT-WEB-COMMAND -$cfg->setConfigEntry('default_web_command', 'home'); - -// CFG: DEFAULT-IMAGE-COMMAND -$cfg->setConfigEntry('default_image_command', 'build'); - -// CFG: FORM-ACTION -$cfg->setConfigEntry('form_action', 'index.php?app={?app_short_name?}&page=do_form'); - -// CFG: FORM-METHOD -$cfg->setConfigEntry('form_method', 'post'); - -// CFG: FORM-TARGET -$cfg->setConfigEntry('form_target', '_self'); - -// CFG: REGISTER-REQUIRES-EMAIL -$cfg->setConfigEntry('register_requires_email', 'Y'); - -// CFG: REGISTER-INCLUDES-PROFILE -$cfg->setConfigEntry('register_includes_profile', 'Y'); - -// CFG: REGISTER-PERSONAL-DATA -$cfg->setConfigEntry('register_personal_data', 'Y'); - -// CFG: REGISTER-EMAIL-UNIQUE -$cfg->setConfigEntry('register_email_unique', 'Y'); - -// CFG: PROFILE-INCLUDES-BIRTHDAY -$cfg->setConfigEntry('profile_includes_birthday', 'Y'); - -// CFG: CHAT-ENABLED-ICQ -$cfg->setConfigEntry('chat_enabled_icq', 'Y'); - -// CFG: CHAT-ENABLED-JABBER -$cfg->setConfigEntry('chat_enabled_jabber', 'Y'); - -// CFG: CHAT-ENABLED-YAHOO -$cfg->setConfigEntry('chat_enabled_yahoo', 'Y'); - -// CFG: CHAT-ENABLED-AOL -$cfg->setConfigEntry('chat_enabled_aol', 'Y'); - -// CFG: CHAT-ENABLED-MSN -$cfg->setConfigEntry('chat_enabled_msn', 'Y'); - -// CFG: USER-REGISTRATION -$cfg->setConfigEntry('user_registration_class', 'ShipSimuRegistration'); - -// CFG: USER-LOGIN-CLASS -$cfg->setConfigEntry('user_login_class', 'ShipSimuUserLogin'); - -// CFG: GUEST-LOGIN-CLASS -$cfg->setConfigEntry('guest_login_class', 'ShipSimuGuestLogin'); - -// CFG: USER-STATUS-REGISTER -$cfg->setConfigEntry('user_status_unconfirmed', 'UNCONFIRMED'); - -// CFG: USER-STATUS-GUEST -$cfg->setConfigEntry('user_status_guest', 'GUEST'); - -// CFG: USER-STATUS-CONFIRMED -$cfg->setConfigEntry('user_status_confirmed', 'CONFIRMED'); - -// CFG: USER-STATUS-LOCKED -$cfg->setConfigEntry('user_status_locked', 'LOCKED'); - -// CFG: LOGIN-HELPER-CLASS -$cfg->setConfigEntry('login_helper_class', 'ShipSimuLoginHelper'); - -// CFG: AUTH-METHOD-CLASS -$cfg->setConfigEntry('auth_method_class', 'CookieAuth'); - -// CFG: APP-LOGIN-URL -$cfg->setConfigEntry('app_login_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: LOGIN-FAILED-URL -$cfg->setConfigEntry('login_failed_url', 'index.php?app={?app_short_name?}&page=login_failed'); - -// CFG: LOGIN-FAILED-LOGIN-RETRY-ACTION-URL -$cfg->setConfigEntry('login_failed_login_retry_action_url', 'index.php?app={?app_short_name?}&page=login&note=login_failed'); - -// CFG: LOGOUT-DONE-URL -$cfg->setConfigEntry('logout_done_url', 'index.php?app={?app_short_name?}&page=logout_done'); - -// CFG: ACTION-STATUS-PROBLEM -$cfg->setConfigEntry('action_status_problem', 'status_problem'); - -// CFG: LOGIN-USER-STATUS-URL -$cfg->setConfigEntry('login_user_status_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=status_problem&status=general'); - -// CFG: LOGIN-USER-STATUS-GUEST-URL -$cfg->setConfigEntry('login_user_status_guest_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=status_problem&status=guest'); - -// CFG: USER-NOT-UNCONFIRMED-URL -$cfg->setConfigEntry('user_not_unconfirmed_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=unconfirmed_problem'); - -// CFG: USER-UNCONFIRMED-EMAIL-MISSING-URL -$cfg->setConfigEntry('user_unconfirmed_email_missing_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=unconfirmed_email_missing'); - -// CFG: CONFIRM-CODE-INVALID-URL -$cfg->setConfigEntry('confirm_code_invalid_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=confirm_code_invalid'); - -// CFG: USER-NOT-FOUND-URL -$cfg->setConfigEntry('user_not_found_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=user_not_found'); - -// CFG: LOGIN-GOVERNMENT-STARTUP-FAILED-URL -$cfg->setConfigEntry('login_government_startup_failed_url', 'index.php?app={?app_short_name?}&page=government_failed&failed=startup'); - -// CFG: LOGIN-GOVERNMENT-TRAINING-FAILED-URL -$cfg->setConfigEntry('login_government_training_failed_url', 'index.php?app={?app_short_name?}&page=government_failed&failed=training'); - -// CFG: REFILL-PAGE-CURRENCY-DONE-URL -$cfg->setConfigEntry('refill_page_done_url', 'index.php?app={?app_short_name?}&page=login_area&status=refill_done&done={?refill_done?}&amount={?amount?}'); - -// CFG: LOGIN-DEFAULT-ACTION -$cfg->setConfigEntry('login_default_action', 'welcome'); - -// CFG: LOGIN-AREA-LOGOUT-ACTION-URL -$cfg->setConfigEntry('login_area_logout_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: GOVERNMENT-FAILED-LOGOUT-ACTION-URL -$cfg->setConfigEntry('government_failed_logout_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: LOGIN-AREA-PROFILE-ACTION-URL -$cfg->setConfigEntry('login_area_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&status=profile'); - -// CFG: GOVERNMENT-FAILED-PROFILE-ACTION-URL -$cfg->setConfigEntry('government_failed_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&status=profile'); - -// CFG: LOGIN-AREA-COMPANY-ACTION-URL -$cfg->setConfigEntry('login_area_company_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: GOVERNMENT-FAILED-COMPANY-ACTION-URL -$cfg->setConfigEntry('government_failed_company_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: LOGIN-AREA-LIST-COMPANIES-ACTION-URL -$cfg->setConfigEntry('login_area_list_companies_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: LOGIN-AREA-LOGOUT-NOW-ACTION-URL -$cfg->setConfigEntry('login_area_logout_now_action_url', 'index.php?app={?app_short_name?}&page=logout'); - -// CFG: LOGIN-AREA-RETURN-LOGIN-ACTION-URL -$cfg->setConfigEntry('login_area_return_login_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: LOGIN-AREA-SHIPSIMU-PROFILE-ACTION-URL -$cfg->setConfigEntry('login_area_shipsimu_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&action=profile'); - -// CFG: LOGOUT_DONE-RELOGIN-ACTION-URL -$cfg->setConfigEntry('logout_done_relogin_action_url', 'index.php?app={?app_short_name?}&page=login'); - -// CFG: LOGIN-REGISTER-ACTION-URL -$cfg->setConfigEntry('login_register_action_url', 'index.php?app={?app_short_name?}&page=register'); - -// CFG: CONFIRM-DIRECT-LOGIN-ACTION-URL -$cfg->setConfigEntry('confirm_direct_login_action_url', 'index.php?app={?app_short_name?}&page=login_area'); - -// CFG: WEB-CMD-USER-IS-NULL-URL -$cfg->setConfigEntry('web_cmd_user_is_null_url', 'index.php?app={?app_short_name?}&page=problem&problem=user_null'); - -// CFG: NEWS-READER-HOME-CLASS -$cfg->setConfigEntry('news_reader_home_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-CLASS -$cfg->setConfigEntry('news_reader_login_area_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-LOGOUT-CLASS -$cfg->setConfigEntry('news_reader_login_area_logout_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-COMPANY-CLASS -$cfg->setConfigEntry('news_reader_login_area_company_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-REFILL-CLASS -$cfg->setConfigEntry('news_reader_login_area_refill_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-PROFILE-CLASS -$cfg->setConfigEntry('news_reader_login_area_profile_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-GOVERNMENT-TRAINING-CLASS -$cfg->setConfigEntry('news_reader_login_area_government_training_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-GOVERNMENT-STARTUP-HELP-CLASS -$cfg->setConfigEntry('news_reader_login_area_government_startup_help_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-LOGIN-AREA-STATUS-PROBLEM-CLASS -$cfg->setConfigEntry('news_reader_login_area_status_problem_class', 'DefaultNewsReader'); - -// CFG: NEWS-READER-GOVERNMENT-FAILED-CLASS -$cfg->setConfigEntry('news_reader_government_failed_class', 'DefaultNewsReader'); - -// CFG: NEWS-DOWNLOAD-FILTER -$cfg->setConfigEntry('news_download_filter', 'NewsDownloadFilter'); - -// CFG: NEWS-PROCESS-FILTER -$cfg->setConfigEntry('news_process_filter', 'NewsProcessFilter'); - -// CFG: USER-AUTH-FILTER -$cfg->setConfigEntry('user_auth_filter', 'UserAuthFilter'); - -// CFG: USER-UPDATE-FILTER -$cfg->setConfigEntry('user_update_filter', 'UserUpdateFilter'); - -// CFG: USER-STATUS-CONFIRMED-FILTER -$cfg->setConfigEntry('user_status_confirmed_filter', 'UserStatusConfimedUpdateFilter'); - -// CFG: CAPTCHA-ENCRYPT-VALIDATOR-FILTER -$cfg->setConfigEntry('captcha_encrypt_validator_filter', 'CaptchaEncryptFilter'); - -// CFG: REFILL-REQUEST-VALIDATOR-FILTER -$cfg->setConfigEntry('refill_request_validator_filter', 'RefillRequestValidatorFilter'); - -// CFG: CAPTCHA-GUEST-VERIFIER-FILTER -$cfg->setConfigEntry('captcha_guest_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CAPTCHA-USER-VERIFIER-FILTER -$cfg->setConfigEntry('captcha_user_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CAPTCHA-REGISTER-VERIFIER-FILTER -$cfg->setConfigEntry('captcha_register_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CAPTCHA-REFILL-VERFIER-FILTER -$cfg->setConfigEntry('captcha_refill_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CAPTCHA-GOVERNMENT-VERFIER-FILTER -$cfg->setConfigEntry('captcha_government_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CAPTCHA-PROFILE-VERFIER-FILTER -$cfg->setConfigEntry('captcha_profile_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); - -// CFG: CONFIRM-CODE-VERIFIER-FILTER -$cfg->setConfigEntry('confirm_code_verifier_filter', 'ConfirmCodeVerifierFilter'); - -// CFG: BIRTHDAY-REGISTER-VERIFIER-FILTER -$cfg->setConfigEntry('birthday_register_verifier_filter', 'BirthdayVerifierFilter'); - -// CFG: BIRTHDAY-PROFILE-VERIFIER-FILTER -$cfg->setConfigEntry('birthday_profile_verifier_filter', 'BirthdayVerifierFilter'); - -// CFG: REFILL-PAGE-FILTER -$cfg->setConfigEntry('refill_page_filter', 'RefillPageFilter'); - -// CFG: REFILL-REQUEST-CURRENCY-BOOK-FILTER -$cfg->setConfigEntry('refill_request_currency_test_book_filter', 'RefillRequestCurrencyTestBookFilter'); - -// CFG: PAYMENT-DISCOVERY-FILTER -$cfg->setConfigEntry('payment_discovery_filter', 'PaymentDiscoveryFilter'); - -// CFG: GOVERNMENT-PAYS-TRAINING-FILTER -$cfg->setConfigEntry('government_pays_training_filter', 'ShipSimuGovernmentPaysTrainingFilter'); - -// CFG: GOVERNMENT-PAYS-STARTUP-HELP-FILTER -$cfg->setConfigEntry('government_pays_startup_help_filter', 'ShipSimuGovernmentPaysStartupHelpFilter'); - -// CFG: USER-STATUS-GUEST-FILTER -$cfg->setConfigEntry('user_status_guest_filter', 'ShipSimuUserStatusGuestFilter'); - -// CFG: NEWS-HOME-LIMIT -$cfg->setConfigEntry('news_home_limit', 10); - -// CFG: NEWS-LOGIN-AREA-LIMIT -$cfg->setConfigEntry('news_login_area_limit', 15); - -// CFG: NEWS-GOVERNMENT-FAILED-LIMIT -$cfg->setConfigEntry('news_government_failed_limit', 15); - -// CFG: LOGIN-ENABLED -$cfg->setConfigEntry('login_enabled', 'Y'); - -// CFG: CONFIRM-EMAIL-ENABLED -$cfg->setConfigEntry('confirm_email_enabled', 'Y'); - -// CFG: LOGIN-DISABLED-REASON -$cfg->setConfigEntry('login_disabled_reason', 'Loginbereich befindet sich noch im Aufbau.'); - -// CFG: LOGIN-TYPE -$cfg->setConfigEntry('login_type', 'username'); // username, email, both - -// CFG: EMAIL-CHANGE-ALLOWED -$cfg->setConfigEntry('email_change_allowed', 'Y'); - -// CFG: EMAIL-CHANGE-CONFIRMATION -$cfg->setConfigEntry('email_change_confirmation', 'Y'); - -// CFG: GUEST-LOGIN-ALLOWED -$cfg->setConfigEntry('guest_login_allowed', 'Y'); - -// CFG: GUEST-LOGIN-USERNAME -$cfg->setConfigEntry('guest_login_user', 'guest'); - -// CFG: GUEST-LOGIN-PASS -$cfg->setConfigEntry('guest_login_passwd', 'guest'); - -// CFG: LOGIN-WELCOME-ACTION-CLASS -$cfg->setConfigEntry('login_welcome_action_class', 'ShipSimuLoginAction'); - -// CFG: LOGIN-LOGOUT-ACTION-CLASS -$cfg->setConfigEntry('login_logout_action_class', 'ShipSimuLogoutAction'); - -// CFG: LOGIN-PROFILE-ACTION-CLASS -$cfg->setConfigEntry('login_profile_action_class', 'ShipSimuProfileAction'); - -// CFG: SHIPSIMU-REGISTER-CAPTCHA -$cfg->setConfigEntry('shipsimu_register_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-USER-LOGIN-CAPTCHA -$cfg->setConfigEntry('shipsimu_user_login_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA -$cfg->setConfigEntry('shipsimu_guest_login_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-PROFILE-CAPTCHA -$cfg->setConfigEntry('shipsimu_profile_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-REFILL-CAPTCHA -$cfg->setConfigEntry('shipsimu_refill_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-GOVERNMENT-STARTUP-CAPTCHA -$cfg->setConfigEntry('shipsimu_government_startup_captcha', 'GraphicalCodeCaptcha'); - -// CFG: SHIPSIMU-GOVERNMENT-TRAINING-CAPTCHA -$cfg->setConfigEntry('shipsimu_government_training_captcha', 'GraphicalCodeCaptcha'); - -// CFG: CAPTCHA-STRING-LENGTH -$cfg->setConfigEntry('captcha_string_length', 5); - -// CFG: CAPTCHA-SEARCH-CHARS -$cfg->setConfigEntry('captcha_search_chars', '+/='); - -// CFG: RANDOM-STRING-LENGTH -$cfg->setConfigEntry('random_string_length', 100); - -// CFG: SHIPSIMU-REGISTER-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_register_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-USER-LOGIN-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_user_login_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_guest_login_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-PROFILE-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_profile_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-REFILL-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_refill_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-GOVERNMENT-STARTUP-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_government_startup_captcha_secured', 'Y'); - -// CFG: SHIPSIMU-GOVERNMENT-TRAINING-CAPTCHA-SECURED -$cfg->setConfigEntry('shipsimu_government_training_captcha_secured', 'Y'); - -// CFG: BLOCK-SHOWS-REGISTRATION -$cfg->setConfigEntry('block_shows_registration', 'Y'); - -// CFG: COMPANY-CLASS -$cfg->setConfigEntry('company_class', 'ShippingCompany'); - -// CFG: COMPANY-DB-WRAPPER-CLASS -$cfg->setConfigEntry('company_db_wrapper_class', 'CompanyDatabaseWrapper'); - -// CFG: USER-POINTS-DB-WRAPPER-CLASS -$cfg->setConfigEntry('user_points_db_wrapper_class', 'UserPointsDatabaseWrapper'); - -// CFG: USER-GOVERNMENT-WRAPPER-CLASS -$cfg->setConfigEntry('user_gov_wrapper_class', 'UserGovernmentDatabaseWrapper'); - -// CFG: PAYMENT-DB-WRAPPER-CLASS -$cfg->setConfigEntry('payment_db_wrapper_class', 'PaymentsDatabaseWrapper'); - -// CFG EMAIl-TPL-RESEND-LINK -$cfg->setConfigEntry('email_tpl_resend_link', 'text'); - -// CFG: MAIL-TEMPLATE-CLASS -$cfg->setConfigEntry('mail_template_class', 'MailTemplateEngine'); - -// CFG: IMAGE-TEMPLATE-CLASS -$cfg->setConfigEntry('image_template_class', 'ImageTemplateEngine'); - -// CFG: MENU-TEMPLATE-CLASS -$cfg->setConfigEntry('menu_template_class', 'MenuTemplateEngine'); - -// CFG: MENU-TEMPLATE-EXTENSION -$cfg->setConfigEntry('menu_template_extension', '.xml'); - -// CFG: ADMIN-EMAIL -$cfg->setConfigEntry('admin_email', 'you@some-hoster.invalid'); - -// CFG: USER-CLASS -$cfg->setConfigEntry('user_class', 'ShipSimuMember'); - -// CFG: GUEST-CLASS -$cfg->setConfigEntry('guest_class', 'ShipSimuGuest'); - -// CFG: MAX-ALLOWED-COMPANIES-FOUND -$cfg->setConfigEntry('max_allowed_companies_found', 10); - -// CFG: FOUND-NEW-COMPANY-ACTION-POINTS -$cfg->setConfigEntry('found_new_company_action_points', 1000000); - -// CFG: WRITE-APPLICATION-ACTION-POINTS -$cfg->setConfigEntry('write_applications_action_points', 10000); - -// CFG: USER-POINTS-CLASS -$cfg->setConfigEntry('user_points_class', 'UserPoints'); - -// CFG: GOVERNMENT-CLASS -$cfg->setConfigEntry('government_class', 'SimplifiedGovernment'); - -// CFG: BANK-CLASS -$cfg->setConfigEntry('bank_class', 'MoneyBank'); - -// CFG: REFILL-PAGE-ACTIVE -$cfg->setConfigEntry('refill_page_active', 'Y'); - -// CFG: REFILL-PAGE-MIN-CURRENCY-AMOUNT -$cfg->setConfigEntry('refill_page_min_currency_amount', 1000); - -// CFG: SHIP-SIMU-LOGIN-FILL-PAYMENT-DISCOVERY -$cfg->setConfigEntry('ship_simu_login_refill_payment_discovery', 'LocalPaymentDiscovery'); - -// CFG: GOVERNMENT-STARTUP-HELP-LIMIT -$cfg->setConfigEntry('government_startup_help_limit', 3); - -// CFG: GOVERNMENT-TRAINING-LIMIT -$cfg->setConfigEntry('government_training_limit', 2); - -// CFG: WEB-BLOCK-HELPER -$cfg->setConfigEntry('web_block_helper', 'WebBlockHelper'); - -// CFG: WEB-FORM-HELPER -$cfg->setConfigEntry('web_form_helper', 'WebFormHelper'); - -// CFG: WEB-LINK-HELPER -$cfg->setConfigEntry('web_link_helper', 'WebLinkHelper'); - -// CFG: WEB-CMD-GOVERNMENT-FAILED-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_government_failed_resolver_class', 'WebGovernmentFailedCommandResolver'); - -// CFG: WEB-CMD-LOGIN-FAILED-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_login_failed_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-COMPANY-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_company_resolver_class', 'WebCompanyCommandResolver'); - -// CFG: WEB-CMD-HOME-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_home_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-REGISTER-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_register_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-DO-FORM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_do_form_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-LOGIN-AREA-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_login_area_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-CONFIRM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_confirm_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-PROBLEM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_problem_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-LOGOUT-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_logout_resolver_class', 'WebCommandResolver'); - -// CFG: WEB-CMD-LOGOUT-DONE-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_logout_done_resolver_class', 'WebCommandResolver'); - -// CFG: REFILL-REQUEST-CURRENCY-PAYMENT-TYPE -$cfg->setConfigEntry('refill_request_currency_payment_type', 'test'); - -// CFG: LOGIN-REGISTER-LOGIN-FORM -$cfg->setConfigEntry('login_register_login_form', 'index.php?app={?app_short_name?}&page=register'); - -// CFG: HOME-MENU-CLASS -$cfg->setConfigEntry('home_menu_class', 'ShipSimuHomeMenu'); - -// CFG: LOGIN-FAILED-MENU-CLASS -$cfg->setConfigEntry('login_failed_menu_class', 'ShipSimuLoginFailedMenu'); - -// CFG: STATUS-MENU-CLASS -$cfg->setConfigEntry('status_menu_class', 'ShipSimuStatusMenu'); - -// CFG: LOGIN-MENU-CLASS -$cfg->setConfigEntry('login_menu_class', 'ShipSimuLoginMenu'); - -// CFG: LOGOUT-MENU-CLASS -$cfg->setConfigEntry('logout_menu_class', 'ShipSimuLogoutMenu'); - -// CFG: REGISTER-MENU-CLASS -$cfg->setConfigEntry('register_menu_class', 'ShipSimuRegisterMenu'); - -// CFG: CONFIRM-MENU-CLASS -$cfg->setConfigEntry('confirm_menu_class', 'ShipSimuConfirmMenu'); - -// CFG: LOGIN-AREA-MENU-CLASS -$cfg->setConfigEntry('login_area_menu_class', 'ShipSimuLoginAreaMenu'); - -// CFG: GOVERNMENT-FAILED-AREA-MENU-CLASS -$cfg->setConfigEntry('government_failed_area_menu_class', 'ShipSimuGovernmentFailedAreaMenu'); - -// CFG: MONEYBANK-ACTIVATED -$cfg->setConfigEntry('moneybank_activated', 'Y'); - -// CFG: MONEYBANK-OPENING-CLASS -$cfg->setConfigEntry('moneybank_opening_class', 'MoneyBankRealtimeOpening'); - -// [EOF] -?> diff --git a/application/ship-simu/data.php b/application/ship-simu/data.php deleted file mode 100644 index 07cfe25..0000000 --- a/application/ship-simu/data.php +++ /dev/null @@ -1,51 +0,0 @@ -isClass("ApplicationSelector"))) { return; } - * - * isset() is required to prevent a warning and is_object() is highly required - * when the application itself is requested in URL (hint: index.php?app=your_app) - * - * @author Roland Haeder - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Get config instance -$cfg = FrameworkConfiguration::getSelfInstance(); - -// Get an instance of the helper -$app = call_user_func_array( - array($cfg->getConfigEntry('app_helper_class'), 'getSelfInstance'), - array() -); - -// Set application name and version -$app->setAppName("Ship-Simu Shipping Simulator"); -$app->setAppVersion("0.0.0"); -$app->setAppShortName("shipsimu"); - -// [EOF] -?> diff --git a/application/ship-simu/debug.php b/application/ship-simu/debug.php deleted file mode 100644 index 11bf631..0000000 --- a/application/ship-simu/debug.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Reederei-Objekt debuggen -//define('DEBUG_COMPANY_OBJ', true); -// Hafen-Objekt debuggen -//define('DEBUG_HARBOR_OBJ', true); -// Schiff-Objekt debuggen -//define('DEBUG_SHIP_OBJ', true); -// Auftrag-Objekt debuggen -//define('DEBUG_CONTRACT_OBJ', true); -// Haendler-Objekt debuggen -//define('DEBUG_MERCHANT_OBJ', true); -// Personal-Objekt debuggen -//define('DEBUG_PERSONELL_OBJ', true); -// Personal debuggen -//define('DEBUG_PERSONELL', true); -// Reederei debuggen -//define('DEBUG_COMPANY', true); -// Mitarbeiter debuggen -//define('DEBUG_COMPANY_EMPLOYEE', true); -// Hafen debuggen -//define('DEBUG_HARBOR', true); -// Werft debuggen -//define('DEBUG_SHIPYARD', true); -// Schiff debuggen -//define('DEBUG_SHIP', true); -// Schiffstruktur debuggen -//define('DEBUG_STRUCTURE', true); -// Kabinen debuggen -//define('DEBUG_CABIN', true); -// Decks debuggen -//define('DEBUG_DECK', true); -// Bauauftraege debuggen -//define('DEBUG_CONTRACT', true); -// Haendler debuggen -//define('DEBUG_MERCHANT', true); - -// [EOF] -?> diff --git a/application/ship-simu/exceptions.php b/application/ship-simu/exceptions.php deleted file mode 100644 index d9cc8d9..0000000 --- a/application/ship-simu/exceptions.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Our own exception handler -function __exceptionHandler (FrameworkException $e) { - // Call the app_die() method - ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s (%s) has terminated due to an uncaught exception: %s [%s]: %s Backtrace:
%s
", - ApplicationHelper::getSelfInstance()->getAppName(), - ApplicationHelper::getSelfInstance()->getAppShortName(), - $e->__toString(), - $e->getHexCode(), - $e->getMessage(), - $e->getPrintableBackTrace() - ), - $e->getHexCode(), - $e->getExtraData() - ); -} // END - function - -// Set the new handler -set_exception_handler('__exceptionHandler'); - -// Error handler -function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) { - // Construct the message - $message = sprintf("File: %s, Line: %s, Code: %s, Message: %s", - basename($errfile), - $errline, - $errno, - $errstr - ); - - // Throw an exception here - throw new FatalErrorException($message, BaseFrameworkSystem::EXCEPTION_FATAL_ERROR); -} // END - function - -// Set error handler -set_error_handler('__errorHandler'); - -// Assertion handler -function __assertHandler ($file, $line, $code) { - // Empty code? - if ($code === "") $code = "Unknown"; - - // Create message - $message = sprintf("File: %s, Line: %s, Code: %s", - basename($file), - $line, - $code - ); - - // Throw an exception here - throw new AssertionException($message, BaseFrameworkSystem::EXCEPTION_ASSERTION_FAILED); -} // END - function - -// Init assert handling -assert_options(ASSERT_ACTIVE, 1); -assert_options(ASSERT_WARNING, 0); -assert_options(ASSERT_BAIL, 0); -assert_options(ASSERT_QUIET_EVAL, 0); -assert_options(ASSERT_CALLBACK, '__assertHandler'); - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/.htaccess b/application/ship-simu/exceptions/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/exceptions/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/exceptions/class_BirthdayInvalidException.php b/application/ship-simu/exceptions/class_BirthdayInvalidException.php deleted file mode 100644 index ed8e189..0000000 --- a/application/ship-simu/exceptions/class_BirthdayInvalidException.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BirthdayInvalidException extends FrameworkException { - public function __construct (array $birthArray, $code) { - // Add a message around the missing class - $message = sprintf("Das Geburtsdatum %s ist leider falsch.", - date("d.m.Y", mktime( - 0, 0, 0, - $birthArray[1], - $birthArray[2], - $birthArray[0] - )) - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_CabinShipMismatchException.php b/application/ship-simu/exceptions/class_CabinShipMismatchException.php deleted file mode 100644 index 6b9120b..0000000 --- a/application/ship-simu/exceptions/class_CabinShipMismatchException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class CabinShipMismatchException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ContractAllreadySignedException.php b/application/ship-simu/exceptions/class_ContractAllreadySignedException.php deleted file mode 100644 index fc17f64..0000000 --- a/application/ship-simu/exceptions/class_ContractAllreadySignedException.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ContractAllreadySignedException extends FrameworkException { - public function __construct (array $classArray, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Die Vertragsparteien %s und %s haben den Vertrag bereits unterzeichnet!", - $classArray[0]->__toString(), - $classArray[1]->getCompanyName(), - $classArray[2]->getCompanyName() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ContractPartnerMismatchException.php b/application/ship-simu/exceptions/class_ContractPartnerMismatchException.php deleted file mode 100644 index fce9748..0000000 --- a/application/ship-simu/exceptions/class_ContractPartnerMismatchException.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ContractPartnerMismatchException extends FrameworkException { - public function __construct (array $classArray, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Der Vertragspartner von %s ist ungütig (%s) und darf diesen Vertrag nicht unterzeichnen!", - $classArray[0]->__toString(), - $classArray[1]->getCompanyName(), - $classArray[2]->getCompanyName() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_DeckShipMismatchException.php b/application/ship-simu/exceptions/class_DeckShipMismatchException.php deleted file mode 100644 index 937cd6e..0000000 --- a/application/ship-simu/exceptions/class_DeckShipMismatchException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class DeckShipMismatchException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_EmptyStructuresListException.php b/application/ship-simu/exceptions/class_EmptyStructuresListException.php deleted file mode 100644 index 9c1eee2..0000000 --- a/application/ship-simu/exceptions/class_EmptyStructuresListException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class EmptyStructuresListException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Die Strukturen-Liste ist leer.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_InvalidContractPartnerException.php b/application/ship-simu/exceptions/class_InvalidContractPartnerException.php deleted file mode 100644 index 8f4823e..0000000 --- a/application/ship-simu/exceptions/class_InvalidContractPartnerException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class InvalidContractPartnerException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Kein gütiger Vertragspartner.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_InvalidIDFormatException.php b/application/ship-simu/exceptions/class_InvalidIDFormatException.php deleted file mode 100644 index 78e2e00..0000000 --- a/application/ship-simu/exceptions/class_InvalidIDFormatException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class InvalidIDFormatException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Ungültige ID-Nummer übergeben.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ItemNotInPriceListException.php b/application/ship-simu/exceptions/class_ItemNotInPriceListException.php deleted file mode 100644 index 0013e92..0000000 --- a/application/ship-simu/exceptions/class_ItemNotInPriceListException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ItemNotInPriceListException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[Merchant:] Preis für den Artikel %s nicht gefunden.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ItemNotTradeableException.php b/application/ship-simu/exceptions/class_ItemNotTradeableException.php deleted file mode 100644 index 074f17e..0000000 --- a/application/ship-simu/exceptions/class_ItemNotTradeableException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ItemNotTradeableException extends FrameworkException { - public function __construct (array $classArray, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Object not tradeable.", - $classArray[0]->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_MissingSimulatorIdException.php b/application/ship-simu/exceptions/class_MissingSimulatorIdException.php deleted file mode 100644 index 09a55f3..0000000 --- a/application/ship-simu/exceptions/class_MissingSimulatorIdException.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class MissingSimulatorIdException extends FrameworkException { - public function __construct (array $classArray, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Die Simulator-ID %s scheint ungültig zu sein.", - $classArray[0]->__toString(), - $classArray[1] - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_MotorShipMismatchException.php b/application/ship-simu/exceptions/class_MotorShipMismatchException.php deleted file mode 100644 index 7e688c2..0000000 --- a/application/ship-simu/exceptions/class_MotorShipMismatchException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class MotorShipMismatchException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_NoShippingCompanyOwnedException.php b/application/ship-simu/exceptions/class_NoShippingCompanyOwnedException.php deleted file mode 100644 index 848362e..0000000 --- a/application/ship-simu/exceptions/class_NoShippingCompanyOwnedException.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class NoShippingCompanyOwnedException extends FrameworkException { - /** - * Constructor of this exception - * - * @param $msgArray Message array with exception data - * @param $code Exception code - * @return void - */ - public function __construct (array $msgArray, $code) { - // Add a message around the missing class - $message = sprintf("[%s:%d] Current user (class %s) does not own any shipping companies.", - $msgArray[0]->__toString(), - $this->getLine(), - $msgArray[1]->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_NoShipyardsConstructedException.php b/application/ship-simu/exceptions/class_NoShipyardsConstructedException.php deleted file mode 100644 index 52cf913..0000000 --- a/application/ship-simu/exceptions/class_NoShipyardsConstructedException.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class NoShipyardsConstructedException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // No class given - $message = sprintf("Please provide a class for %s", __CLASS__); - if (is_object($class)) { - // Add a message around the missing class - $message = sprintf("[%s:] Keine Werften gefunden!", - $class->__toString() - ); - } // END - if - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_PersonellListAlreadyCreatedException.php b/application/ship-simu/exceptions/class_PersonellListAlreadyCreatedException.php deleted file mode 100644 index c89dc44..0000000 --- a/application/ship-simu/exceptions/class_PersonellListAlreadyCreatedException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class PersonellListAlreadyCreatedException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Die interne Crew-Liste wurde bereits initialisiert.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_RoomShipMismatchException.php b/application/ship-simu/exceptions/class_RoomShipMismatchException.php deleted file mode 100644 index d84528c..0000000 --- a/application/ship-simu/exceptions/class_RoomShipMismatchException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class RoomShipMismatchException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ShipNotConstructedException.php b/application/ship-simu/exceptions/class_ShipNotConstructedException.php deleted file mode 100644 index 3313c36..0000000 --- a/application/ship-simu/exceptions/class_ShipNotConstructedException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipNotConstructedException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ShipPartNotConstructableException.php b/application/ship-simu/exceptions/class_ShipPartNotConstructableException.php deleted file mode 100644 index 48b4fe7..0000000 --- a/application/ship-simu/exceptions/class_ShipPartNotConstructableException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipPartNotConstructableException extends FrameworkException { - public function __construct (array $partArray, $code) { - // Add a message around the missing class - $message = sprintf("Schiffteil %s ist nicht constrierbar!", - $partArray[0] - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_StructureShipMismatchException.php b/application/ship-simu/exceptions/class_StructureShipMismatchException.php deleted file mode 100644 index 62152e8..0000000 --- a/application/ship-simu/exceptions/class_StructureShipMismatchException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class StructureShipMismatchException extends FrameworkException { -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_StructuresOutOfBoundsException.php b/application/ship-simu/exceptions/class_StructuresOutOfBoundsException.php deleted file mode 100644 index 916207f..0000000 --- a/application/ship-simu/exceptions/class_StructuresOutOfBoundsException.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class StructuresOutOfBoundsException extends FrameworkException { - public function __construct ($idx, $code) { - // Add a message around the missing class - $message = sprintf("Der Index %s liegt ausserhalb des gütigen Bereiches! Schiffsteil nicht auffindbar.", $idx); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_ToMuchEmployeesException.php b/application/ship-simu/exceptions/class_ToMuchEmployeesException.php deleted file mode 100644 index a6bffb0..0000000 --- a/application/ship-simu/exceptions/class_ToMuchEmployeesException.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ToMuchEmployeesException extends FrameworkException { - public function __construct (array $amountArray, $code) { - // Add a message around the missing class - $message = sprintf("%d Leute nicht einstellbar, da nur %d arbeitslos sind!", - $amountArray[0], - $amountArray[1] - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_TotalPriceNotCalculatedException.php b/application/ship-simu/exceptions/class_TotalPriceNotCalculatedException.php deleted file mode 100644 index 7aa57ae..0000000 --- a/application/ship-simu/exceptions/class_TotalPriceNotCalculatedException.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class TotalPriceNotCalculatedException extends FrameworkException { - public function __construct (FrameworkInterface $class, $code) { - // Add a message around the missing class - $message = sprintf("[%s:] Gesamtpreis ist nicht ermittelbar.", - $class->__toString() - ); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_UnsupportedLimitationPartException.php b/application/ship-simu/exceptions/class_UnsupportedLimitationPartException.php deleted file mode 100644 index ee7aa5a..0000000 --- a/application/ship-simu/exceptions/class_UnsupportedLimitationPartException.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class UnsupportedLimitationPartException extends FrameworkException { - public function __construct ($str, $code) { - // Add a message around the missing class - $message = sprintf("Limitierungsinformation %s wird derzeit nicht unterstützt.", $str); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/exceptions/class_WrongGenderSpecifiedException.php b/application/ship-simu/exceptions/class_WrongGenderSpecifiedException.php deleted file mode 100644 index 306a680..0000000 --- a/application/ship-simu/exceptions/class_WrongGenderSpecifiedException.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WrongGenderSpecifiedException extends FrameworkException { - public function __construct ($gender, $code) { - // Add a message around the missing class - $message = sprintf("Das Geschlecht %s Ist nicht M (Männlich) oder F (Weiblich).", $gender); - - // Call parent constructor - parent::__construct($message, $code); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/init.php b/application/ship-simu/init.php deleted file mode 100644 index d27a1f5..0000000 --- a/application/ship-simu/init.php +++ /dev/null @@ -1,47 +0,0 @@ -isClass("ApplicationSelector"))) { return; } - * - * isset() is required to prevent a warning and is_object() is highly required - * when the application itself is requested in URL (hint: index.php?app=your_app) - * - * @author Roland Haeder - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Get config instance -$cfg = FrameworkConfiguration::getSelfInstance(); - -// Initialize output system -require($cfg->getConfigEntry('base_path') . 'inc/output.php'); - -// This application needs a database connection then we have to simply include -// the inc/database.php script -require($cfg->getConfigEntry('base_path') . 'inc/database.php'); - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/.htaccess b/application/ship-simu/interfaces/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/interfaces/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/interfaces/class_BookableAccount.php b/application/ship-simu/interfaces/class_BookableAccount.php deleted file mode 100644 index 3f3a575..0000000 --- a/application/ship-simu/interfaces/class_BookableAccount.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface BookableAccount extends FrameworkInterface { - /** - * Books the given 'amount' in the request instance on the users "points - * account" - * - * @param $requestInstance An instance of a Requestable class - * @return void - */ - function bookAmountDirectly (Requestable $requestInstance); -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_ConstructableShip.php b/application/ship-simu/interfaces/class_ConstructableShip.php deleted file mode 100644 index db76fd5..0000000 --- a/application/ship-simu/interfaces/class_ConstructableShip.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface ConstructableShip extends FrameworkInterface { -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_ConstructableShipPart.php b/application/ship-simu/interfaces/class_ConstructableShipPart.php deleted file mode 100644 index 8135bc3..0000000 --- a/application/ship-simu/interfaces/class_ConstructableShipPart.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface ConstructableShipPart extends FrameworkInterface { -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_ContractPartner.php b/application/ship-simu/interfaces/class_ContractPartner.php deleted file mode 100644 index 35b4b6d..0000000 --- a/application/ship-simu/interfaces/class_ContractPartner.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface ContractPartner extends FrameworkInterface { - /** - * This is a contract partner - * - * @param $contractInstance Must be a valid instance of WorksContract - * @return boolean true = can be a contract partner, - * false = no partner for contracts - */ - function isContractPartner (SignableContract $contractInstance); -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_Customer.php b/application/ship-simu/interfaces/class_Customer.php deleted file mode 100644 index 5de5210..0000000 --- a/application/ship-simu/interfaces/class_Customer.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface Customer extends FrameworkInterface { - /** - * Adds a contract to the customer's list - * - * @param $contractInstance A valid instance to WorksContract - * @return void - */ - function addNewWorksContract (SignableContract $contractInstance); - - /** - * Signs a works contract. - * - * @param $contractInstance A valid instance to WorksContract - * @param $partnerInstance An instance the other contract partner - * @return void - * @throws InvalidContractPartnerException If the in $contractInstance - * set contract partner is - * not the expected - */ - function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance); - - /** - * Withdraw from a signed contract - * - * @param $contractInstance A valid instance to WorksContract - * @return void - */ - function withdrawFromContract (SignableContract $contractInstance); -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_Personellizer.php b/application/ship-simu/interfaces/class_Personellizer.php deleted file mode 100644 index b56df14..0000000 --- a/application/ship-simu/interfaces/class_Personellizer.php +++ /dev/null @@ -1,200 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface Personellizer extends FrameworkInterface { - /////////////////////// - /// General methods /// - /////////////////////// - - /** - * Remove min/max age - * - * @return void - */ - function removeMinMaxAge (); - - /** - * Create a valid birthday - * - * @return void - */ - function createBirthday (); - - /** - * Verify if given year/month/day is a valid date combination - * - * @param $year 4-digit year (valid : 2007, 1946, - * invalid: 24, 2a, aa) - * @param $month 1 to 2-digit month (range: 1 to 12) - * @param $day 1 to 2-digit day (range: 1 to 31/30/29/28) - * @return boolean true = date is valid, - * false = date is invalid - */ - function isDateValid ($year, $month, $day); - - ///////////////////////// - //// Status requests //// - ///////////////////////// - - /** - * Is the person employed? - * - * @return boolean true = person is employed - * false = person is umemployed - */ - function isEmployed (); - - /** - * Is the person married? (to which one doesn't matter here) - * - * @return boolean true = person is married - * false = person is not married - */ - function isMarried (); - - /** - * Is the person a male? - * - * @return boolean true = person is male - * false = person is not male (maybe female? ;-)) - */ - function isMale (); - - /** - * Is the person a female? - * - * @return boolean true = person is female - * false = person is not female (maybe male? ;-)) - */ - function isFemale (); - - ///////////////// - //// Getters //// - ///////////////// - - /** - * Getter for surname - * - * @return $surname The person's surname - */ - function getSurname (); - - /** - * Getter for family name - * - * @return $family The person's family name - */ - function getFamily (); - - /** - * Getter for gender - * - * @return $gender The person's gender (F/M) - */ - function getGender (); - - /** - * Getter for salary - * - * @return $salary The person's current salary - */ - function getSalary (); - - ///////////////// - //// Setters //// - ///////////////// - - /** - * Setter for surname - * - * @param $surname The person's new surname as a string - * @return void - */ - function setSurname ($surname); - - /** - * Setter for family name - * - * @param $family The person's new family name as a string - * @return void - */ - function setFamily ($family); - - /** - * Setter for gender. Do not use this so often... ;-) - * This method shall only be used when the person is "created" - * - * @param $gender The person's new gender as a 1-char string (M/F) - * @return void - */ - function setGender ($gender); - - /** - * Setter for employment status - * - * @param $employed The person's new employment stats - * @return void - */ - function setEmployed ($employed); - - /** - * Setter for marrital status - * - * @param $married The person's new marrital status - * @return void - */ - function setMarried ($married); - - /** - * Setter for a already validated birthday. - * - * @param $year The person's new year-of-birth (4 digits) - * @param $month The person's new month-of-birth (1 to 2 digits) - * @param $day The person's new day-of-birth (1 to 2 digits) - * @return void - */ - function setBirthday ($year, $month, $day); - - ///////////////////////////////////// - //// Methods for changing salary //// - ///////////////////////////////////// - - /** - * Increase person's salary by a specified amount - * - * @param $add Add this float amount to current salary - * @return void - */ - function increaseSalary ($add); - - /** - * Decrease person's salary by a specified amount - * - * @param $sub Subtract this float amount to current salary - * @return void - */ - function decreaseSalary ($sub); -} - -// [EOF] -?> diff --git a/application/ship-simu/interfaces/class_SignableContract.php b/application/ship-simu/interfaces/class_SignableContract.php deleted file mode 100644 index a8f62ce..0000000 --- a/application/ship-simu/interfaces/class_SignableContract.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface SignableContract extends FrameworkInterface { - // Sign the contract - function signContract (ContractPartner $partnerInstance, ContractPartner $partyInstance); -} - -// [EOF] -?> \ No newline at end of file diff --git a/application/ship-simu/interfaces/class_TradeableItem.php b/application/ship-simu/interfaces/class_TradeableItem.php deleted file mode 100644 index f850be2..0000000 --- a/application/ship-simu/interfaces/class_TradeableItem.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface TradeableItem extends FrameworkInterface { - /** - * Is this item (=object) tradeable? - * - * @return boolean true = is a tradeable object, - * false = is not tradeable - */ - function isTradeable (); -} - -// [EOF] -?> diff --git a/application/ship-simu/loader.php b/application/ship-simu/loader.php deleted file mode 100644 index d28600b..0000000 --- a/application/ship-simu/loader.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Get config instance -$cfg = FrameworkConfiguration::getSelfInstance(); - -// Load all classes for the application -foreach ($lowerClasses as $className) { - // Load the application classes - ClassLoader::getSelfInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $className)); -} // END - if - -// Clean up the global namespace -unset($lowerClasses); -unset($className); - -// [EOF] -?> diff --git a/application/ship-simu/main/.htaccess b/application/ship-simu/main/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/actions/.htaccess b/application/ship-simu/main/actions/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/actions/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/actions/class_ b/application/ship-simu/main/actions/class_ deleted file mode 100644 index d84fab7..0000000 --- a/application/ship-simu/main/actions/class_ +++ /dev/null @@ -1,82 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ???Action extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public final static function create???Action (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new ???Action(); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here - $this->partialStub("You have to implement me."); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Call parent addExtraFilters method - parent::addExtraFilters($controllerInstance, $requestInstance); - - // Unfinished method - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/class_BaseShipSimuAction.php b/application/ship-simu/main/actions/class_BaseShipSimuAction.php deleted file mode 100644 index 41dcce0..0000000 --- a/application/ship-simu/main/actions/class_BaseShipSimuAction.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseShipSimuAction extends BaseAction { - /** - * Protected constructor - * - * @param $className Name of the class - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - protected function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Add code here executed with every action - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Unfinished method - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/ship-simu/.htaccess b/application/ship-simu/main/actions/ship-simu/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/actions/ship-simu/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php deleted file mode 100644 index 2fbee37..0000000 --- a/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLoginAction extends BaseShipSimuAction implements PerformableAction { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @return $actionInstance An instance of this action class - */ - public static final function createShipSimuLoginAction () { - // Get a new instance - $actionInstance = new ShipSimuLoginAction(); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Maybe we need to do something later here - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php deleted file mode 100644 index 56090bf..0000000 --- a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuProfileAction extends BaseShipSimuAction implements PerformableAction { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @return $actionInstance An instance of this action class - */ - public static final function createShipSimuProfileAction () { - // Get a new instance - $actionInstance = new ShipSimuProfileAction(); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Maybe we need to do something later here - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/.htaccess b/application/ship-simu/main/actions/web/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/actions/web/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLogin b/application/ship-simu/main/actions/web/class_WebShipSimuLogin deleted file mode 100644 index d60f442..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLogin +++ /dev/null @@ -1,82 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLogin???Action extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public final static function createWebShipSimuLogin???Action (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLogin???Action(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute parent method - parent::execute($requestInstance, $responseInstance); - - // Add your code here - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php deleted file mode 100644 index 842d6cb..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginCompanyAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginCompanyAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginCompanyAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Maybe add fetching company list of current user here? - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some more filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php deleted file mode 100644 index fa62481..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginGovernmentStartupHelpAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginGovernmentStartupHelpAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginGovernmentStartupHelpAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Check if government can pay startup help - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php deleted file mode 100644 index fcbc711..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginGovernmentTrainingAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginGovernmentTrainingAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginGovernmentTrainingAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some more filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Check if government can pay a training - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php deleted file mode 100644 index 9b066a9..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginLogoutAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginLogoutAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginLogoutAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php deleted file mode 100644 index 58d6745..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginProfileAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginProfileAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginProfileAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php deleted file mode 100644 index 31c7337..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginRefillAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginRefillAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginRefillAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Is the refill page active? - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); - - // Add payment discovery filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this))); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php deleted file mode 100644 index 8b26b8f..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginStatusProblemAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginStatusProblemAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginStatusProblemAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent method - parent::execute($requestInstance, $responseInstance); - - // Add your code - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php deleted file mode 100644 index d839bd1..0000000 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuLoginWelcomeAction extends BaseShipSimuAction implements Commandable, Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this action - * - * @param $resolverInstance An instance of an action resolver - * @return $actionInstance An instance of this action class - */ - public static final function createWebShipSimuLoginWelcomeAction (ActionResolver $resolverInstance) { - // Get a new instance - $actionInstance = new WebShipSimuLoginWelcomeAction(); - - // Set the resolver instance - $actionInstance->setResolverInstance($resolverInstance); - - // Return the instance - return $actionInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Call parent execute method - parent::execute($requestInstance, $responseInstance); - - // Add your code here... - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some filters here - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Unfinished method - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/bank/.htaccess b/application/ship-simu/main/bank/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/bank/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/bank/class_BaseBank.php b/application/ship-simu/main/bank/class_BaseBank.php deleted file mode 100644 index 21ae0d5..0000000 --- a/application/ship-simu/main/bank/class_BaseBank.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * @todo Find an instance for all banks and move the abstract functions there - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -abstract class BaseBank extends BaseFrameworkSystem { - /** - * Protected constructor - * - * @param $className The class' real name - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Checks wether the bank lends more money to the current user - * - * @return $lendsMoreMoney Wether this bank lends more money to the user - */ - public abstract function ifBankLendsMoreMoney (); - - /** - * Checks wethert the current user has maximum allowed credits with this bank - * - * @return $hasMaximumCredits Wether the user has maximum allowed credits - */ - public abstract function ifUserHasMaxCredits (); - - /** - * Checks wether this money bank has opened - * - * @return $hasOpened Wether this money bank has opened - */ - public abstract function ifMoneyBankHasOpened (); -} - -// [EOF] -?> diff --git a/application/ship-simu/main/bank/money/class_MoneyBank.php b/application/ship-simu/main/bank/money/class_MoneyBank.php deleted file mode 100644 index 11d4d9e..0000000 --- a/application/ship-simu/main/bank/money/class_MoneyBank.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class MoneyBank extends BaseBank implements Registerable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this money bank class - * - * @param $userInstance A class instance of a user object - * @return $bankInstance An instance of this class - */ - public static final function createMoneyBank (ManageableAccount $userInstance) { - // Get a new instance - $moneyInstance = new MoneyBank(); - - // Set the user instance - $moneyInstance->setUserInstance($userInstance); - - // Return the prepared instance - return $moneyInstance; - } - - /** - * Checks wether the bank lends more money to the current user - * - * @return $lendsMoreMoney Wether this bank lends more money to the user - */ - public function ifBankLendsMoreMoney () { - $this->partialStub(); - } - - /** - * Checks wethert the current user has maximum allowed credits with this bank - * - * @return $hasMaximumCredits Wether the user has maximum allowed credits - */ - public function ifUserHasMaxCredits () { - $this->partialStub(); - } - - /** - * Checks wether this money bank has opened - * - * @return $hasOpened Wether this money bank has opened - */ - public function ifMoneyBankHasOpened () { - // Has not opened by default - $hasOpened = false; - - // Is the money bank activated in config? - if ($this->getConfigInstance()->getConfigEntry('moneybank_activated')) { - // Okay, does the user ask within the opening times? To find this out we need a OpeningTimes class - $openingInstance = ObjectFactory::createObjectByConfiguredName('moneybank_opening_class', array($this)); - - // Then we simply "ask" the opening time instance if the user asks within the opening time - $hasOpened = $openingInstance->ifWithinOpeningTimes(); - } // END - if - - // Return status - return $hasOpened; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/class_ b/application/ship-simu/main/class_ deleted file mode 100644 index 956f6c5..0000000 --- a/application/ship-simu/main/class_ +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ??? extends BaseFrameworkSystem { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this money bank class - * - * @return $???Instance An instance of this class - */ - public final static function create??? () { - // Get a new instance - $???Instance = new ???(); - - // Return the prepared instance - return $???Instance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/class_BasePersonell.php b/application/ship-simu/main/class_BasePersonell.php deleted file mode 100644 index 8e08ec3..0000000 --- a/application/ship-simu/main/class_BasePersonell.php +++ /dev/null @@ -1,246 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BasePersonell extends BaseFrameworkSystem implements Personellizer { - // Maximum/minimum age - private $MIN_AGE = 21; - private $MAX_AGE = 40; - - // Male/female - private $gender = ""; // M=Male, F=Female, empty=uninitialized - - // Year/month/day of birth - private $yearBirth = 0; - private $monthBirth = 0; - private $dayBirth = 0; - - // Surname/family name - private $surname = ""; - private $family = ""; - - // Employed? - private $employed = false; - - // Married? - private $married = false; - - // Her/his salary - private $salary = 0.00; - - // Constructor - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Remove min/max ages - public final function removeMinMaxAge () { - unset($this->MIN_AGE); - unset($this->MAX_AGE); - } - - // Generates a birthday based on MAX_AGE/MIN_AGE and the current date - public final function createBirthday () { - // Is the birthday already set? - if ($this->isDateValid($this->yearBirth, $this->monthBirth, $this->dayBirth)) return false; - - // Get current year - $currYear = date("Y", time()); - - // Generate random year/month/day - $year = mt_rand(($currYear - $this->MIN_AGE), ($currYear - $this->MAX_AGE)); - $month = 0; - $day = 0; - while ($this->isDateValid($year, $month, $day) === false) { - $month = mt_rand(1, 12); - switch ($month) { - case 1: - case 3: - case 5: - case 7: - case 8: - case 10: - case 12: - $day = mt_rand(1, 31); - break; - - case 4: - case 6: - case 9: - case 11: - $day = mt_rand(1, 30); - break; - - case 2: // February - if ($year % 4 == 0) { - // Is a "Schaltjahr" - $day = mt_rand(1, 29); - } else { - // Regular year - $day = mt_rand(1, 28); - } - break; - } // END - switch - } // END - while - - // Set the new birthday - $this->setBirthday($year, $month, $day); - } - - // Is the current day valid? - public final function isDateValid ($year, $month, $day) { - // Create timestamp - $stamp = mktime(0, 0, 0, $month, $day, $year); - - // Get year/month/day back - $y = date("Y", $stamp); - $m = date("m", $stamp); - $d = date("d", $stamp); - - // Compare all - return (($y == $year) && ($m == $month) && ($d == $day)); - } - - // Employed? - public final function isEmployed () { - return $this->employed; - } - - // Married? - public final function isMarried () { - return $this->married; - } - - // Male? - public final function isMale () { - return ($this->gender == "M"); - } - - // Female - public final function isFemale () { - return ($this->gender == "F"); - } - - // Setter for surname - public final function setSurname ($surname) { - $this->surname = (string) $surname; - } - - // Getter for surname - public function getSurname () { - return $this->surname; - } - - // Setter for family name - public final function setFamily ($family) { - $this->family = (string) $family; - } - - // Getter for family name - public final function getFamily () { - return $this->family; - } - - // Setter for gender - public final function setGender ($gender) { - // Set random gender here - if (($gender == "M") || ($gender == "F") || ((empty($gender)) && ($this->getSurname() == ""))) { - $this->gender = $gender; - } else { - throw new WrongGenderSpecifiedException($gender, self::EXCEPTION_GENDER_IS_WRONG); - } - } - - // Getter for gender - public final function getGender () { - return $this->gender; - } - - // Setter for employment status - public final function setEmployed ($employed) { - $this->employed = (boolean) $employed; - } - - // Setter for marriage status - public final function setMarried ($married) { - $this->married = (boolean) $married; - } - - // Getter for salary - public final function getSalary () { - return $this->salary; - } - - // Increase salary - public final function increaseSalary ($add) { - $this->salary += (float) abs($add); - } - - // Decrease salary - public final function decreaseSalary ($sub) { - $this->salary -= (float) abs($sub); - } - - // Setter for birthday - public final function setBirthday ($year, $month, $day) { - $this->yearBirth = (int) abs($year); - $this->monthBirth = (int) abs($month); - $this->dayBirth = (int) abs($day); - } - - // Remove gender - public final function removeGender () { - unset($this->gender); - } - - // Remove both names - public final function removeNames () { - unset($this->surname); - unset($this->family); - } - - // Remove complete birthday - public final function removeBirthday () { - unset($this->yearBirth); - unset($this->monthBirth); - unset($this->dayBirth); - } - - // Remove salary - public final function removeSalary () { - unset($this->salary); - } - - // Remove employment status - public final function removeEmployed () { - unset($this->employed); - } - - // Remove marrital status - public final function removeMarried () { - unset($this->married); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/class_BaseSimulator.php b/application/ship-simu/main/class_BaseSimulator.php deleted file mode 100644 index e460013..0000000 --- a/application/ship-simu/main/class_BaseSimulator.php +++ /dev/null @@ -1,302 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseSimulator extends BaseFrameworkSystem { - // Schiffsteilinstanz - private $partInstance = null; - - // Abmasse (Breite/Hoehe/Laenge) - private $width = 0; - private $height = 0; - private $length = 0; - - // Aktuelles Schiff und Schiffsteil - private $currShip = null; - private $currPart = null; - - // Faktoren zur Erweiterung der Masse. Beispielsweise soll der Maschinenraum groesser wie der Motor sein - private $resizeFactorArray = array( - 'width' => 1, - 'height' => 1, - 'length' => 1 - ); - - // Konstruktor - protected function __construct ($className) { - // Call highest constructor - parent::__construct($className); - - // Clean up a little, dies sollte ganz zum Schluss erfolgen! - $this->removeResizeFactorArray(); - $this->removeCurrPart(); - $this->removeCurrShip(); - } - - // Setter-Methode fuer Laenge - public final function setLength ($length) { - $this->length = (float) $length; - } - - // Setter-Methode fuer Breite - public final function setWidth ($width) { - $this->width = (float) $width; - } - - // Setter-Methode fuer Hoehe - public final function setHeight ($height) { - $this->height = (float) $height; - } - - // Getter-Methode fuer Laenge - public final function getLength () { - return $this->length; - } - - // Getter-Methode fuer Breite - public final function getWidth () { - return $this->width; - } - - // Getter-Methode fuer Hoehe - public final function getHeight () { - return $this->height; - } - - // Setter-Methode fuer Teil-Instanz - public final function setPartInstance (ConstructableShipPart $partInstance) { - $this->partInstance = $partInstance; - } - - // Getter-Methode fuer Teil-Instanz - public final function getPartInstance () { - if (!isset($this->partInstance)) { - return null; - } - return $this->partInstance; - } - - // Remover-Methode fuer die Teil-Instanz - public final function removePartInstance () { - unset($this->partInstance); - } - - // Prueft ob all Umberechnungsfaktoren gesetzt sind - private function isResizeFactorValid () { - return (($this->getResizeFactorElement('width') > 1) - || ($this->getResizeFactorElement('height') > 1) - || ($this->getResizeFactorElement('length') > 1) - ); - } - - // Baut einen Motor in das Schiff ein - public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $partInstance) { - // Schiff/-steil merken - $this->currShip = $shipInstance; - $this->currPart = $partInstance; - - // Passt ueberhaupt das Schiffsteil in's Schiff? - if ($this->isShipPartSizeValid()) { - // Muessen die Masse angepasst werden? - if ($this->isResizeFactorValid()) { - // Neue Angaben berechnen (wir lassen etwas Lust fuer Kabelbaeume, Roehren, Maschinisten, etc.) - $this->newWidth = (float) $this->getCurrPart()->getWidth() * $this->resizeFactorArray['width']; - $this->newHeight = (float) $this->getCurrPart()->getHeight() * $this->resizeFactorArray['height']; - $this->newLength = (float) $this->getCurrPart()->getLength() * $this->resizeFactorArray['length']; - - // Passt dies nun immer noch? - if ($this->isNewSizeValid()) { - // Das passt auch, dann Werte setzen und Motor-Instanz merken - $this->setWidth($this->newWidth); - $this->setHeight($this->newHeight); - $this->setLength($this->newLength); - - // Einige Dinge entfernen... - $this->removeAllNewAttr(); - } else { - // Passt nicht! Also wieder Exception werfen... - throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s ist zu gross für das Schiff!", - $this->getCurrPart()->__toString(), - $this->getCurrPart()->getObjectDescription(), - $this->getCurrPart()->__toString() - ), 2); - } - } elseif ($this->currPart != null) { - // Aktuelle Masse setzen - $this->setWidth($this->getCurrPart()->getWidth()); - $this->setHeight($this->getCurrPart()->getHeight()); - $this->setLength($this->getCurrPart()->getLength()); - } - - // Existiert ein Schiffsteil? - if (!is_null($this->currPart)) { - // Schiffsteil-Instanz setzen - $this->setPartInstance($this->currPart); - - // Instanzen entfernen - $this->getCurrPart()->removeCurrShip(); - $this->getCurrPart()->removeCurrPart(); - $this->getCurrPart()->removePartInstance(); - $this->getCurrPart()->removeResizeFactorArray(); - } - } else { - // Exception werfen! - throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt nicht in das Schiff!", - $this->getCurrPart()->realClass, - $this->getCurrPart()->getObjectDescription(), - $this->getCurrPart()->__toString() - ), 1); - } - - // Nochmals Clean up a little - $this->removeResizeFactorArray(); - $this->removeCurrShip(); - $this->removeCurrPart(); - } - - // Array fuer Umrechnungstabelle entfernen - public final function removeResizeFactorArray () { - unset($this->resizeFactorArray); - } - - /** - * Remove all new*** attributes - * - * @return void - */ - public final function removeAllNewAttr () { - unset($this->newWidth); - unset($this->newHeight); - unset($this->newLength); - } - - /** - * Remove current ship instance - * - * @return void - */ - public final function removeCurrShip () { - unset($this->currShip); - } - - // Aktuelle Schiffsteil-Instanz entfernen - public final function removeCurrPart () { - unset($this->currPart); - } - - // Breite entfernen - public final function removeWidth () { - unset($this->width); - } - - // Hoehe entfernen - public final function removeHeight () { - unset($this->height); - } - - // Laenge entfernen - public final function removeLength () { - unset($this->length); - } - - // Tiefgang entfernen - public final function removeDraught () { - unset($this->draught); - } - - // Getter-Methode fuer Element aus resizeFactor - public final function getResizeFactorElement ($el) { - if (isset($this->resizeFactorArray[$el])) { - // Element gefunden - return $this->resizeFactorArray[$el]; - } else { - // Element nicht gefunden! - return null; - } - } - - // Setter-Methode fuer Element in resizeFactor - public final function setResizeFactorElement ($el, $value) { - $this->resizeFactorArray[$el] = (float) $value; - } - - // Kontrolliert, ob die Abmasse Schiffsteil->Schiff stimmen - public function isShipPartSizeValid () { - return ( - ( - ( // Already defined ship messurings - ($this->getCurrPart()->getWidth() < $this->currShip->getWidth()) - && ($this->getCurrPart()->getHeight() < $this->currShip->getDraught()) - && ($this->getCurrPart()->getLength() < $this->currShip->getLength()) - ) || ( // Ship messurings shall be calculated - ($this->currShip->getWidth() == 0) - && ($this->currShip->getHeight() == 0) - && ($this->currShip->getLength() == 0) - ) - // The inserted part must be messured! - ) && ($this->getCurrPart()->getWidth() > 0) - && ($this->getCurrPart()->getHeight() > 0) - && ($this->getCurrPart()->getLength() > 0) - ); - } - - // Kontrolliert, ob die Abmasse Maschinenraum->Schiff stimmen - public function isNewSizeValid () { - return ( - ( // Already defined ship messurings - ($this->newWidth < $this->currShip->getWidth()) - && ($this->newHeight < $this->currShip->getDraught()) - && ($this->newLength < $this->currShip->getLength()) - ) || ( // Ship messurings shall be calculated - ($this->currShip->getWidth() == 0) - && ($this->currShip->getHeight() == 0) - && ($this->currShip->getLength() == 0) - ) - ); - } - - // Masse extrahieren - public function extractDimensions ($dim) { - // Abmasse setzen - if ((isset($dim)) && (is_array($dim)) && (count($dim) == 3)) { - // Abmasse aus Array holen - $this->setWidth($dim[0]); - $this->setHeight($dim[1]); - $this->setLength($dim[2]); - } else { - // Nicht gefundene Abmasse! - throw new DimNotFoundInArrayException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); - } - } - - /** - * Getter for current part instance - * - * @return $currPart Instance of the current ship part object - */ - public final function getCurrPart () { - return $this->currPart; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/class_Merchant.php b/application/ship-simu/main/class_Merchant.php deleted file mode 100644 index 648e299..0000000 --- a/application/ship-simu/main/class_Merchant.php +++ /dev/null @@ -1,109 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Merchant extends BaseFrameworkSystem { - // Name des Haendlers - private $merchantName = "Namenloser Händler"; - - // Preislite (Objekte wiedermal!) - private $priceList = null; - - // Zugewiesener Hafen - private $harborInstance = null; - - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Haendler mit Namen erzeugen - public static final function createMerchant ($merchantName, Harbor $harborInstance) { - // String absichern - $merchantName = (string) $merchantName; - - // Get new instance - $merchantInstance = new Merchant(); - - // Debug message - if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) { - $merchantInstance->debugOutput(sprintf("[%s:%d] Ein Händler %s wird angelegt und soll sich am %s niederlassen.", - __CLASS__, - __LINE__, - $merchantName, - $harborInstance->getHarborName() - )); - } - - // Haendlernamen setzen - $merchantInstance->setMerchantName($merchantName); - - // In dem angegebenen Hafen den Haendler ansiedeln - $merchantInstance->setHarborInstance($harborInstance); - - // Preisliste initialisieren - $merchantInstance->createPriceList(); - - // Instanz zurueckliefern - return $merchantInstance; - } - - // Initialize pricing list - private function createPriceList () { - $this->priceList = new FrameworkArrayObject("FakedPriceList"); - } - - // Setter for merchant name - public final function setMerchantName ($merchantName) { - // Debug message - $this->merchantName = (string) $merchantName; - } - - // Getter for merchant name - public final function getMerchantName () { - return $this->merchantName; - } - - // Setter for harbor instance - public final function setHarborInstance (Harbor $harborInstance) { - $this->harborInstance = $harborInstance; - } - - // Getter for harbor instance - public final function getHarborInstance () { - return $this->harborInstance; - } - - // Add new item to merchant's price list - public function addItemToPriceList (TradeableItem $itemInstance, $price) { - $this->makeDeprecated(); - } - - // Get a price from the merchant's list - public final function getPriceFromList (TradeableItem $itemInstance) { - $this->makeDeprecated(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php deleted file mode 100644 index bbe2f35..0000000 --- a/application/ship-simu/main/class_WorksContract.php +++ /dev/null @@ -1,329 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WorksContract extends BaseFrameworkSystem implements SignableContract { - // Zukuenftiger Schiffsname - private $shipName = ""; - - // Instanz zum Schiffstypen - private $shipInstance = null; - - // Contract partner - private $contractPartner = null; - - // Other contract partner - private $contractParty = null; - - // Is the contract signed? - private $signed = false; - - // Merchant instance - private $merchantInstance = null; - - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Neuen Bauvertrag generieren - public static final function createWorksContract ($shipType, $shipName, ContractPartner $partnerInstance) { - // Strings absichern - $shipType = (string) $shipType; - $shipName = (string) $shipName; - - // Get new instance - $contractInstance = new WorksContract(); - - // Schiffsnamen setzen - $contractInstance->setShipName($shipName); - - // Existiert die Klasse ueberhaupt? - if (!class_exists($shipType)) { - // Klasse nicht gefunden - throw new NoClassException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND); - } - - // Schiff-Instanz temporaer erzeugen und in den Bauvertrag einfuegen - $shipInstance = ObjectFactory::createObjectByName($shipType, array($shipName)); - $contractInstance->setShipInstance($shipInstance); - - // Remove the ship instance - unset($shipInstance); - - // Set itself as contract partner - $contractInstance->setContractPartner($partnerInstance); - - // Instanz zurueckgeben - return $contractInstance; - } - - // Setter for ship instance - private final function setShipInstance (ConstructableShip $shipInstance) { - $this->shipInstance = $shipInstance; - } - - // Setter for ship name - private final function setShipName ($shipName) { - $this->shipName = (string) $shipName; - } - - // Getter for ship name - public final function getShipName () { - return $this->shipName; - } - - // Getter for ship instance - public final function getShipInstance () { - return $this->shipInstance; - } - - // Add detail to the contract - public function addContractDetails ($shipPart, $parentPart, array $dataArray) { - // Secure strings - $shipPart = (string) $shipPart; - $parentPart = (string) $parentPart; - - // Debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiffsteil %s wird zusammen mit dem Konstruktionsteil %s in den Bauvertrag aufgenommen.", - __CLASS__, - __LINE__, - $shipPart, - $parentPart - )); - - // Initialize the instance (shall not be done within dynamic part) - $partInstance = null; - - // Try to get an instance for this ship part - try { - $partInstance = ObjectFactory::createObjectByName($shipPart, $dataArray); - } catch (DimNotFoundInArrayException $e) { - $this->debugOutput(sprintf("[main:] Die %s konnte nicht vervollständigt werden. Grund: %s
", - $this->getShipInstance()->getShipName(), - $e->getMessage() - )); - - // Debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.", - __CLASS__, - __LINE__ - )); - - // Is this ship part constructable? - if (!$partInstance instanceof ConstructableShipPart) { - // Ship part not constructable! - throw new ShipPartNotConstructableException(array($shipPart), self::EXCEPTION_NOT_CONSTRUCTABLE); - } elseif ($this->getShipInstance()->createShipPart($partInstance, $parentPart) === false) { - // Schiff konnte nicht gebaut werden! - throw new ShipNotConstructedException(sprintf("Das Schiff %s konnte wegen eines Fehlers nicht gebaut werden. Siehe obere Meldungen.", - $this->getShipInstance()->getShipName() - )); - } - } catch (NoClassException $e) { - // Throw it again... - throw new NoClassException($e->getMessage(), $e->getCode()); - } - - // Get price for this item - $price = $this->getMerchantInstance()->getPriceFromList($partInstance); - - // Add price - $partInstance->setPrice($price); - } - - // Setter for contract partner - public final function setContractPartner (ContractPartner $partnerInstance) { - $this->contractPartner = $partnerInstance; - } - - // Getter for contract partner - public final function getContractPartner () { - return $this->contractPartner; - } - - // Setter for contract party - public final function setContractParty (ContractPartner $partyInstance) { - $this->contractParty = $partyInstance; - } - - // Getter for contract party - public final function getContractParty () { - return $this->contractParty; - } - - // Setter for signature - public final function setSigned ($signed) { - $this->signed = (boolean) $signed; - } - - // Getter for signature - public function isSigned () { - return $this->signed; - } - - // Sign the contract - public function signContract (ContractPartner $partnerInstance, ContractPartner $partyInstance) { - // Is this contract already signed? - if ($this->isSigned()) { - // Throw an exception - throw new ContractAllreadySignedException(array($this, $this->getContractPartner(), $this->getContractParty()), self::EXCEPTION_CONTRACT_ALREADY_SIGNED); - } - - // Is the first contract partner still the same? - if ($partnerInstance->equals($this->getContractPartner())) { - // Set contract party (other partner is already set) - $this->setContractParty($partyInstance); - - // Finally sign it - $this->setSigned(true); - } else { - // Throw an exception - throw new ContractPartnerMismatchException(array($this, $this->getContractPartner(), $partyInstance), self::EXCEPTION_CONTRACT_PARTNER_MISMATCH); - } - - // Debug message - if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) { - if ($partnerInstance->equals($partyInstance)) { - // With itself - $this->debugOutput(sprintf("[%s:%d] Die %s %s stimmt einem Bauvertrag über das %s %s zu.", - __CLASS__, - __LINE__, - $partnerInstance->getObjectDescription(), - $partnerInstance->getCompanyName(), - $this->getShipInstance()->getObjectDescription(), - $this->getShipInstance()->getShipName() - )); - } else { - // Other contract party - $this->debugOutput(sprintf("[%s:%d] Die %s %s geht mit der %s %s einen Bauvertrag über das %s %s ein.", - __CLASS__, - __LINE__, - $partnerInstance->getObjectDescription(), - $partnerInstance->getCompanyName(), - $partyInstance->getObjectDescription(), - $partyInstance->getCompanyName(), - $this->getShipInstance()->getObjectDescription(), - $this->getShipInstance()->getShipName() - )); - } - } - } - - // Setter for merchant instance - public final function setMerchantInstance (Merchant $merchantInstance) { - $this->merchantInstance = $merchantInstance; - } - - // Getter for merchant instance - public final function getMerchantInstance () { - return $this->merchantInstance; - } - - // Getter for total price - public final function getTotalPrice () { - // Get ship instance - $shipInstance = $this->getShipInstance(); - - // Is this a ship? - if (is_null($shipInstance)) { - // Opps! Empty partner instance? - throw new NullPointerException($shipInstance, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($shipInstance)) { - // Not an object! ;-( - throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipInstance instanceof ConstructableShip) { - // Does not have the required feature (method) - throw new ShipIsInvalidException(array($shipInstance), self::EXCEPTION_INVALID_SHIP_INSTANCE); - } - - // Get the structure array - $struct = $shipInstance->getStructuresArray(); - - // Is this a ship? - if (is_null($struct)) { - // Opps! Empty partner instance? - throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY); - } - - // Init total price - $totalPrice = 0; - - // Iterate through the list - for ($iter = $struct->getIterator(); $iter->valid(); $iter->next()) { - // Get item - $item = $iter->current(); - - // Is this a ship? - if (is_null($item)) { - // Opps! Empty partner instance? - throw new NullPointerException($item, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($item)) { - // Not an object! ;-( - throw new InvalidObjectException($item, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$item instanceof BaseSimulator) { - // Does not have the required feature (method) - throw new MissingMethodException(array($item, 'getPartInstance'), self::EXCEPTION_MISSING_METHOD); - } - - // Get part instance - $part = $item->getPartInstance(); - - // Is this a ship? - if (is_null($part)) { - // Opps! Empty partner instance? - throw new NullPointerException($part, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($part)) { - // Not an object! ;-( - throw new InvalidObjectException($part, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!method_exists($part, 'getPrice')) { - // Does not have the required feature (method) - throw new MissingMethodException(array($part, 'getPrice'), self::EXCEPTION_MISSING_METHOD); - } - - // Get price for one item - $price = $part->getPrice(); - - // Is there numCabin() available? - if (method_exists($item, 'getNumCabin')) { - // Get total cabin and multiply it with the price - $price = $price * $item->getNumCabin(); - } - - // Add price to total price - $totalPrice += $price; - } - - // Total price calculated? - if ($totalPrice === 0) { - // Throw exception - throw new TotalPriceNotCalculatedException($this, self::EXCEPTION_TOTAL_PRICE_NOT_CALCULATED); - } - - // Return total price - return $totalPrice; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/.htaccess b/application/ship-simu/main/commands/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/commands/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/commands/web/.htaccess b/application/ship-simu/main/commands/web/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/commands/web/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php deleted file mode 100644 index 14015a3..0000000 --- a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php +++ /dev/null @@ -1,112 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipsimuGuestLoginCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipsimuGuestLoginCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // First get a GuestLogin instance - $loginInstance = ObjectFactory::createObjectByConfiguredName('guest_login_class'); - - // First set request and response instance - $loginInstance->setRequestInstance($requestInstance); - - // Encrypt the password - $loginInstance->encryptPassword('passwd'); - - // Do the login here - $loginInstance->doLogin($requestInstance, $responseInstance); - - // Was the login fine? Then redirect here - if ($loginInstance->ifLoginWasSuccessfull()) { - // Try to redirect here - try { - // Redirect... - $responseInstance->redirectToConfiguredUrl('app_login'); - - // Exit here - exit(); - } catch (FrameworkException $e) { - // Something went wrong here! - $responseInstance->addFatalMessage($e->getMessage()); - } - } else { - // Attach error message to the response - $responseInstance->addFatalMessage('failed_user_login'); - } - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add more filters - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add username verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter')); - - // Add password verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter')); - - // Add CAPTCHA verifier code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php deleted file mode 100644 index a266f26..0000000 --- a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php +++ /dev/null @@ -1,153 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuProfileCommand extends BaseCommand implements Commandable { - /** - * Filtered request data - */ - private $requestData = array(); - - /** - * Allowed profile data to pass through - */ - private $allowedData = array( - 'pass' => 'pass1', - 'email' => 'email1', - 'surname', - 'family', - 'street', - 'city', - 'zip', - 'icq', - 'jabber', - 'yahoo', - 'aol', - 'msn', - 'rules', - 'birth_day', - 'birth_month', - 'birth_year' - ); - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipsimuProfileCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Add functionality here - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Make sure only allowed values are comming through - foreach ($this->allowedData as $alias => $element) { - // Get data - $data = $requestInstance->getRequestElement($element); - - // Silently skip empty fields - if (empty($data)) continue; - - // Do we have an alias? - if (is_string($alias)) { - // Yes, so use it - $this->requestData[$alias] = $data; - } else { - // No, default entry - $this->requestData[$element] = $data; - } - } // END - foreach - - // Remove the array, we don't need it anymore - unset($this->allowedData); - - // Unfinished! - $this->partialStub("Unfinished work."); - $this->debugBackTrace(); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some more pre/post filters to the controller - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // User status filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // User status if not 'guest' filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_guest_filter')); - - // Updated rules accepted - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); - - // Account password validation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); - - // Validate CAPTCHA input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter')); - - // Validate birthday input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter')); - - // Email changed - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter')); - - // Password changed - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php deleted file mode 100644 index 1c9bd8e..0000000 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php +++ /dev/null @@ -1,112 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuRefillCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipsimuRefillCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipsimuRefillCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get template instance - $templateInstance = $responseInstance->getTemplateInstance(); - - // Set amount and type as variables - $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type')); - $templateInstance->assignVariable('amount' , $requestInstance->getRequestElement('amount')); - - // This method does currently redirect if all goes right. Booking is done in filters - $responseInstance->redirectToConfiguredUrl('refill_page_done'); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Is the refill page active? - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); - - // Verify password - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); - - // Verify CAPTCHA code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); - - // Verify refill request - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter')); - - // Construct config entry for wether automatic payment from API or waiting for approval - $paymentTypeConfig = sprintf("refill_request_%s_payment_type", $requestInstance->getRequestElement('type')); - - // Prepare a filter based on the requested type we shall refill - $filterName = sprintf("refill_request_%s_%s_book_filter", - $requestInstance->getRequestElement('type'), - $this->getConfigInstance()->getConfigEntry($paymentTypeConfig) - ); - - // Now, try to load that filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName($filterName)); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php deleted file mode 100644 index 181ce2f..0000000 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipsimuRegisterCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipsimuRegisterCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // First get a UserRegistration instance - $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class'); - - // First set request and response instance - $registerInstance->setRequestInstance($requestInstance); - $registerInstance->setResponseInstance($responseInstance); - - // Encrypt the password - $registerInstance->encryptPassword('pass1'); - - // Do things before registration - $registerInstance->doPreRegistration(); - - // Register the new user - $registerInstance->registerNewUser(); - - // Do things after registration like notifying partner pages or queueing - // them for notification - $registerInstance->doPostRegistration(); - - // Redirect or login after registration - $registerInstance->doPostAction(); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add some more pre/post filters to the controller - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Validate email address (if configured: check on double email addresses) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter')); - - // Validate username and check if it does not exist - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter')); - - // Validate if username is "guest" and not taken - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter')); - - // Validate if password is set - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter')); - - // Check if rules where accepted - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); - - // Validate CAPTCHA input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter')); - - // Validate birthday - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php deleted file mode 100644 index 2a33a8f..0000000 --- a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php +++ /dev/null @@ -1,124 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipsimuUserLoginCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipsimuUserLoginCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // First get a UserLogin instance - $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class'); - - // First set request and response instance - $loginInstance->setRequestInstance($requestInstance); - - // Encrypt the password - $loginInstance->encryptPassword('pass'); - - // Do the login here - $loginInstance->doLogin($requestInstance, $responseInstance); - - // Was the login fine? Then redirect here - if ($loginInstance->ifLoginWasSuccessfull()) { - // Try to redirect here - try { - // Redirect... - $responseInstance->redirectToConfiguredUrl('app_login'); - - // Exit here - exit(); - } catch (FrameworkException $e) { - // Something went wrong here! - $responseInstance->addFatalMessage($e->getMessage()); - } - } else { - // Attach error message to the response - $responseInstance->addFatalMessage('failed_user_login'); - } - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Add more filters - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Which login type do we have? - switch ($this->getConfigInstance()->getConfigEntry('login_type')) { - case 'username': // Login via username - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter')); - break; - - case 'email': // Login via email - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter')); - break; - - default: // Wether username or email is set - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter')); - break; - } - - // Password verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter')); - - // Add filter for CAPTCHA - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/company/.htaccess b/application/ship-simu/main/commands/web/company/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/commands/web/company/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/commands/web/company/class_WebShipSimuCompanyCommand.php b/application/ship-simu/main/commands/web/company/class_WebShipSimuCompanyCommand.php deleted file mode 100644 index 7fed46f..0000000 --- a/application/ship-simu/main/commands/web/company/class_WebShipSimuCompanyCommand.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipSimuCompanyCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this command and sets the resolver instance - * - * @param $resolverInstance An instance of a command resolver - * @return $commandInstance The created command instance - */ - public static final function createWebShipSimuCompanyCommand (CommandResolver $resolverInstance) { - // Get a new instance - $commandInstance = new WebShipSimuCompanyCommand(); - - // Set the resolver instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get template instance - $templateInstance = $responseInstance->getTemplateInstance(); - - // Set amount and type as variables - $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type')); - $templateInstance->assignVariable('amount' , $requestInstance->getRequestElement('amount')); - - // This method does currently redirect if all goes right - $responseInstance->redirectToConfiguredUrl('refill_page_done'); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/government/.htaccess b/application/ship-simu/main/commands/web/government/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/commands/web/government/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php b/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php deleted file mode 100644 index e720850..0000000 --- a/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebGovernmentFailedStartupCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class - */ - public static final function createWebGovernmentFailedStartupCommand (CommandResolver $resolverInstance) { - // Get new instance - $commandInstance = new WebGovernmentFailedStartupCommand(); - - // Set the application instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the given command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get the action instance from registry - $actionInstance = Registry::getRegistry()->getInstance('action'); - - // Do we have an action here? - if ($actionInstance instanceof PerformableAction) { - // Execute the action (shall not output anything, see below why) - $actionInstance->execute($requestInstance, $responseInstance); - } // END - if - - // Get the application instance - $appInstance = $this->getResolverInstance()->getApplicationInstance(); - - // Prepare a template instance - $templateInstance = $this->prepareTemplateInstance($appInstance); - - // Assign base URL - $templateInstance->assignConfigVariable('base_url'); - - // Assign all the application's data with template variables - $templateInstance->assignApplicationData($appInstance); - - // Load the master template - $masterTemplate = $appInstance->buildMasterTemplateName(); - - // Load header template - $templateInstance->loadCodeTemplate('header'); - - // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('header', 'header'); - - // Load footer template - $templateInstance->loadCodeTemplate('footer'); - - // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('footer', 'footer'); - - // Load main template - $templateInstance->loadCodeTemplate('government_failed_main'); - - // Assign the main template with the master template as a content ... ;) - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('government_failed_main', 'content'); - - // Load the master template - $templateInstance->loadCodeTemplate($masterTemplate); - - // Set title - $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('page') . '_' . $requestInstance->getRequestElement('failed') . '_title')); - - // Construct the menu in every command. We could do this in BaseCommand class. But this means - // *every* command has a navigation system and that is want we don't want. - $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance)); - - // Render the menu - $menuInstance->renderMenu(); - - // Transfer it to the template engine instance - $menuInstance->transferContentToTemplateEngine(); - - // ... and all variables. This should be merged together in a pattern - // to make things easier. A cache mechanism should be added between - // these two calls to cache compiled templates. - $templateInstance->compileVariables(); - - // Get the content back from the template engine and put it in response class - $templateInstance->transferToResponse($responseInstance); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Maybe we need some filters here? - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Empty for now - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php b/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php deleted file mode 100644 index 45bcc32..0000000 --- a/application/ship-simu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebGovernmentFailedTrainingCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class - */ - public static final function createWebGovernmentFailedTrainingCommand (CommandResolver $resolverInstance) { - // Get new instance - $commandInstance = new WebGovernmentFailedTrainingCommand(); - - // Set the application instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the given command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get the action instance from registry - $actionInstance = Registry::getRegistry()->getInstance('action'); - - // Do we have an action here? - if ($actionInstance instanceof PerformableAction) { - // Execute the action (shall not output anything, see below why) - $actionInstance->execute($requestInstance, $responseInstance); - } // END - if - - // Get the application instance - $appInstance = $this->getResolverInstance()->getApplicationInstance(); - - // Prepare a template instance - $templateInstance = $this->prepareTemplateInstance($appInstance); - - // Assign base URL - $templateInstance->assignConfigVariable('base_url'); - - // Assign all the application's data with template variables - $templateInstance->assignApplicationData($appInstance); - - // Load the master template - $masterTemplate = $appInstance->buildMasterTemplateName(); - - // Load header template - $templateInstance->loadCodeTemplate('header'); - - // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('header', 'header'); - - // Load footer template - $templateInstance->loadCodeTemplate('footer'); - - // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('footer', 'footer'); - - // Load main template - $templateInstance->loadCodeTemplate('government_failed_main'); - - // Assign the main template with the master template as a content ... ;) - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('government_failed_main', 'content'); - - // Load the master template - $templateInstance->loadCodeTemplate($masterTemplate); - - // Set title - $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('page') . '_' . $requestInstance->getRequestElement('failed') . '_title')); - - // Construct the menu in every command. We could do this in BaseCommand class. But this means - // *every* command has a navigation system and that is want we don't want. - $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance)); - - // Render the menu - $menuInstance->renderMenu(); - - // Transfer it to the template engine instance - $menuInstance->transferContentToTemplateEngine(); - - // ... and all variables. This should be merged together in a pattern - // to make things easier. A cache mechanism should be added between - // these two calls to cache compiled templates. - $templateInstance->compileVariables(); - - // Get the content back from the template engine and put it in response class - $templateInstance->transferToResponse($responseInstance); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Maybe we need some filters here? - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Empty for now - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php b/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php deleted file mode 100644 index 3153962..0000000 --- a/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php +++ /dev/null @@ -1,96 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuGovernmentStartupCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class - */ - public static final function createWebShipsimuGovernmentStartupCommand (CommandResolver $resolverInstance) { - // Get new instance - $commandInstance = new WebShipsimuGovernmentStartupCommand(); - - // Set the application instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the given command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get a wrapper instance - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); - - // Register the startup help - $wrapperInstance->registerStartupHelpByRequest($requestInstance); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Maybe we need some filters here? - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Check if government can pay startup help - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter')); - - // Verify password - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); - - // Verify CAPTCHA code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_government_verifier_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php b/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php deleted file mode 100644 index 035e5e8..0000000 --- a/application/ship-simu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebShipsimuGovernmentTrainingCommand extends BaseCommand implements Commandable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $commandInstance An instance a prepared command class - */ - public static final function createWebShipsimuGovernmentTrainingCommand (CommandResolver $resolverInstance) { - // Get new instance - $commandInstance = new WebShipsimuGovernmentTrainingCommand(); - - // Set the application instance - $commandInstance->setResolverInstance($resolverInstance); - - // Return the prepared instance - return $commandInstance; - } - - /** - * Executes the given command with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Get a wrapper instance - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); - - // Register the training - $wrapperInstance->registerTrainingByRequest($requestInstance); - } - - /** - * Adds extra filters to the given controller instance - * - * @param $controllerInstance A controller instance - * @param $requestInstance An instance of a class with an Requestable interface - * @return void - * @todo Maybe we need some filters here? - */ - public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - - // Check if government can pay training help - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter')); - - // Verify password - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); - - // Verify CAPTCHA code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/companies/.htaccess b/application/ship-simu/main/companies/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/companies/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php deleted file mode 100644 index de959b6..0000000 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ /dev/null @@ -1,666 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShippingCompany extends BaseSimulator implements Customer, ContractPartner { - /** - * Full name of this company - */ - private $companyName = "Namenlose Reederei"; - - /** - * Shorted name of this company - */ - private $shortName = ""; - - /** - * Instance of the founder - */ - private $founderInstance = null; - - /** - * Headquarter harbor instance - */ - private $hqInstance = null; - - /** - * Employed people by this company - */ - private $employeeList = null; - - /** - * List of all assigned shipyards - */ - private $shipyardList = null; - - /** - * List of owned ships - */ - private $ownedShips = null; - - /** - * Work constracts this company is currently working on - */ - private $contractList = null; - - // Exception constants - const EXCEPTION_USER_OWNS_NO_COMPANY = 0x200; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this company class or throws an exception if the - * given user owns no company. - * - * @param $userInstance A user class - * @return $companyInstance Prepared company instance - * @todo Add functionality if user participates in a company - */ - public static final function createShippingCompany (ManageableAccount $userInstance) { - // Get new instance - $companyInstance = new ShippingCompany(); - - // Does the given user owns a company? - if ($companyInstance->ifUserParticipatesInCompany($userInstance)) { - // Then do some nasty caching here but don't throw an exception - // because then you will hurt our web helpers... :/ - $companyInstance->partialStub("Don't throw exceptions here."); - } // END - if - - // Init all lists - $companyInstance->initCompanyLists(); - - // Return instance - return $companyInstance; - } - - /** - * Checks wether the given user participates in a company - * - * @param $userInstance An instance of a user class - * @return $participates Wether the user participates at lease in one company - */ - protected function ifUserParticipatesInCompany (ManageableAccount $userInstance) { - // By default no user owns any company... ;) - $participates = false; - - // Get a company database wrapper class - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class', array($this)); - - // Ask the wrapper if this user participates - $participates = $wrapperInstance->ifUserParticipatesInCompany($userInstance); - - // Get the result instance - $resultInstance = $wrapperInstance->getResultInstance(); - - // Caches the result instance here, if set (we don't the wrapper anymore!) - if ($resultInstance instanceof SearchableResult) { - // Set the result instance - $this->setResultInstance($resultInstance); - } // END - if - - // Return result - return $participates; - } - - /** - * Checks wether the current user in registry is the company founder - * - * @return $isFounder Wether the current user is the company founder - * @todo Check if user is company founder - */ - public function ifUserIsFounder () { - // Default is not the founder - $isFounder = false; - - // Get result instance - $resultInstance = $this->getResultInstance(); - - // Is it set? - if ($resultInstance instanceof SearchableResult) { - // Result found so analyse it - $this->partialStub("Check if user is company founder."); - } // END - if - - // Return result - return $isFounder; - } - - /** - * Checks wether the current user in registry is the company owner - * - * @return $isOwner Wether the current user is the company owner - * @todo Check if user is company owner - */ - public function ifUserIsOwner () { - // Default is not the owner - $isOwner = false; - - // Get result instance - $resultInstance = $this->getResultInstance(); - - // Is it set? - if ($resultInstance instanceof SearchableResult) { - // Result found so analyse it - $this->partialStub("Check if user is company owner."); - } // END - if - - // Return result - return $isOwner; - } - - /** - * Checks wether the current user in registry is an employee in this company - * - * @return $isOwner Wether the current user is an employee in this company - */ - public function ifUserIsEmployee () { - // Default is no employee - $isEmployee = false; - - // Get result instance - $resultInstance = $this->getResultInstance(); - - // Is it set? - if ($resultInstance instanceof SearchableResult) { - // Result found so he is employee - $isEmployee = true; - } // END - if - - // Return result - return $isEmployee; - } - - //------------------------------------------------------------------------------\ - // Below here is very old code which needs to be translated and changed heavily | - //------------------------------------------------------------------------------/ - - /** - * Intialize all lists - * - * @return void - * @todo Maybe we don't need these big lists anymore?! So we can deprecate/remove it - */ - protected function initCompanyLists () { - // Employees - $this->employeeList = new FrameworkArrayObject("FakedEmployeeList"); - - // Ship yards - $this->shipyardList = new FrameworkArrayObject("FakedShipyardList"); - - // Contracts - $this->contractList = new FrameworkArrayObject("FakedContractList"); - } - - // Setter-Methode fuer Firmennamen - public final function setCompanyName ($companyName) { - $this->companyName = (string) $companyName; - } - - // Getter-Methode fuer Firmennamen - public final function getCompanyName () { - return $this->companyName; - } - - // Setter-Methode fuer Firmensitz - public final function setHQInstance (Harbor $hqInstance) { - $this->hqInstance = $hqInstance; - } - - // Kuerzel setzen - private function initShortName () { - // Mindestens eine Leerstelle? - $dummy = explode(" ", $this->getCompanyName()); - foreach ($dummy as $part) { - $this->shortName .= substr($part, 0, 1); - } // END - if - } - - // Reedereien Werften bauen lassen - public function createShipyardInHarbor($shipyardName, Harbor $harborInstance) { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s baut im %s eine Werft %s.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $harborInstance->getHarborName(), - $shipyardName - )); - - // Wird im HQ gebaut? - if ($this->hqInstance->equals($harborInstance)) { - // Die neue Werft wird im HQ gebaut! - $this->hqInstance->addNewShipyardNotify($shipyardName, $this); - // Die Werft drueber in Kenntnis setzen, welcher Reederei sie angehoert - } else { - // Ausserhalb des Heimathafens soll eine Werft gebaut werden - $harborInstance->addNewShipyardNotify($shipyardName, $this); - } - } - - // Setter fuer Reederei-Gruender - public final function setCompanyFounder(CompanyEmployee $founderInstance) { - $this->founderInstance = $founderInstance; - } - - // Getter for founder instance - public final function getFounderInstance () { - return $this->founderInstance; - } - - // Neue(n) Angestellte(n) in Angestellten-Liste aufnehmen - public function addNewEmployee (SimulatorPersonell $employeeInstance) { - $this->employeeList->append($employeeInstance); - } - - // Neue Werft in Liste aufnehmen - public function addNewShipyard (Shipyard $shipyardInstance) { - $this->shipyardList->append($shipyardInstance); - } - - // Neue Mitarbeiter per Zufall einstellen/rekrutieren - public function recruitRandomEmployees($amount, SimulatorPersonell $personellInstance) { - // Anzahl Mitarbeiter absichern - $amount = (int) $amount; - - // Debug-Meldung ausgeben - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s stellt per Zufall %d neue Mitarbeiter ein.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $amount - )); - - // Gesamtanzahl verfuegbarer Erwerbsloser holen - $totalUnemployed = $personellInstance->getAllUnemployed(); - - // Existiert die gewuenschte Anzahl freier Arbeiter? (doppelt geht derzeit nicht) - if ($totalUnemployed < $amount) { - // Reichte nicht aus! - throw new ToMuchEmployeesException(array($amount, $personellInstance->getAllUnemployed()), self::EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES); - } // END - if - - // Get list for all unemployed people - $list = $personellInstance->getSpecialPersonellList(false); // Should be cached - - // Get iterator of the list - $iterator = $list->getIterator(); - - // Get the requested amount of personell - for ($idx = 0; $idx < $amount; $idx++) { - $employee = null; - // Is this personl unemployed? - while (is_null($employee) || $employee->isEmployed()) { - // Generate random number - $pos = mt_rand(0, ($totalUnemployed - 1)); // Don't remove the -1 here: - // E.g. 100 entries means latest position is 99... - - // Seek for the position - $iterator->seek($pos); - - // Is the current position valid? - if ($iterator->valid() === false) { - // Should normally not happen... :( - throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS); - } // END - if - - // Get current element - $employee = $iterator->current(); - } // END - while - - // A dummy just for the description and real class - $dummy = CompanyEmployee::createCompanyEmployee("", "", "M", 1970, 1, 1, $employee->isMarried(), 0); - - // Make this person employed and give him some money to work - $employee->setEmployed(true); - $employee->setRealClass($dummy->__toString()); - $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay? - - // Debug message - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s stellt den/die Angestellte(n) %s %s ein.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $employee->getSurname(), - $employee->getFamily() - )); - - // Add this employee - $this->addNewEmployee($employee); - } // End - for - - // Cache resetten - $personellInstance->resetCache(); - - // Debug-Meldung ausgeben - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat per Zufall %d neue Mitarbeiter eingestellt.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $amount - )); - } // End - method - - // Distribute all personells on all shipyards - public function distributeAllPersonellOnShipyards () { - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s verteilt alle ihre %d Mitarbeiter auf alle %d Werft(en).", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $this->getTotalEmployee(), - $this->getTotalShipyards() - )); - - // Do we have some shipyards? - if (is_null($this->shipyardList)) { - // No shipyards created - throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS); - } - - // Get iterator for shipyards - $shipyardIter = $this->shipyardList->getIterator(); - - // Iterate through all employees - for ($idx = $this->employeeList->getIterator(); $idx->valid(); $idx->next()) { - // Is the shipyard iterator still okay? - if ($shipyardIter->valid() === false) { - // Rewind to first position - $shipyardIter->seek(0); - } // END - if - - // Get Shipyard object - $shipyard = $shipyardIter->current(); - - // Is this a Shipyard object? - if (is_null($shipyard)) { - // No class returned - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($shipyard)) { - // Not an object! ;-( - throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif ($shipyard->isClass("Shipyard") === false) { - // Nope, so throw exception - throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); - } - - // Add employee to the shipyard - $shipyard->addNewPersonell($idx->current()); - - // Continue to next shipyard - $shipyardIter->next(); - } - } - - // Getter for total employees - public final function getTotalEmployee () { - // Count all... - $total = $this->employeeList->count(); - - // Debug message - if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat %d Mitarbeiter.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $total - )); - - // Return amount - return $total; - } - - // Getter for total shipyards - public final function getTotalShipyards () { - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Für die Reederei %s werden die Anzahl der Werften in allen Häfen ermittelt.", - __CLASS__, - __LINE__, - $this->getCompanyName() - )); - - // Do we have some shipyards? - if (is_null($this->shipyardList)) { - // No shipyards created - throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS); - } - - // Get iterator - $total = $this->shipyardList->count(); - - // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat %d Werft(en).", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $total - )); - - // Return amount - return $total; - } - - // Add a ship type (class) to all shipyards - public function addShipTypeToAllShipyards ($shipType) { - // Secure strings - $shipType = (string) $shipType; - - // Is the class there? - if (!class_exists($shipType)) { - // Throw exception - throw new NoClassException($shipType, self::EXCEPTION_CLASS_NOT_FOUND); - } - - // Create dummy ship - eval(sprintf("\$shipInstance = %s::create%s(\"M/S Dummy\");", - $shipType, - $shipType - )); - - // Iterate shipyard list - for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { - // Get current element - $shipyard = $idx->current(); - - // Is this a shipyard? - if (is_null($shipyard)) { - // Opps! Empty list? - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($shipyard)) { - // Not an object! ;-( - throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif ($shipyard->isClass("Shipyard") === false) { - // Class is not a shipyard - throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); - } - - // Add the new ship type to the shipyard - $shipyard->addNewConstructableShipType($shipType); - } // END - for - } - - // Validate the requested ship type with the company if they can construct it - public function validateWorksContractShipType (SignableContract $contractInstance) { - // First get the ship type - $shipInstance = $contractInstance->getShipInstance(); - - // Ist there a ship instance? - if (is_null($shipInstance)) { - // Opps! Empty entry? - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($shipInstance)) { - // Not an object! ;-( - throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); - } - - // Get it's real class name - $shipType = $shipInstance->__toString(); - - // Now check if ship type is in any list and return the result - return ($this->isShipTypeConstructable($shipType)); - } - - // Is the ship type constructable? - public function isShipTypeConstructable ($shipType) { - // The type must be a string! - $shipType = (string) $shipType; - - // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s fragt alle Werften ab, ob diese Schiffe vom Typ %s bauen können.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $shipType - )); - - // First everthing is failed... - $result = false; - - // Iterate through all shipyards - for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { - // Get current Shipyard instance - $shipyard = $idx->current(); - - // Is this a shipyard? - if (is_null($shipyard)) { - // Opps! Empty list? - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($shipyard)) { - // Not an object! ;-( - throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif ($shipyard->isClass("Shipyard") === false) { - // Class is not a shipyard - throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); - } - - // Validate if first found shipyard can construct the requested type - $result = $shipyard->isShipTypeConstructable($shipType); - - // Does this shipyard construct the requested ship type? - if ($result) break; // Then abort the search! - } // END - for - - // Debug message - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat die Suche nach einer Werft beendet, die Schiffe vom Typ %s bauen kann.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $shipType - )); - - // Return result - return $result; - } - - // As a customer the shipping company can add new contracts - public function addNewWorksContract (SignableContract $contractInstance) { - $this->contractList->append($contractInstance); - } - - // As a customer the shippng company can withdraw from a contract - public function withdrawFromContract (SignableContract $contractInstance) { - ApplicationEntryPoint::app_die("WITHDRAW:
".print_r($contractInstance, true)."
"); - } - - // Get latest added contract instance - public final function getLastContractInstance () { - // Get iterator - $iter = $this->contractList->getIterator(); - - // Get latest entry (total - 1) - $iter->seek($iter->count() - 1); - - // Return entry - return $iter->current(); - } - - // Sign a contract with an other party which must also implement Customer - public function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance) { - // Check wether the other party is our contract partner - if ($partnerInstance->isContractPartner($contractInstance) === false) { - // Invalid contract partner! - throw new InvalidContractPartnerException($partnerInstance, self::EXCEPTION_CONTRACT_PARTNER_INVALID); - } // END - if - - // Determine if company "signs" own contract (must be done) or with an other party - if ($this->equals($partnerInstance)) { - // With itself - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s erteilt an sich selbst einen Bauauftrag für das %s "%s".", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $contractInstance->getShipInstance()->getObjectDescription(), - $contractInstance->getShipInstance()->getShipName() - )); - } else { - // Other external company - if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s unterzeichnet einen Bauauftrag für das %s "%s" mit der %s.", - __CLASS__, - __LINE__, - $this->getCompanyName(), - $contractInstance->getShipInstance()->getObjectDescription(), - $contractInstance->getShipInstance()->getShipName(), - $partnerInstance->getCompanyName() - )); - } - - // Sign the contract - $contractInstance->signContract($this, $partnerInstance); - - /** - * @todo Maybe do something more here... - */ - } - - // Is this the right contract partner? - public function isContractPartner (SignableContract $contractInstance) { - // Get contract partner instance and compare it with $this contract partner - return ($this->equals($contractInstance->getContractPartner())); - } - - // Setter for merchant instance - public final function setMerchantInstance (Merchant $merchantInstance) { - // Get contract - $contractInstance = $this->getLastContractInstance(); - - if (is_null($contractInstance)) { - // Opps! Empty contract instance? - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($contractInstance)) { - // Not an object! ;-( - throw new InvalidObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif ($contractInstance->isClass("WorksContract") === false) { - // Is not a merchant - throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING); - } - - // Set the merchant in the contract (for getting prices) - $contractInstance->setMerchantInstance($merchantInstance); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/.htaccess b/application/ship-simu/main/constructions/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/berths/.htaccess b/application/ship-simu/main/constructions/berths/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/berths/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/berths/class_Berth.php b/application/ship-simu/main/constructions/berths/class_Berth.php deleted file mode 100644 index c96ba10..0000000 --- a/application/ship-simu/main/constructions/berths/class_Berth.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Berth extends BaseConstruction { - // Durchlaufende Nummer der Liegeplaetze - private $berthIndex = 0; - - // Zugewiesener Hafen - private $harborInstance = null; - - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/class_BaseConstruction.php b/application/ship-simu/main/constructions/class_BaseConstruction.php deleted file mode 100644 index af08a39..0000000 --- a/application/ship-simu/main/constructions/class_BaseConstruction.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseConstruction extends BaseSimulator { - // Tiefgang fuer z.B. Trockdocks - private $draught = 0; - - // Konstruktor - protected function __construct ($className) { - // Eltern-Konstrutor aufrufen - parent::__construct($className); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/docks/.htaccess b/application/ship-simu/main/constructions/docks/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/docks/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/docks/class_DryDock.php b/application/ship-simu/main/constructions/docks/class_DryDock.php deleted file mode 100644 index c9d6f8e..0000000 --- a/application/ship-simu/main/constructions/docks/class_DryDock.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class DryDock extends BaseConstruction { - // Zugewiesener Hafen - private $harborInstance = null; - - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/harbors/.htaccess b/application/ship-simu/main/constructions/harbors/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/harbors/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/harbors/class_Harbor.php b/application/ship-simu/main/constructions/harbors/class_Harbor.php deleted file mode 100644 index cf350ce..0000000 --- a/application/ship-simu/main/constructions/harbors/class_Harbor.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Harbor extends BaseConstruction { - // Namen des Hafens (z.B. Hamburger Hafen) - private $harborName = "Unbekannter Hafen"; - - // Schiffsliste aller gebauten Schiffe - private $constructedShips = null; - - // Liegeplatz-Liste - private $berthList = null; - - // List of all assigned shipyards - private $shipyardList = null; - - // Constructor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Creates a harbor - public static final function createHarbor ($harborName) { - // Hafen-Instanz holen - $harborInstance = new Harbor(); - - // Hafenname setzen - $harborInstance->setHarborName($harborName); - - // Werftliste initialisieren - $harborInstance->createshipyardList(); - - // Instanz zurueckliefern - return $harborInstance; - } - - // Werft-Liste generieren - public function createshipyardList () { - $this->shipyardList = new FrameworkArrayObject("FakedShipyardList"); - } - - // Setter fuer Hafennamen - public final function setHarborName ($harborName) { - $this->harborName = (string) $harborName; - } - - // Getter fuer Hafennamen - public final function getHarborName () { - return $this->harborName; - } - - // Werft in den Hafen einbauen und Werft->Reederei zuweisen - public function addNewShipyardNotify ($shipyardName, ShippingCompany $companyInstance) { - // Werft generieren und in die Werftliste aufnehmen - $this->shipyardList->append(Shipyard::createShipyardNotify($this, $shipyardName, $companyInstance)); - } - - // Werft in den Hafen einbauen ohne Zuweisung einer Reederei (gehoert der "Stadt" dann) - public function addNewShipyard ($shipyardName) { - // Werft generieren und in die Werftliste aufnehmen - $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName)); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/terminals/.htaccess b/application/ship-simu/main/constructions/terminals/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/terminals/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/terminals/class_Terminal.php b/application/ship-simu/main/constructions/terminals/class_Terminal.php deleted file mode 100644 index 9ae9985..0000000 --- a/application/ship-simu/main/constructions/terminals/class_Terminal.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Terminal extends BaseConstruction { - // Zugewiesener Hafen - private $harborInstance = null; - - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/constructions/yards/.htaccess b/application/ship-simu/main/constructions/yards/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/constructions/yards/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php deleted file mode 100644 index 1959f83..0000000 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ /dev/null @@ -1,215 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Shipyard extends BaseConstruction { - // Werft-Name - private $shipyardName = "Namenlose Werft"; - - // Arbeiter-Liste - private $staffList = null; - - // Queue-Liste fuer zu bauende Schiffe - private $queueList = null; - - // Aktuell im Bau befindliches Schiff - private $currShipInConst = null; - - // Liste konstruierbarer Schiffstypen - private $shipTypeList = null; - - // Zugewiesener Hafen - private $harborInstance = null; - - // Zugewiesene Reederei - private $shippingCompany = null; - - // Constructor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Staff-Liste/Schiffstyp-Liste erzeugen - $this->createStaffList(); - $this->createShipTypeList(); - } - - // Create a shipyard and notify it about it's owner - public static final function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) { - // Werft-Instanz holen - $shipyardInstance = self::createShipyard($harborInstance, $shipyardName); - - // Reederei der Werft zuweisen - $shipyardInstance->setCompanyInstance($companyInstance); - - // Die Reederei ueber ihre Werft informieren - $companyInstance->addNewShipyard($shipyardInstance); - - // Instanz zurueckgeben - return $shipyardInstance; - } - - // Create a shipyard, first we need to create a harbor - public static final function createShipyard (Harbor $harborInstance, $shipyardName) { - // Instanz temporaer holen - $shipyardInstance = new Shipyard(); - - // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.", - __CLASS__, - __LINE__, - $shipyardName, - $harborInstance->getHarborName() - )); - - // Werft-Name setzen - $shipyardInstance->setShipyardName($shipyardName); - - // Hafen-Instanz setzen - $shipyardInstance->setHarborInstance($harborInstance); - - // Abmasse setzen in Meter - $shipyardInstance->setWidth(30); - $shipyardInstance->setHeight(30); - $shipyardInstance->setLength(100); - - // Clean up a little - $shipyardInstance->removeDraught(); - - // Debug-Meldung - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft %s wurde gebaut.", - __CLASS__, - __LINE__, - $shipyardName - )); - - // Instanz zurueckliefern - return $shipyardInstance; - } - - // Create staff list - private function createStaffList () { - $this->staffList = new FrameworkArrayObject("FakedStaffList"); - } - - // Create ship type list - private function createShipTypeList () { - $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList"); - } - - // Setter-Methode fuer Werft-Name - public final function setShipyardName ($shipyardName) { - $this->shipyardName = (string) $shipyardName; - } - - // Getter-Methode fuer Werft-Name - public final function getShipyardName () { - return $this->shipyardName; - } - - // Setter-Methode fuer Hafen-Instanz - public final function setHarborInstance (Harbor $harborInstance) { - $this->harborInstance = $harborInstance; - } - - // Getter-Methode fuer Hafen-Instanz - public final function getHarborInstance () { - return $this->harborInstance; - } - - // Setter fuer Reederei-Instanz - public final function setCompanyInstance (ShippingCompany $companyInstance) { - $this->shippingCompany = $companyInstance; - } - - // Getter fuer Reederei-Instanz - public final function getCompanyInstance () { - return $this->shippingCompany; - } - - // Add new personell - public function addNewPersonell ($personell) { - // Add to list - $this->staffList->append($personell); - } - - // Add a new ship type to our list - public function addNewConstructableShipType ($shipType) { - // This must be a string! - $shipType = (string) $shipType; - - // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.", - __CLASS__, - __LINE__, - $this->getShipyardName(), - $shipType - )); - - // Add to list - $this->shipTypeList->append($shipType); - } - - // Is the specified ship type in our list? - public function isShipTypeConstructable ($shipType) { - // First we can't build this ship - $result = false; - - // This must be a string! - $shipType = (string) $shipType; - - // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.", - __CLASS__, - __LINE__, - $this->getShipyardName(), - $shipType - )); - - // Iterate through all types - for ($idx = $this->shipTypeList->getIterator(); $idx->valid(); $idx->next()) { - // Get current ship type - $type = (string) $idx->current(); - - // Is both the same? - $result = ($type == $shipType); - - // Type is found? - if ($result) break; // Then abort the search! - } - - // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.", - __CLASS__, - __LINE__, - $this->getShipyardName(), - $shipType - )); - - // Return result - return $result; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/controller/.htaccess b/application/ship-simu/main/controller/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/controller/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/controller/web/.htaccess b/application/ship-simu/main/controller/web/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/controller/web/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/controller/web/class_WebCompanyController.php b/application/ship-simu/main/controller/web/class_WebCompanyController.php deleted file mode 100644 index c5f1e2d..0000000 --- a/application/ship-simu/main/controller/web/class_WebCompanyController.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebCompanyController extends BaseController implements Controller { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $controllerInstance A prepared instance of this class - * @todo Add some filters to this controller - */ - public static final function createWebCompanyController (CommandResolver $resolverInstance) { - // Create the instance - $controllerInstance = new WebCompanyController(); - - // Set the command resolver - $controllerInstance->setResolverInstance($resolverInstance); - - // User auth filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // User update filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); - - // News fetcher filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); - - // News proccess/display-preparation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); - - // Return the prepared instance - return $controllerInstance; - } - - /** - * Handles the given request and response - * - * @param $requestInstance An instance of a request class - * @param $responseInstance An instance of a response class - * @return void - */ - public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { - // Get the command instance from the resolver by sending a request instance to the resolver - $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); - - // Add more filters by the command - $commandInstance->addExtraFilters($this, $requestInstance); - - // Try to run the pre filters, if auth exceptions come through redirect here - try { - // Run the pre filters - $this->executePreFilters($requestInstance, $responseInstance); - } catch (UserAuthorizationException $e) { - // Redirect to main page - $responseInstance->redirectToConfiguredUrl('login_failed'); - - // Exit here - exit(); - } - - // This request was valid! :-D - $requestInstance->requestIsValid(); - - // Execute the command - $commandInstance->execute($requestInstance, $responseInstance); - - // Run the pre filters - $this->executePostFilters($requestInstance, $responseInstance); - - // Flush the response out - $responseInstance->flushBuffer(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/controller/web/class_WebGovernmentFailedController.php b/application/ship-simu/main/controller/web/class_WebGovernmentFailedController.php deleted file mode 100644 index c51bf1c..0000000 --- a/application/ship-simu/main/controller/web/class_WebGovernmentFailedController.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebGovernmentFailedController extends BaseController implements Controller { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @param $resolverInstance An instance of a command resolver class - * @return $controllerInstance A prepared instance of this class - * @todo Add some filters to this controller - */ - public static final function createWebGovernmentFailedController (CommandResolver $resolverInstance) { - // Create the instance - $controllerInstance = new WebGovernmentFailedController(); - - // Set the command resolver - $controllerInstance->setResolverInstance($resolverInstance); - - // User auth filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); - - // User update filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); - - // News fetcher filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); - - // News proccess/display-preparation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); - - // Return the prepared instance - return $controllerInstance; - } - - /** - * Handles the given request and response - * - * @param $requestInstance An instance of a request class - * @param $responseInstance An instance of a response class - * @return void - */ - public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { - // Get the command instance from the resolver by sending a request instance to the resolver - $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); - - // Add more filters by the command - $commandInstance->addExtraFilters($this, $requestInstance); - - // Try to run the pre filters, if auth exceptions come through redirect here - try { - // Run the pre filters - $this->executePreFilters($requestInstance, $responseInstance); - } catch (UserAuthorizationException $e) { - // Redirect to main page - $responseInstance->redirectToConfiguredUrl('login_failed'); - - // Exit here - exit(); - } - - // This request was valid! :-D - $requestInstance->requestIsValid(); - - // Execute the command - $commandInstance->execute($requestInstance, $responseInstance); - - // Run the pre filters - $this->executePostFilters($requestInstance, $responseInstance); - - // Flush the response out - $responseInstance->flushBuffer(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/drives/.htaccess b/application/ship-simu/main/drives/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/drives/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/drives/class_BaseDrive.php b/application/ship-simu/main/drives/class_BaseDrive.php deleted file mode 100644 index 56f9802..0000000 --- a/application/ship-simu/main/drives/class_BaseDrive.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseDrive extends BaseSimulator { - // Price of this drive - private $price = 0.00; - // PS-Zahl - private $horsePower = 0; - // Anzahl Nocken - private $numCams = 0; - - // Konstruktor - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Setter-Methode fuert PS-Zahl - public final function setHorsePower ($hp) { - $this->horsePower = (int) $hp; - } - - // Setter-Methode fuer Nockenanzahl - public final function setNumCams ($cams) { - $this->numCams = (int) $cams; - } - - // Setter for price - public final function setPrice ($price) { - $this->price = (float) $price; - } - - // Getter for price - public final function getPrice () { - return $this->price; - } - - public final function removePrice () { - unset($this->price); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/drives/motor/.htaccess b/application/ship-simu/main/drives/motor/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/drives/motor/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/drives/motor/class_Motor.php b/application/ship-simu/main/drives/motor/class_Motor.php deleted file mode 100644 index 2f3479e..0000000 --- a/application/ship-simu/main/drives/motor/class_Motor.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { - // Constructor - protected function __construct() { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Einen Motor erstellen - public static final function createMotor ($descr, $hp, $cams, $w, $h, $l) { - // Get new instance - $motorInstance = new Motor(); - - // Beschreibung und Abmasse setzen - $motorInstance->setWidth($w); - $motorInstance->setHeight($h); - $motorInstance->setLength($l); - - // Weitere Daten setzen - $motorInstance->setHorsePower($hp); - $motorInstance->setNumCams($cams); - - // Instanz zurueckgeben - return $motorInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/factories/.htaccess b/application/ship-simu/main/factories/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/factories/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php b/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php deleted file mode 100644 index e42b021..0000000 --- a/application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuWebNewsFactory extends BaseFrameworkSystem { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $factoryInstance An instance of this class - */ - public static final function createShipSimuWebNewsFactory () { - // Get a new instance - $factoryInstance = new ShipSimuWebNewsFactory(); - - // Return the prepared instance - return $factoryInstance; - } - - /** - * Create the news object itself here depending on the request - * - * @param $requestInstance An instance of a request class - * @return $newsInstance An instance of a news class - */ - public function createNewObject (Requestable $requestInstance) { - // Do some stuff here - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/.htaccess b/application/ship-simu/main/filter/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/book/.htaccess b/application/ship-simu/main/filter/book/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/book/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/book/refill/.htaccess b/application/ship-simu/main/filter/book/refill/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/book/refill/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php b/application/ship-simu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php deleted file mode 100644 index b7ff113..0000000 --- a/application/ship-simu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class RefillRequestCurrencyTestBookFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createRefillRequestCurrencyTestBookFilter () { - // Get a new instance - $filterInstance = new RefillRequestCurrencyTestBookFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Add code being executed in this filter - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Get the user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Run the update - $userInstance->bookAmountDirectly($requestInstance); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/class_ b/application/ship-simu/main/filter/class_ deleted file mode 100644 index 20653ff..0000000 --- a/application/ship-simu/main/filter/class_ +++ /dev/null @@ -1,65 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ???Filter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public final static function create???Filter () { - // Get a new instance - $filterInstance = new ???Filter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Add code being executed in this filter - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - $this->partialStub("Add code here for your specific filter."); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/class_BaseShipSimuFilter.php b/application/ship-simu/main/filter/class_BaseShipSimuFilter.php deleted file mode 100644 index 7a80cf2..0000000 --- a/application/ship-simu/main/filter/class_BaseShipSimuFilter.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseShipSimuFilter extends BaseFilter { - /** - * Protected constructor - * - * @param $className Name of the filter class - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Add something to do on every filter - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Add something to do on every filter - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/government/.htaccess b/application/ship-simu/main/filter/government/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/government/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php b/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php deleted file mode 100644 index 7becf12..0000000 --- a/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuGovernmentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createShipSimuGovernmentPaysStartupHelpFilter () { - // Get a new instance - $filterInstance = new ShipSimuGovernmentPaysStartupHelpFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Get the user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Now simply check for it - if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysStartupHelp() === false)) { - // Request is invalid - $requestInstance->requestIsValid(false); - - // Redirect to configured URL - $responseInstance->redirectToConfiguredUrl('login_government_startup_failed'); - - // Stop processing here - exit(); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php b/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php deleted file mode 100644 index 75eb1cc..0000000 --- a/application/ship-simu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuGovernmentPaysTrainingFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createShipSimuGovernmentPaysTrainingFilter () { - // Get a new instance - $filterInstance = new ShipSimuGovernmentPaysTrainingFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo 0% done - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Get the user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Now simply check for it - if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysTraining() === false)) { - // Request is invalid - $requestInstance->requestIsValid(false); - - // Redirect to configured URL - $responseInstance->redirectToConfiguredUrl('login_government_training_failed'); - - // Stop processing here - exit(); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/page/.htaccess b/application/ship-simu/main/filter/page/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/page/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/page/class_RefillPageFilter.php b/application/ship-simu/main/filter/page/class_RefillPageFilter.php deleted file mode 100644 index d4680ba..0000000 --- a/application/ship-simu/main/filter/page/class_RefillPageFilter.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class RefillPageFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createRefillPageFilter () { - // Get a new instance - $filterInstance = new RefillPageFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @throws FilterChainException If this filter fails to operate - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Is the configuration variable set? - if ($this->getConfigInstance()->getConfigEntry('refill_page_active') === "N") { - // Password is empty - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('refill_page_not_active'); - - // Abort here - throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/validator/.htaccess b/application/ship-simu/main/filter/validator/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/validator/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php deleted file mode 100644 index 3abd7ba..0000000 --- a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createRefillRequestValidatorFilter () { - // Get a new instance - $filterInstance = new RefillRequestValidatorFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Maybe we need to added some more generic tests on the request here? - * @throws FilterChainException If this filter fails to operate - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Are all required request fields set? - if (($requestInstance->isRequestElementSet('type') === false) || ($requestInstance->isRequestElementSet('amount') === false)) { - // Something important is missing - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('refill_page_required_fields_missing'); - - // Abort here - throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php b/application/ship-simu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php deleted file mode 100644 index 989e1d4..0000000 --- a/application/ship-simu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuUserStatusGuestFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createShipSimuUserStatusGuestFilter () { - // Get a new instance - $filterInstance = new ShipSimuUserStatusGuestFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - * @todo Maybe we need to added some more generic tests on the request here? - * @throws FilterChainException If this filter fails to operate - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Get a user instance for comparison - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Is the user account confirmed? - if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == $this->getConfigInstance()->getConfigEntry('user_status_guest')) { - // Request is invalid! - $requestInstance->requestIsValid(false); - - // Redirect to configured URL - $responseInstance->redirectToConfiguredUrl('login_user_status_guest'); - - // Stop processing here - exit(); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/filter/verifier/.htaccess b/application/ship-simu/main/filter/verifier/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/filter/verifier/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php b/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php deleted file mode 100644 index 51bb4db..0000000 --- a/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php +++ /dev/null @@ -1,117 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BirthdayVerifierFilter extends BaseShipSimuFilter implements Filterable { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this filter class - * - * @return $filterInstance An instance of this filter class - */ - public static final function createBirthdayVerifierFilter () { - // Get a new instance - $filterInstance = new BirthdayVerifierFilter(); - - // Return the instance - return $filterInstance; - } - - /** - * Executes the filter with given request and response objects - * - * @param $requestInstance An instance of a class with an Requestable interface - * @param $responseInstance An instance of a class with an Responseable interface - * @return void - */ - public function execute (Requestable $requestInstance, Responseable $responseInstance) { - // Execute the parent execute method - parent::execute($requestInstance, $responseInstance); - - // Day of birth set? - if (!$requestInstance->isRequestElementSet('birth_day')) { - // Day of birth isn't set - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('day_of_birth_unset'); - } // END - if - - // Month of birth set? - if (!$requestInstance->isRequestElementSet('birth_month')) { - // Month of birth isn't set - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('month_of_birth_unset'); - } // END - if - - // Year of birth set? - if (!$requestInstance->isRequestElementSet('birth_year')) { - // Year of birth isn't set - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('year_of_birth_unset'); - } // END - if - - // Is the request still valid? - if (!$requestInstance->isRequestValid()) { - // Abort here - throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if - - // Now comes the final check - $birthCheck = mktime( - 0, - 0, - 0, - $requestInstance->getRequestElement('birth_day'), - $requestInstance->getRequestElement('birth_month'), - $requestInstance->getRequestElement('birth_year') - ); - - // Is there a number or such? (we don't care about the value itself here) - if (empty($birthCheck)) { - // Validation has failed - $requestInstance->requestIsValid(false); - - // Add a message to the response - $responseInstance->addFatalMessage('birthday_invalid'); - - // Abort here - throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/government/.htaccess b/application/ship-simu/main/government/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/government/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/government/class_SimplifiedGovernment.php b/application/ship-simu/main/government/class_SimplifiedGovernment.php deleted file mode 100644 index 8999153..0000000 --- a/application/ship-simu/main/government/class_SimplifiedGovernment.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * @todo Find an interface for governments - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class SimplifiedGovernment extends BaseFrameworkSystem implements Registerable { - // Constants - const STATUS_STARTER_HELP = 'STARTER_HELP'; - const STATUS_TRAINING = 'TRAINING'; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this government class by given user instance - * - * @param $userInstance The user instance - * @return $governmentInstance Instance of the prepared government instance - */ - public static final function createSimplifiedGovernment (ManageableAccount $userInstance) { - // Get a new instance - $governmentInstance = new SimplifiedGovernment(); - - // Set the user instance - $governmentInstance->setUserInstance($userInstance); - - // Return the prepared instance - return $governmentInstance; - } - - /** - * Checks wether the government has already payed a training course for te - * current user - * - * @return $alreadyPayed Wether the government has already payed - * @todo Needs do check training limit - */ - public function ifGovernmentAlreadyPayedTraining () { - // Default is not payed - $alreadyPayed = false; - - // Cache startup training limit - $trainingLimit = $this->getConfigInstance()->getConfigEntry('government_training_limit'); - - // Now get a search criteria and set the user's name as criteria - $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_USERID , $this->getUserInstance()->getUserId()); - $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_ACTIVITY, self::STATUS_TRAINING); - $searchInstance->setLimit(1); - - // Get a wrapper instance - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); - - // Get result back - $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance); - - // Was the query fine? - if ($resultInstance->next()) { - // Get entry - $currEntry = $resultInstance->current(); - - // Entry was found so the government can no more pay a training - $alreadyPayed = true; - } // END - if - - // Return the result - return $alreadyPayed; - } - - /** - * Checks wether the government has payed maximum of startup helps to the - * current user - * - * @return $maximumPayed Wether the government has already payed - * @todo Needs do check help limit - */ - public function ifGovernmentPayedMaxmimumStartupHelp () { - // Default is not payed - $maximumPayed = false; - - // Cache startup help limit - $helpLimit = $this->getConfigInstance()->getConfigEntry('government_startup_help_limit'); - - // Now get a search criteria and set the user's name as criteria - $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_USERID , $this->getUserInstance()->getUserId()); - $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_ACTIVITY, self::STATUS_STARTER_HELP); - $searchInstance->setLimit($helpLimit); - - // Get a wrapper instance - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); - - // Get result back - $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance); - - // Was the query fine? - if ($resultInstance->next()) { - // Get entry - $currEntry = $resultInstance->current(); - - // Entry found, so lets have a look if this government wants to again... - $maximumPayed = true; - } // END - if - - // Return the result - return $maximumPayed; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/login/.htaccess b/application/ship-simu/main/login/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/login/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php b/application/ship-simu/main/login/class_ShipSimuGuestLogin.php deleted file mode 100644 index 16f76ed..0000000 --- a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php +++ /dev/null @@ -1,152 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser { - /** - * The hashed password - */ - private $hashedPassword = ''; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this login class - * - * @return $loginInstance An instance of this login class - */ - public static final function createShipSimuGuestLogin () { - // Get a new instance - $loginInstance = new ShipSimuGuestLogin(); - - // Return the instance - return $loginInstance; - } - - /** - * Logins the user with the given request containing the credential. The - * result of the login can be thrown by exception or, if prefered stored - * in a boolean attribute which is then readable by a matching getter. - * - * @param $requestInstance An instance of a Requestable class - * @param $responseInstance An instance of a Responseable class - * @return void - * @throws UserAuthMethodException If wether username nor email login - * was detected - * @throws MissingMethodException If a method was not found in the - * User class - * @throws UserPasswordMismatchException If the supplied password did not - * match with the stored password - */ - public function doLogin (Requestable $requestInstance, Responseable $responseInstance) { - // By default no method is selected - $method = null; - $data = ""; - - // Detect login method (username or email) and try to get a userinstance - if (!is_null($requestInstance->getRequestElement('user'))) { - // Username found! - $method = 'createGuestByUsername'; - $data = $requestInstance->getRequestElement('user'); - } // END - if - - // Is a method detected? - if (is_null($method)) { - // Then abort here - throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD); - } elseif (!method_exists($this->getConfigInstance()->getConfigEntry('guest_class'), $method)) { - // The method is invalid! - throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD); - } - - // Get a user instance - $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), $method), array($data)); - - // Remember this new instance in registry - Registry::getRegistry()->addInstance('user', $userInstance); - - // Is the password correct? - if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { - // Mismatching password - throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); - } // END - if - - // Now do the real login. This can be cookie- or session-based login - // which depends on the admins setting then on the user's taste. - // 1) Get a login helper instance - $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance)); - - // 2) Execute the login. This will now login... - $helperInstance->executeLogin($responseInstance); - } - - /** - * Determines wether the login was fine. This is done by checking if 'login' instance is in registry - * - * @return $loginDone Wether the login was fine or not - */ - public function ifLoginWasSuccessfull () { - // Is the registry key there? - $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); - - // Return the result - return $loginDone; - } - - /** - * Encrypt given request key or throw an exception if key was not found in - * request - * - * @param $requestKey Key in request class - * @return void - */ - public function encryptPassword ($requestKey) { - // Check if password is found in request - if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { - // So encrypt the password and store it for later usage in - // the request: - - // Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); - - // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Get a crypto helper and hash the password - $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); - - // Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php deleted file mode 100644 index cf43ef0..0000000 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ /dev/null @@ -1,140 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { - /** - * The hashed password - */ - private $hashedPassword = ''; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this login class - * - * @return $loginInstance An instance of this login class - */ - public static final function createShipSimuUserLogin () { - // Get a new instance - $loginInstance = new ShipSimuUserLogin(); - - // Return the instance - return $loginInstance; - } - - /** - * Logins the user with the given request containing the credential. The - * result of the login can be thrown by exception or, if prefered stored - * in a boolean attribute which is then readable by a matching getter. - * - * @param $requestInstance An instance of a Requestable class - * @param $responseInstance An instance of a Responseable class - * @return void - * @throws UserPasswordMismatchException If the supplied password did not - * match with the stored password - * @todo We need to add something here which will make more than one - * @todo guest logins, users who are online but based on the same - * @todo user account. - */ - public function doLogin (Requestable $requestInstance, Responseable $responseInstance) { - // By default no method is selected - $method = null; - $data = ""; - - // Get member class - $userClass = $this->getConfigInstance()->getConfigEntry('user_class'); - - // Get a user instance - $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance)); - - // Remember this new instance in registry - Registry::getRegistry()->addInstance('user', $userInstance); - - // Is the password correct? - if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { - // Mismatching password - throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); - } // END - if - - // ToDo place - - // Now do the real login. This can be cookie- or session-based login - // which depends on the admins setting then on the user's taste. - // 1) Get a login helper instance - $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance)); - - // 2) Execute the login. This will now login... - $helperInstance->executeLogin($responseInstance); - } - - /** - * Determines wether the login was fine. This is done by checking if 'login' instance is in registry - * - * @return $loginDone Wether the login was fine or not - */ - public function ifLoginWasSuccessfull () { - // Is the registry key there? - $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); - - // Return the result - return $loginDone; - } - - /** - * Encrypt given request key or throw an exception if key was not found in - * request - * - * @param $requestKey Key in request class - * @return void - */ - public function encryptPassword ($requestKey) { - // Check if password is found in request - if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { - // So encrypt the password and store it for later usage in - // the request: - - // Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); - - // Get user instance - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Get a crypto helper and hash the password - $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); - - // Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/login/helper/.htaccess b/application/ship-simu/main/login/helper/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/login/helper/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php b/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php deleted file mode 100644 index b5c125e..0000000 --- a/application/ship-simu/main/login/helper/class_ShipSimuLoginHelper.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin { - /** - * The login method we shall choose - */ - private $authMethod = ""; - - // Exception constants - const EXCEPTION_INVALID_USER_INSTANCE = 0x190; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class by given request instance - * - * @param $requestInstance An instance of a Requestable class - * @return $helperInstance An instance of this helper class - * @throws UserInstanceMissingException If the user instance in registry - * is missing or invalid - */ - public static final function createShipSimuLoginHelper (Requestable $requestInstance) { - // Get a new instance first - $helperInstance = new ShipSimuLoginHelper(); - - // Get a user instance from registry - $userInstance = Registry::getRegistry()->getInstance('user'); - - // Is this instance valid? - if (!$userInstance instanceof ManageableAccount) { - // Thrown an exception here - throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE); - } // END - if - - // Set default login method from config - $helperInstance->setDefaultAuthMethod(); - - // Set request instance - $helperInstance->setRequestInstance($requestInstance); - - // Return the prepared instance - return $helperInstance; - } - - /** - * Setter for default login method from config - * - * @return void - */ - protected function setDefaultAuthMethod () { - $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class'); - } - - /** - * Execute the login request by given response instance. This instance can - * be used for sending cookies or at least the session id out. - * - * @param $responseInstance An instance of a Responseable class - * @return void - */ - public function executeLogin (Responseable $responseInstance) { - // Get an instance from the login method - $loginInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance)); - - // Set user cookie - $loginInstance->setUserAuth($this->getRequestInstance()->getRequestElement('username')); - - // Set password cookie - $loginInstance->setPasswordAuth($this->getRequestInstance()->getRequestElement('pass_hash')); - - // Remember this login instance for later usage - Registry::getRegistry()->addInstance('login', $loginInstance); - } -} - -// -?> diff --git a/application/ship-simu/main/menu/.htaccess b/application/ship-simu/main/menu/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/menu/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/menu/class_ShipSimu b/application/ship-simu/main/menu/class_ShipSimu deleted file mode 100644 index 93970de..0000000 --- a/application/ship-simu/main/menu/class_ShipSimu +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimu???Menu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public final static function createShipSimu???Menu () { - // Get a new instance - $menuInstance = new ShipSimu???Menu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php b/application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php deleted file mode 100644 index 1dc56b7..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuConfirmMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuConfirmMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuConfirmMenu () { - // Get a new instance - $menuInstance = new ShipSimuConfirmMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuHomeMenu.php b/application/ship-simu/main/menu/class_ShipSimuHomeMenu.php deleted file mode 100644 index ef01389..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuHomeMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuHomeMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuHomeMenu () { - // Get a new instance - $menuInstance = new ShipSimuHomeMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuLoginAreaMenu.php b/application/ship-simu/main/menu/class_ShipSimuLoginAreaMenu.php deleted file mode 100644 index 038b123..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuLoginAreaMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLoginAreaMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuLoginAreaMenu () { - // Get a new instance - $menuInstance = new ShipSimuLoginAreaMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php b/application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php deleted file mode 100644 index 6978654..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuLoginFailedMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLoginFailedMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuLoginFailedMenu () { - // Get a new instance - $menuInstance = new ShipSimuLoginFailedMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuLoginMenu.php b/application/ship-simu/main/menu/class_ShipSimuLoginMenu.php deleted file mode 100644 index 7aa83e9..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuLoginMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLoginMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuLoginMenu () { - // Get a new instance - $menuInstance = new ShipSimuLoginMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuLogoutMenu.php b/application/ship-simu/main/menu/class_ShipSimuLogoutMenu.php deleted file mode 100644 index 76b6c68..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuLogoutMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuLogoutMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuLogoutMenu () { - // Get a new instance - $menuInstance = new ShipSimuLogoutMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuRegisterMenu.php b/application/ship-simu/main/menu/class_ShipSimuRegisterMenu.php deleted file mode 100644 index d2438f2..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuRegisterMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuRegisterMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuRegisterMenu () { - // Get a new instance - $menuInstance = new ShipSimuRegisterMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/class_ShipSimuStatusMenu.php b/application/ship-simu/main/menu/class_ShipSimuStatusMenu.php deleted file mode 100644 index fbc0434..0000000 --- a/application/ship-simu/main/menu/class_ShipSimuStatusMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuStatusMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuStatusMenu () { - // Get a new instance - $menuInstance = new ShipSimuStatusMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/menu/government/.htaccess b/application/ship-simu/main/menu/government/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/menu/government/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php b/application/ship-simu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php deleted file mode 100644 index 0d2112c..0000000 --- a/application/ship-simu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuGovernmentFailedAreaMenu extends BaseMenu implements RenderableMenu { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this class - * - * @return $menuInstance An instance of this class - */ - public static final function createShipSimuGovernmentFailedAreaMenu () { - // Get a new instance - $menuInstance = new ShipSimuGovernmentFailedAreaMenu(); - - // Return the prepared instance - return $menuInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/opening/.htaccess b/application/ship-simu/main/opening/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/opening/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/opening/bank/.htaccess b/application/ship-simu/main/opening/bank/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/opening/bank/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/opening/bank/class_MoneyBankRealtimeOpening.php b/application/ship-simu/main/opening/bank/class_MoneyBankRealtimeOpening.php deleted file mode 100644 index 5136767..0000000 --- a/application/ship-simu/main/opening/bank/class_MoneyBankRealtimeOpening.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class MoneyBankRealtimeOpening extends BaseOpening { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this opening time class - * - * @param $bankInstance An instance of a money bank - * @return $openeningInstance An instance of this class - */ - public static final function createMoneyBankRealtimeOpening (BaseBank $bankInstance) { - // Get a new instance - $openingInstance = new MoneyBankRealtimeOpening(); - - // Set the bank instance here - $openingInstance->setBankInstance($bankInstance); - - // Return the prepared instance - return $openingInstance; - } - - /** - * Checks wether we are within the opening times - * - * @return $withinOpeningTimes Wether we are within opening times - */ - public function ifWithinOpeningTimes () { - $this->partialStub(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/opening/class_ b/application/ship-simu/main/opening/class_ deleted file mode 100644 index b9f1ce7..0000000 --- a/application/ship-simu/main/opening/class_ +++ /dev/null @@ -1,50 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ???Opening extends BaseOpening { - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this opening time class - * - * @return $openeningInstance An instance of this class - */ - public final static function create???Opening () { - // Get a new instance - $openeningInstance = new ???Opening(); - - // Return the prepared instance - return $openeningInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/opening/class_BaseOpening.php b/application/ship-simu/main/opening/class_BaseOpening.php deleted file mode 100644 index 78f8983..0000000 --- a/application/ship-simu/main/opening/class_BaseOpening.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -abstract class BaseOpening extends BaseFrameworkSystem { - /** - * A bank instance - */ - private $bankInstance = null; - - /** - * Protected constructor - * - * @param $className The class' real name - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Setter for bank instance - * - * @param $bankInstance An instance of a bank - * @return void - */ - protected final function setBankInstance (BaseBank $bankInstance) { - $this->bankInstance = $bankInstance; - } - - /** - * Checks wether we are within the opening times - * - * @return $withinOpeningTimes Wether we are within opening times - */ - public abstract function ifWithinOpeningTimes (); -} - -// [EOF] -?> diff --git a/application/ship-simu/main/parts/.htaccess b/application/ship-simu/main/parts/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/parts/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/parts/class_BaseShipPart.php b/application/ship-simu/main/parts/class_BaseShipPart.php deleted file mode 100644 index aca83a9..0000000 --- a/application/ship-simu/main/parts/class_BaseShipPart.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseShipPart extends BaseSimulator { - // Price of this ship part - private $price = 0.00; - - // Konstruktor - protected function __construct($className) { - // Call parent constructor - parent::__construct($className); - } - - // Setter for price - public final function setPrice ($price) { - $this->price = (float) $price; - } - - // Getter for price - public final function getPrice () { - return $this->price; - } - - // Remove price - public final function removePrice () { - unset($this->price); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/parts/maschineroom/.htaccess b/application/ship-simu/main/parts/maschineroom/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/parts/maschineroom/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php deleted file mode 100644 index bcd7b30..0000000 --- a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php +++ /dev/null @@ -1,47 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class MaschineRoom extends BaseShipPart { - // Constructor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Maschinenraum erstellen - public static final function createMaschineRoom () { - // Get new instance - $roomInstance = new MaschineRoom(); - - // Umrechnungsfaktoren setzen - $roomInstance->setResizeFactorElement('width' , 1.3); - $roomInstance->setResizeFactorElement('height', 1.8); - $roomInstance->setResizeFactorElement('length', 1.3); - - // Instanz zurueckgeben - return $roomInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/personell/.htaccess b/application/ship-simu/main/personell/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/personell/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php deleted file mode 100644 index 8ff01e7..0000000 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ /dev/null @@ -1,327 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class SimulatorPersonell extends BasePersonell { - // Personell list - private $personellList = null; - - // A cache for lists - private $cacheList = null; - - // A string for cached conditions - private $cacheCond = null; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Magic wake-up method called when unserialize() is called. This is - * neccessary because in this case a personell does not need to know the - * min/max ages range and system classes. This would anyway use more RAM - * what is not required. - * - * @return void - */ - public function __wakeup () { - // Tidy up a little - $this->removePersonellList(); - $this->removeMinMaxAge(); - $this->removeCache(); - } - - /** - * Generate a specified amount of personell and return the prepared instance - * - * @param $amountPersonell Number of personell we shall - * generate - * @return $personellInstance An instance of this object with a - * list of personells - */ - public static final function createSimulatorPersonell ($amountPersonell) { - // Make sure only integer can pass - $amountPersonell = (int) $amountPersonell; - - // Get a new instance - $personellInstance = new SimulatorPersonell(); - - // Debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->debugOutput(sprintf("[%s:%d] Es werden %d Personal bereitgestellt.", - __CLASS__, - __LINE__, - $amountPersonell - )); - - // Initialize the personell list - $personellInstance->createPersonellList(); - - // Create requested amount of personell - for ($idx = 0; $idx < $amountPersonell; $idx++) { - $personellInstance->addRandomPersonell(); - } - - // Debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->debugOutput(sprintf("[%s:%d] %d Personal bereitgestellt.", - __CLASS__, - __LINE__, - $amountPersonell - )); - - // Tidy up a little - $personellInstance->removeGender(); - $personellInstance->removeNames(); - $personellInstance->removeBirthday(); - $personellInstance->removeSalary(); - $personellInstance->removeEmployed(); - $personellInstance->removeMarried(); - //$personellInstance->removeCache(); - - // Instanz zurueckgeben - return $personellInstance; - } - - /** - * Create a SimulatorPersonell object by loading the specified personell - * list from an existing database backend - * - * @param $idNumber The ID number (only right part) of the list - * @return $personellInstance An instance of this class - * @throws InvalidIDFormatException If the given id number - * $idNumber is invalid - * @throws MissingSimulatorIdException If an ID number was not found - * @deprecated - */ - public static final function createSimulatorPersonellByID ($idNumber) { - // Get instance - $personellInstance = new SimulatorPersonell(false); - $personellInstance->makeDeprecated(); - } - - // Create personell list - public function createPersonellList () { - // Is the list already created? - if ($this->personelllList instanceof FrameworkArrayObject) { - // Throw an exception - throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); - } // END - if - - // Initialize the array - $this->personellList = new FrameworkArrayObject("FakedPersonellList"); - } - - // Remove the personell list - private final function removePersonellList () { - unset($this->personellList); - } - - // Add new personell object to our list - public function addRandomPersonell () { - // Gender list... - $genders = array("M", "F"); - - // Create new personell members - $personellInstance = new SimulatorPersonell(); - - // Set a randomized gender - $personellInstance->setGender($genders[mt_rand(0, 1)]); - - // Set a randomized birthday (maximum age required, see const MAX_AGE) - $personellInstance->createBirthday(); - - // Married? Same values means: married - if (mt_rand(0, 5) == mt_rand(0, 5)) $personellInstance->setMarried(true); - - // Tidy up a little - $personellInstance->removePersonellList(); - $personellInstance->removeMinMaxAge(); - $personellInstance->removeCache(); - - // Add new member to the list - $this->personellList->append($personellInstance); - } - - /** - * Get a specifyable list of our people, null or empty string will be ignored! - * - * @return $cacheList A list of cached personells - */ - function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = "") { - // Serialize the conditions for checking if we can take the cache - $serialized = serialize(array($isEmployed, $isMarried, $hasGender)); - - // The same (last) conditions? - if (($serialized == $this->cacheCond) && (!is_null($this->cacheCond))) { - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Gecachte Liste wird verwendet.", - __CLASS__, - __LINE__ - )); - - // Return cached list - return $this->cacheList; - } - - // Output debug message - if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...", - __CLASS__, - __LINE__ - )); - - // Remember the conditions - $this->setCacheCond($serialized); - - // Create cached list - $this->setAllCacheList(new FrameworkArrayObject('FakedCacheList')); - - // Search all unemployed personells - for ($idx = $this->personellList->getIterator(); $idx->valid(); $idx->next()) { - // Element holen - $el = $idx->current(); - - // Check currenylt all single conditions (combined conditions are not yet supported) - if ((!is_null($isEmployed)) && ($el->isEmployed() == $isEmployed)) { - // Add this one (employed status asked) - $this->cacheList->append($el); - } elseif ((!is_null($isMarried)) && ($el->isMarried() == $isMarried)) { - // Add this one (marrital status asked) - $this->cacheList->append($el); - } elseif ((!empty($hasGender)) && ($el->getGender() == $hasGender)) { - // Add this one (specified gender) - $this->cacheList->append($el); - } - } - - // Return the completed list - return $this->cacheList; - } - - /** - * Get amount of unemployed personell - * - * @return $count Amount of unemployed personell - */ - public final function getAllUnemployed () { - // Get a temporary list - $list = $this->getSpecialPersonellList(false); - - // Anzahl zurueckliefern - return $list->count(); - } - - /** - * Remove cache things - * - * @return void - */ - private function removeCache () { - // Remove cache data - unset($this->cacheList); - unset($this->cacheCond); - } - - /** - * Setter for cache list - * - * @param $cacheList The new cache list to set or null for initialization/reset - * @return void - */ - private final function setAllCacheList (FrameworkArrayObject $cacheList = null) { - $this->cacheList = $cacheList; - } - - /** - * Setter for cache conditions - * - * @param $cacheCond The new cache conditions to set - * @return void - */ - private final function setCacheCond ($cacheCond) { - $this->cacheCond = (string) $cacheCond; - } - - /** - * Reset cache list - * - * @return void - */ - public function resetCache () { - $this->setAllCacheList(null); - $this->setCacheCond(""); - } - - /** - * Getter for surname. If no surname is set then default surnames are set - * for male and female personells. - * - * @return $surname The personell' surname - */ - public final function getSurname () { - $surname = parent::getSurname(); - - // Make sure every one has a surname... - if (empty($surname)) { - if ($this->isMale()) { - // Typical male name - $surname = "John"; - } else { - // Typical female name - $surname = "Jennifer"; - } - - // Set typical family name - parent::setFamily("Smith"); - } // END - if - - // Return surname - return $surname; - } - - /** - * Getter for personell list - * - * @return $personellList The list of all personells - */ - public final function getPersonellList () { - return $this->personellList; - } - - /** - * Loads the mostly pre-cached personell list - * - * @param $idNumber The ID number we shall use for looking up - * the right data. - * @return void - * @deprecated - */ - public function loadPersonellList ($idNumber) { - $this->makeDeprecated(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/personell/company/.htaccess b/application/ship-simu/main/personell/company/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/personell/company/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/personell/company/class_CompanyEmployee.php b/application/ship-simu/main/personell/company/class_CompanyEmployee.php deleted file mode 100644 index 472692e..0000000 --- a/application/ship-simu/main/personell/company/class_CompanyEmployee.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class CompanyEmployee extends SimulatorPersonell { - // Employeee list - private $employeeList = null; - - // Constructor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Generate a specified amount of personell - public static final function createCompanyEmployee ($surname, $family, $gender, $year, $month, $day, $married, $salary) { - // Get instance - $personellInstance = new CompanyEmployee(); - - // Debug message - if (((defined('DEBUG_COMPANY_EMPLOYEE')) && (defined('DEBUG_PERSONELL'))) || (defined('DEBUG_ALL'))) { - $personellInstance->debugOutput(sprintf("[%s:%d] Der/Die Angestellte %s %s wird angelegt.", - __CLASS__, - __LINE__, - $surname, - $family - )); - } - - // Ist the given birthday valid? - if ($personellInstance->isDateValid($year, $month, $day) === false) { - // Something is wrong ... - throw new BirthdayInvalidException(array($year, $month, $day), self::EXCEPTION_BIRTH_DATE_IS_INVALID); - } // END - if - - // Set birthday - $personellInstance->setBirthday($year, $month, $day); - - // Set as employed/marrital status - $personellInstance->setEmployed(true); - $personellInstance->setMarried($married); - - // Set surname/family/gender - $personellInstance->setSurname($surname); - $personellInstance->setFamily($family); - $personellInstance->setGender($gender); - - // Set salary - $personellInstance->increaseSalary($salary); - - // Tidy up a little - $personellInstance->removeEmployeeList(); - $personellInstance->removeMinMaxAge(); - - // Return prepared instance - return $personellInstance; - } - - // Remove the employee list - private function removeEmployeeList () { - unset($this->employeeList); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/registration/.htaccess b/application/ship-simu/main/registration/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/registration/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/registration/class_ShipSimuRegistration.php b/application/ship-simu/main/registration/class_ShipSimuRegistration.php deleted file mode 100644 index 674d189..0000000 --- a/application/ship-simu/main/registration/class_ShipSimuRegistration.php +++ /dev/null @@ -1,207 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuRegistration extends BaseRegistration implements UserRegister { - /** - * Hashed password - */ - private $hashedPassword = ''; - - /** - * Elements for criteria - */ - private $criteriaElements = array( - 'username', - 'pass_hash', - 'email' => 'email1', - 'surname', - 'family', - 'street', - 'zip', - 'city', - 'icq', - 'jabber', - 'yahoo', - 'aol', - 'msn', - 'birth_day', - 'birth_month', - 'birth_year' - ); - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Create a new instance - * - * @return $registrationInstance An instance of this registration class - */ - public static final function createShipSimuRegistration () { - // Get a new instance - $registrationInstance = new ShipSimuRegistration(); - - // Initialize the filter chains - $registrationInstance->initFilterChains(); - - // And return it - return $registrationInstance; - } - - /** - * Encrypt given request key or throw an exception if key was not found in - * request - * - * @param $requestKey Key in request class - * @return void - */ - public function encryptPassword ($requestKey) { - // Check if password is found in request - if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { - // So encrypt the password and store it for later usage in - // the request: - - // 1.: Get the plain password - $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); - - // 2. Get a crypto helper and hash the password - $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword); - - // 3. Store the hash back in request - $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); - } - } - - /** - * Perform things like informing assigned affilates about new registration - * before registration - * - * @return void - * @todo Maybe add more things to perform - */ - public function doPreRegistration () { - // First run all pre filters - $this->executePreFilters(); - } - - /** - * Registers the new user account by insterting the request data into the - * database and paying some start credits or throw exceptions if this fails - * - * @return void - * @todo Maybe add more things to perform - */ - public function registerNewUser () { - // Get a user database wrapper - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class'); - - // Use this instance to insert the whole registration instance - $wrapperInstance->insertRegistrationObject($this); - } - - /** - * Perform things like notifying partner websites after registration is done - * - * @return void - * @todo Maybe add more things to perform - */ - public function doPostRegistration () { - // First run all post filters - $this->executePostFilters(); - } - - /** - * Do the action which is required after all registration steps are done. - * This can be a simple redirect to another webpage or displaying a message - * to the user. Or this can be a login step into the newly created account. - * - * @return void - */ - public function doPostAction () { - // Get an action instance from our factory - $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_class'); - - // Execute the action - $actionInstance->execute($this->getRequestInstance(), $this->getResponseInstance()); - } - - /** - * Adds registration elements to a given dataset instance - * - * @param $criteriaInstance An instance of a storeable criteria - * @return void - */ - public function addElementsToDataSet (StoreableCriteria $criteriaInstance) { - // Default is unconfirmed! - $configEntry = 'user_status_unconfirmed'; - - // Is the confirmation process entirely disabled? - if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === 'N') { - // No confirmation of email needed - $configEntry = 'user_status_confirmed'; - } // END - if - - // Add a lot elements to the dataset criteria - foreach ($this->criteriaElements as $alias => $element) { - // Do we have an alias? - if (is_string($alias)) { - // Yes, so use it - $criteriaInstance->addCriteria($alias, $this->getRequestInstance()->getRequestElement($element)); - - // Debug message - //* DEBUG: */ $this->debugOutput('ALIAS: alias='.$alias.',element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); - } else { - // No, default entry - $criteriaInstance->addCriteria($element, $this->getRequestInstance()->getRequestElement($element)); - - // Debug message - //* DEBUG: */ $this->debugOutput('DEFAULT: element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); - } - - // Is this a guest account? - if ((($element == 'username') || ($alias == 'username')) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) { - // Yes, then set the config entry to guest status - $configEntry = 'user_status_guest'; - } // END - if - } // END - foreach - - // Mark the username as unique key - $criteriaInstance->setUniqueKey(UserDatabaseWrapper::DB_COLUMN_USERNAME); - - // Add account status as configured - $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry); - - // Include registration timestamp - $criteriaInstance->addCriteria('registered', date('Y-m-d H:i:s', time())); - } -} - -// -?> diff --git a/application/ship-simu/main/resolver/.htaccess b/application/ship-simu/main/resolver/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/resolver/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/resolver/web/.htaccess b/application/ship-simu/main/resolver/web/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/resolver/web/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/resolver/web/class_WebCompanyCommandResolver.php b/application/ship-simu/main/resolver/web/class_WebCompanyCommandResolver.php deleted file mode 100644 index e5fcfb4..0000000 --- a/application/ship-simu/main/resolver/web/class_WebCompanyCommandResolver.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebCompanyCommandResolver extends BaseCommandResolver implements CommandResolver { - /** - * Last successfull resolved command - */ - private $lastCommandInstance = null; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set prefix to "Web" - $this->setCommandPrefix('Web'); - } - - /** - * Creates an instance of a Web command resolver with a given default command - * - * @param $commandName The default command we shall execute - * @param $appInstance An instance of a manageable application helper class - * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set - * @throws InvalidInterfaceException Thrown if command does not implement interface Commandable - */ - public static final function createWebCompanyCommandResolver ($commandName, ManageableApplication $appInstance) { - // Create the new instance - $resolverInstance = new WebCompanyCommandResolver(); - - // Get request instance - $requestInstance = $appInstance->getRequestInstance(); - - // Is the variable $commandName set and the command is valid? - if (empty($commandName)) { - // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) { - // Invalid command found (missing interface?) - throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING); - } - - // Set the application instance - $resolverInstance->setApplicationInstance($appInstance); - - // Return the prepared instance - return $resolverInstance; - } - - /** - * Returns an command instance for a given request class or null if - * it was not found - * - * @param $requestInstance An instance of a request class - * @return $commandInstance An instance of the resolved command - * @throws InvalidCommandException Thrown if $commandName is - * invalid - * @throws InvalidCommandInstanceException Thrown if $commandInstance - * is an invalid instance - */ - public function resolveCommandByRequest (Requestable $requestInstance) { - // Init instance - $commandInstance = null; - - // This goes fine so let's resolv the command - $commandName = str_replace('-', '_', $requestInstance->getRequestElement('app')) . '_' . $requestInstance->getRequestElement('page'); - - // Is there a "failed" request? - if ($requestInstance->isRequestElementSet('failed')) { - // Then include with within the command name - $commandName = $commandName . '_' . $requestInstance->getRequestElement('failed'); - } // END - if - - // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Check if command is valid - if ($this->isCommandValid($commandName) === false) { - // This command is invalid! - throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Get the command - $commandInstance = $this->loadCommand($commandName); - - // And validate it - if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { - // This command has an invalid instance! - throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Set last command - $this->lastCommandInstance = $commandInstance; - - // Return the resolved command instance - return $commandInstance; - } - - /** - * Resolves the command by its direct name and returns an instance of its class - * - * @param $commandName The direct command name we shall resolve - * @return $commandInstance An instance of the command class - * @throws InvalidCommandException Thrown if $commandName is invalid - */ - public function resolveCommand ($commandName) { - // Initiate the instance variable - $commandInstance = null; - - // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Check if command is valid - if ($this->isCommandValid($commandName) === false) { - // This command is invalid! - throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } - - // Get the command - $commandInstance = $this->loadCommand($commandName); - - // Return the instance - return $commandInstance; - } - - /** - * "Loads" a given command and instances it if not yet cached - * - * @param $commandName A command name we shall look for - * @return $commandInstance A loaded command instance - * @throws InvalidCommandException Thrown if even the default - * command class is missing (bad!) - */ - private function loadCommand ($commandName) { - // Cache default command - $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Init command instance - $commandInstance = null; - - // Get 'app' from the application - $app = Registry::getRegistry()->getInstance('application')->getRequestInstance()->getRequestElement('app'); - - // Create command class name - $this->setClassName(sprintf("%s%sCommand", - $this->getCommandPrefix(), - $this->convertToClassName($commandName) - )); - - // Is this class loaded? - if (!class_exists($this->getClassName())) { - // Class not found, so throw an exception - throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Initiate the command - $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); - - // Return the result - return $commandInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php b/application/ship-simu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php deleted file mode 100644 index 9456c08..0000000 --- a/application/ship-simu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements CommandResolver { - /** - * Last successfull resolved command - */ - private $lastCommandInstance = null; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set prefix to "Web" - $this->setCommandPrefix('Web'); - } - - /** - * Creates an instance of a Web command resolver with a given default command - * - * @param $commandName The default command we shall execute - * @param $appInstance An instance of a manageable application helper class - * @return $resolverInstance The prepared command resolver instance - * @throws EmptyVariableException Thrown if default command is not set - * @throws InvalidInterfaceException Thrown if command does not implement interface Commandable - */ - public static final function createWebGovernmentFailedCommandResolver ($commandName, ManageableApplication $appInstance) { - // Create the new instance - $resolverInstance = new WebGovernmentFailedCommandResolver(); - - // Get request instance - $requestInstance = $appInstance->getRequestInstance(); - - // Is the variable $commandName set and the command is valid? - if (empty($commandName)) { - // Then thrown an exception here - throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) { - // Invalid command found (missing interface?) - throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING); - } - - // Set the application instance - $resolverInstance->setApplicationInstance($appInstance); - - // Return the prepared instance - return $resolverInstance; - } - - /** - * Returns an command instance for a given request class or null if - * it was not found - * - * @param $requestInstance An instance of a request class - * @return $commandInstance An instance of the resolved command - * @throws InvalidCommandException Thrown if $commandName is - * invalid - * @throws InvalidCommandInstanceException Thrown if $commandInstance - * is an invalid instance - */ - public function resolveCommandByRequest (Requestable $requestInstance) { - // Init instance - $commandInstance = null; - - // This goes fine so let's resolv the command - $commandName = $requestInstance->getRequestElement('page'); - - // Is there a "failed" request? - if ($requestInstance->isRequestElementSet('failed')) { - // Then include with within the command name - $commandName = sprintf("%s_%s", $commandName, $requestInstance->getRequestElement('failed')); - } // END - if - - // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Check if command is valid - if ($this->isCommandValid($commandName) === false) { - // This command is invalid! - throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Get the command - $commandInstance = $this->loadCommand($commandName); - - // And validate it - if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { - // This command has an invalid instance! - throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Set last command - $this->lastCommandInstance = $commandInstance; - - // Return the resolved command instance - return $commandInstance; - } - - /** - * Resolves the command by its direct name and returns an instance of its class - * - * @param $commandName The direct command name we shall resolve - * @return $commandInstance An instance of the command class - * @throws InvalidCommandException Thrown if $commandName is invalid - */ - public function resolveCommand ($commandName) { - // Initiate the instance variable - $commandInstance = null; - - // Is the command empty? Then fall back to default command - if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Check if command is valid - if ($this->isCommandValid($commandName) === false) { - // This command is invalid! - throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); - } - - // Get the command - $commandInstance = $this->loadCommand($commandName); - - // Return the instance - return $commandInstance; - } - - /** - * "Loads" a given command and instances it if not yet cached - * - * @param $commandName A command name we shall look for - * @return $commandInstance A loaded command instance - * @throws InvalidCommandException Thrown if even the default - * command class is missing (bad!) - */ - private function loadCommand ($commandName) { - // Cache default command - $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command'); - - // Init command instance - $commandInstance = null; - - // Create command class name - $this->setClassName(sprintf("%s%sCommand", - $this->getCommandPrefix(), - $this->convertToClassName($commandName) - )); - - // Is this class loaded? - if (!class_exists($this->getClassName())) { - // Class not found, so throw an exception - throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); - } // END - if - - // Initiate the command - $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); - - // Return the result - return $commandInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/ships/.htaccess b/application/ship-simu/main/ships/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/ships/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/ships/class_BaseShip.php b/application/ship-simu/main/ships/class_BaseShip.php deleted file mode 100644 index ae22ca3..0000000 --- a/application/ship-simu/main/ships/class_BaseShip.php +++ /dev/null @@ -1,167 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseShip extends BaseSimulator { - // Name des Shipes - private $shipName = "Unbekanntes Schiff"; - - // Anzahl Anker - private $numAnchor = 0; - - // Tiefgang in Meter - private $draught = 0; - - // Besatzung-Objekte - private $crewList = null; - - // Aufbauten-Objekte - private $structures = null; - - // Namenloses Ship generieren - protected function __construct($className) { - // Call parent constructor - parent::__construct($className); - - // Prepare array object for all structures - $this->createStructuresArray(); - - // Clean-up a little - $this->removePartInstance(); - } - - // Array-Objekt anlegen - private function createStructuresArray () { - $this->structures = new FrameworkArrayObject("FakedShipStructures"); - } - - // Schiffsteil generieren (kann alles sein) - // buildInstance = Das was in das Schiffsteil evtl. eingebaut werden soll (null = kein besonderes Teil einbauen!) - // partClass = Das zu konstruierende Schiffsteil - public function createShipPart (ConstructableShipPart $buildInstance, $partClass) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s erhält ein neues Schiffsteil (%s).", - __CLASS__, - __LINE__, - $this->getShipName(), - $partClass - )); - - // Ist die gewuenschte Klasse vorhanden? - if (!class_exists($partClass)) { - // Nicht vorhanden, dann Ausnahme werfen! - throw new NoClassException($partClass, self::EXCEPTION_CLASS_NOT_FOUND); - } // END - if - - // Get an instance back from our object factory - $partInstance = ObjectFactory::createObjectByName($partClass); - - // Das Einbauen versuchen... - try { - $partInstance->addShipPartToShip($this, $buildInstance); - } catch (MotorShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keinen Motor erhalten! Grund: %s", - __CLASS__, - __LINE__, - $this->getShipName(), - $e->getMessage() - )); - return false; - } catch (RoomShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keinen Maschinenraum erhalten! Grund: %s", - __CLASS__, - __LINE__, - $this->getShipName(), - $e->getMessage() - )); - return false; - - } catch (StructureShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keine Aufbauten erhalten! Grund: %s", - __CLASS__, - __LINE__, - $this->getShipName(), - $e->getMessage() - )); - return false; - } catch (CabinShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keine Kabine erhalten! Grund: %s", - __CLASS__, - __LINE__, - $this->getShipName(), - $e->getMessage() - )); - return false; - } catch (DeckShipMismatchException $e) { - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat kein Deck erhalten! Grund: %s", - __CLASS__, - __LINE__, - $this->getShipName(), - $e->getMessage() - )); - return false; - } - - // Instanz im Aufbauten-Array vermerken - $this->structures->append($partInstance); - - // Alles klar! - return true; - } - - // Getter-Methode fuer Strukturen-Array - public final function getStructuresArray () { - return $this->structures; - } - - // STUB: Getter-Methode Anzahl Betten - public function calcTotalBeds () { - $this->partialStub("Please implement this stub in your ship!"); - } - - // Setter-Methode fuer Schiffsnamen - public final function setShipName ($shipName) { - $this->shipName = (string) $shipName; - } - - // Getter-Methode fuer Schiffsnamen - public final function getShipName () { - return $this->shipName; - } - - // Setter-Methode fuer Tiefgang - public final function setDraught ($draught) { - $this->draught = (int) $draught; - } - - // Getter-Methode fuer Tiefgang - public final function getDraught() { - return $this->draught; - } - - // Setter-Methode fuer Anzahl Anker - public final function setNumAnchor ($numAnchor) { - $this->numAnchor = (int) $numAnchor; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/ships/passenger/.htaccess b/application/ship-simu/main/ships/passenger/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/ships/passenger/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/ships/passenger/class_PassengerShip.php b/application/ship-simu/main/ships/passenger/class_PassengerShip.php deleted file mode 100644 index 70fa5ed..0000000 --- a/application/ship-simu/main/ships/passenger/class_PassengerShip.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class PassengerShip extends BaseShip implements ConstructableShip { - // Konstruktor - protected function __construct () { - // Eltern-Kontruktor aufrufen - parent::__construct(__CLASS__); - } - - // Passagier-Schiff erstellen - public static final function createPassengerShip ($shipName) { - // Get new instance - $passInstance = new PassengerShip(); - - // Set ship name - $passInstance->setShipName($shipName); - - // Instanz zurueckgeben - return $passInstance; - } - - // Anzahl Betten ermitteln - public final function calcTotalBeds () { - // Struktur-Array holen - $struct = $this->getStructuresArray(); - - if (is_null($struct)) { - // Empty structures list! - throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY); - } // END - if - - // Anzahl Betten auf 0 setzen - $numBeds = 0; - - // Alle Strukturen nach Kabinen durchsuchen - for ($idx = $struct->getIterator(); $idx->valid(); $idx->next()) { - // Element holen - $el = $idx->current(); - - // Ist es eine Kabine? - if ($el->isCabin()) { - // Anzahl Betten ermitteln - $total = $el->calcTotalBedsByCabin(); - $numBeds += $total; - - // Debug-Meldung ausgeben? - if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) { - // Get new instance - $cabType = "Kabine ohne Namen"; - $cab = $el->getPartInstance(); - if (!is_null($cab)) { - // Kabinenbeschreibung holen - $cabType = $cab->getObjectDescription(); - } // END - if - } // END - if - } // END - if - } // END - for - - // Anzahl zurueckliefern - return $numBeds; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/.htaccess b/application/ship-simu/main/structures/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/class_BaseStructure.php b/application/ship-simu/main/structures/class_BaseStructure.php deleted file mode 100644 index 59318cb..0000000 --- a/application/ship-simu/main/structures/class_BaseStructure.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseStructure extends BaseSimulator { - // Price of this structure - private $price = 0.00; - - // Konstruktor (hier keine Exceptions aendern!) - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Setter for price - public final function setPrice ($price) { - $this->price = (float) $price; - } - - // Getter for price - public final function getPrice () { - return $this->price; - } - - // Remove price - public final function removePrice () { - unset($this->price); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/.htaccess b/application/ship-simu/main/structures/extended/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/cabines/.htaccess b/application/ship-simu/main/structures/extended/cabines/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/cabines/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php b/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php deleted file mode 100644 index b513944..0000000 --- a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseCabin extends BaseCabinStructure { - // Konstruktor - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Is this a cabin? - public final function isCabin () { - return ($this->isClass("BaseCabin")); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/cabines/ship/.htaccess b/application/ship-simu/main/structures/extended/cabines/ship/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/cabines/ship/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php deleted file mode 100644 index beceae8..0000000 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Economy-Kabine erstellen - public static final function createEconomyCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Get new instance - $ecoInstance = new EconomyCabin(); - - // Abmasse extrahieren - $ecoInstance->extractDimensions($dim); - - // Den Rest auch setzen - $ecoInstance->setNumCabin($numLuxury); - $ecoInstance->setNumRooms($numRooms); - $ecoInstance->setNumBeds($numBeds); - - // Nicht noetig! - $ecoInstance->removePartInstance(); - - // Instanz zurueckgeben - return $ecoInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php deleted file mode 100644 index 23b877c..0000000 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // 2-Sterne-Klasse erstellen - public static final function createLowCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Get new instance - $lowInstance = new LowCabin(); - - // Abmasse extrahieren - $lowInstance->extractDimensions($dim); - - // Den Rest auch setzen - $lowInstance->setNumCabin($numLuxury); - $lowInstance->setNumRooms($numRooms); - $lowInstance->setNumBeds($numBeds); - - // Nicht noetig! - $lowInstance->removePartInstance(); - - // Instanz zurueckgeben - return $lowInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php deleted file mode 100644 index 78cb9c4..0000000 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Eine Luxuskabine erstellen - public static final function createLuxuryCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Get new instance - $luxuryInstance = new LuxuryCabin(); - - // Abmasse extrahieren - $luxuryInstance->extractDimensions($dim); - - // Den Rest auch setzen - $luxuryInstance->setNumCabin($numLuxury); - $luxuryInstance->setNumRooms($numRooms); - $luxuryInstance->setNumBeds($numBeds); - - // Nicht noetig! - $luxuryInstance->removePartInstance(); - - // Instanz zurueckgeben - return $luxuryInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php deleted file mode 100644 index 522e301..0000000 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Premier-Kabine erstellen - public static final function createPremierCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Get new instance - $premierInstance = new PremierCabin(); - - // Abmasse extrahieren - $premierInstance->extractDimensions($dim); - - // Den Rest auch setzen - $premierInstance->setNumCabin($numLuxury); - $premierInstance->setNumRooms($numRooms); - $premierInstance->setNumBeds($numBeds); - - // Nicht noetig! - $premierInstance->removePartInstance(); - - // Instanz zurueckgeben - return $premierInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/class_ b/application/ship-simu/main/structures/extended/class_ deleted file mode 100644 index 9644fd5..0000000 --- a/application/ship-simu/main/structures/extended/class_ +++ /dev/null @@ -1,7 +0,0 @@ - - /** - * Limits this object with an ObjectLimits instance - */ - public function limitObject (ObjectLimits $limitInstance) { - die("limitObject() reached! Stub!"); - } diff --git a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php deleted file mode 100644 index 77a81ae..0000000 --- a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php +++ /dev/null @@ -1,135 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseCabinStructure extends BaseStructure { - // --- Besondere Eigenschaften dazufuegen: --- - // Anzahl der Kabinen im Schiff - private $numCabin = 0; - - // Anzahl Raeume pro Kabine (kann auch nur 1 sein) - private $numRooms = 0; - - // Anzahl Betten, verallgemeinert - private $numBeds = 0; - - // Konstruktor - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Kabine hinzufuegen - public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) { - // Eltern-Methode aufrufen - parent::addShipPartToShip ($shipInstance, $cabinInstance); - - // Restlichen Daten ebenfalls - $this->setNumCabin($cabinInstance->numCabin); - $this->setNumRooms($cabinInstance->numRooms); - $this->setNumBeds($cabinInstance->numBeds); - - // Unnoetige Attribute entfernen - $cabinInstance->removeNumCabin(); - $cabinInstance->removeNumRooms(); - $cabinInstance->removeNumBeds(); - - // Instanz setzen - $this->setDeckInstance($cabinInstance); - } - - // Wrapper fuer setDeckInstance->setPartInstance - public final function setDeckInstance ($deck) { - parent::setPartInstance($deck); - } - - // Getter-Methode fuer Anzahl Betten - public final function getNumBeds () { - return $this->numBeds; - } - - // Getter-Methode fuer Anzahl Kabinen - public final function getNumCabin () { - return $this->numCabin; - } - - // Setter-Methode fuer Anzahl Betten - public final function setNumBeds ($numBeds) { - $this->numBeds = $numBeds; - } - - // Setter-Methode fuer Anzahl Raeume - public final function setNumRooms ($numRooms) { - $this->numRooms = $numRooms; - } - - // Setter-Methode fuer Anzahl Kabinen - public final function setNumCabin ($numCabin) { - $this->numCabin = $numCabin; - } - - // Loesch-Methode fuer Anzahl Betten - public final function removeNumBeds() { - unset($this->numBeds); - } - - // Loesch-Methode fuer Anzahl Kabinen - public final function removeNumCabin() { - unset($this->numCabin); - } - - // Loesch-Methode fuer Anzahl Raeume - public final function removeNumRooms() { - unset($this->numRooms); - } - - // Bettenanzahl pro Kabine berechnen - public function calcTotalBedsByCabin () { - // Dann Bettenanzahl holen und aufaddieren - $beds = $this->getNumBeds(); - $num = $this->getNumCabin(); - $cabinBeds = $beds * $num; - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) { - // Get new instance - $cabType = "Kabine ohne Namen"; - $cab = $this->getPartInstance(); - if (!is_null($cab)) { - // Kabinenbeschreibung holen - $cabType = $cab->__toString(); - } - - // Debug-Meldung ausgeben - $this->debugOutput(sprintf("[%s:%d] Es exisitieren %d Kabinen vom Typ %s zu je %d Betten. Das sind %d Betten.", - __CLASS__, - __LINE__, - $num, - $cabType, - $beds, - $cabinBeds - )); - } - return $cabinBeds; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php deleted file mode 100644 index 0f44a55..0000000 --- a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseDeckStructure extends BaseStructure { - // Anzahl Decks - private $numDecks = 0; - - // Konstruktor - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - // Deckstruktur dem Schiff hinzufuegen - public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) { - // Eltern-Methode aufrufen - parent::addShipPartToShip($shipInstance, $deckInstance); - - // Andere Daten uebertragen und von der Quelle loeschen - $this->setNumDecks($deckInstance->getNumDecks()); - $deckInstance->removeNumDecks(); - } - - // Deckanzahl entfernen - public final function removeNumDecks() { - unset($this->numDecks); - } - - // Setter-Methode fuer Anzahl Decks - public final function setNumDecks($numDecks) { - $this->numDecks = (int) $numDecks; - } - - // Getter-Methode fuer Anzahl Decks - public final function getNumDecks() { - return $this->numDecks; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php b/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php deleted file mode 100644 index dd6934c..0000000 --- a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseUpperStructure extends BaseStructure { - /** - * Constructor for all super structures on a ship - * - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/decks/.htaccess b/application/ship-simu/main/structures/extended/decks/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/decks/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/decks/cargo/.htaccess b/application/ship-simu/main/structures/extended/decks/cargo/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/decks/cargo/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php deleted file mode 100644 index d87dd09..0000000 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // Autodeck erstellen - public static final function createCarDeck ($numDecks, $dim) { - // Get new instance - $carInstance = new CarDeck(); - - // Abmasse extrahieren - $carInstance->extractDimensions($dim); - - // Andere Daten uebetragen - $carInstance->setNumDecks($numDecks); - - // Nicht noetige Instanz - $carInstance->removePartInstance(); - - // Instanz zurueckgeben - return $carInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php deleted file mode 100644 index 07410ea..0000000 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // LKW-Deck erstellen - public static final function createTrainDeck ($numDecks, $dim) { - // Get new instance - $trainInstance = new TrainDeck(); - - // Abmasse extrahieren - $trainInstance->extractDimensions($dim); - - // Andere Daten uebetragen - $trainInstance->setNumDecks($numDecks); - - // Nicht noetige Instanz - $trainInstance->removePartInstance(); - - // Instanz zurueckliefern - return $trainInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php deleted file mode 100644 index 6a87d85..0000000 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { - // Konstruktor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - // LKW-Deck erstellen - public static final function createTruckDeck ($numDecks, $dim) { - // Get new instance - $truckInstance = new TruckDeck(); - - // Abmasse extrahieren - $truckInstance->extractDimensions($dim); - - // Andere Daten uebetragen - $truckInstance->setNumDecks($numDecks); - - // Nicht noetige Instanz - $truckInstance->removePartInstance(); - - // Instanz zurueckliefern - return $truckInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php b/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php deleted file mode 100644 index 7b92d68..0000000 --- a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class BaseDeck extends BaseDeckStructure { - /** - * Constructor for cargo decks in general - * - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/structures/extended/lower/.htaccess b/application/ship-simu/main/structures/extended/lower/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/lower/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/upper/.htaccess b/application/ship-simu/main/structures/extended/upper/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/structures/extended/upper/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/structures/extended/upper/class_Bridge.php b/application/ship-simu/main/structures/extended/upper/class_Bridge.php deleted file mode 100644 index 1c3b674..0000000 --- a/application/ship-simu/main/structures/extended/upper/class_Bridge.php +++ /dev/null @@ -1,55 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableShipPart { - // Constructor - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Clean up a little - $this->removePartInstance(); - } - - // Eine Kommandobruecke erstellen - public static final function createBridge ($width, $height, $length) { - // Get new instance - $bridgeInstance = new Bridge(); - - // Abmasse setzen - $bridgeInstance->setWidth($width); - $bridgeInstance->setHeight($height); - $bridgeInstance->setLength($length); - - // Instanz zurueckgeben - return $bridgeInstance; - } - - // Overwritten method for tradeable items - public function isTradeable () { - return true; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/user/.htaccess b/application/ship-simu/main/user/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/user/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/user/class_ShipSimuBaseUser.php b/application/ship-simu/main/user/class_ShipSimuBaseUser.php deleted file mode 100644 index 75de2c7..0000000 --- a/application/ship-simu/main/user/class_ShipSimuBaseUser.php +++ /dev/null @@ -1,261 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { - /** - * Protected constructor - * - * @param $className Name of the class - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Initializes the bank instance - * - * @return $bankInstance A bank instance wether just created or from registry - */ - protected function initBankInstance () { - // Init instance - $bankInstance = null; - - try { - // Get a money bank instance from registry - $bankInstance = Registry::getRegistry()->getInstance('money_bank'); - } catch (NullPointerException $e) { - // Instance not found in registry - // @TODO We should log this exception later - } - - // Is it there? - if (is_null($bankInstance)) { - // Then create a new one - $bankInstance = ObjectFactory::createObjectByConfiguredName('bank_class', array($this)); - - // Store it in registry - Registry::getRegistry()->addInstance('money_bank', $bankInstance); - } // END - if - - // Return the instance - return $bankInstance; - } - - /** - * Initializes the government instance - * - * @return $governmentInstance A government instance - */ - protected function initGovernmentInstance () { - // Init instance - $governmentInstance = null; - - try { - // First get a government instance from registry - $governmentInstance = Registry::getRegistry()->getInstance('government'); - } catch (NullPointerException $e) { - // Instance not found in registry - // @TODO We should log this exception later - } - - // Is it there? - if (is_null($governmentInstance)) { - // Then create a new one - $governmentInstance = ObjectFactory::createObjectByConfiguredName('government_class', array($this)); - - // Store it in registry - Registry::getRegistry()->addInstance('government', $governmentInstance); - } // END - if - - // Return the prepared instance - return $governmentInstance; - } - - /** - * Checks wether the user has reached maximum allowed companies to found - * - * @return $reached Wether the user has reached maximum allowed companies to found - */ - public function ifUserCreatedMaximumAllowedCompanies () { - // Get max allowed companies to found - $maxFound = $this->getConfigInstance()->getConfigEntry('max_allowed_companies_found'); - - // Now get a search criteria and set the user's name as criteria - $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName()); - $searchInstance->setLimit($maxFound); - - // Get a company wrapper - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class'); - - // Do the count-select by criteria - $totalRows = $wrapperInstance->doSelectCountByCriteria($searchInstance); - - // Does the user have reached maximum? - $reached = ($totalRows >= $maxFound); - - // Return the result - return $reached; - } - - /** - * Checks wether the user has the required amount of points left for the specified action - * - * @param $action The action or configuration entry plus prefix the user wants to perform - * @return $hasRequired Wether the user has the required points - */ - public function ifUserHasRequiredPoints ($action) { - // Default is that everyone is poor... ;-) - $hasRequired = false; - - // Init instance - $pointsInstance = null; - - try { - // Get a points instance from registry - $pointsInstance = Registry::getRegistry()->getInstance('points'); - } catch (NullPointerException $e) { - // Instance not found in registry - // @TODO We should log this exception later - } - - // Is there an instance? - if (is_null($pointsInstance)) { - // Then create one - $pointsInstance = ObjectFactory::createObjectByConfiguredName('user_points_class', array($this)); - - // And store it in registry - Registry::getRegistry()->addInstance('points', $pointsInstance); - } // END - if - - // Just forward this request to the user points class - $hasRequired = $pointsInstance->ifUserHasRequiredPoints($action); - - // Return the result - return $hasRequired; - } - - /** - * Determines if government can still pay a "virtual training course" in general - * - * @return $ifGovHelps Wether if government helps the user with a virtual training course - */ - public function ifGovernmentPaysTraining () { - // By default they want to help. - $ifGovHelps = true; - - // Initialize government instance - $governmentInstance = $this->initGovernmentInstance(); - - // Then ask the government if they want to pay a "startup help" to the user - $ifGovHelps = ($governmentInstance->ifGovernmentAlreadyPayedTraining()); - - // Return result here - return $ifGovHelps; - } - - /** - * Determines if government can still pay a "startup help" to the user - * - * @return $ifGovHelps Wether if government helps the user with some startup money - */ - public function ifGovernmentPaysStartupHelp () { - // By default they want to help. - $ifGovHelps = true; - - // Initialize government instance - $governmentInstance = $this->initGovernmentInstance(); - - // Then ask the government if they want to pay a "startup help" to the user - $ifGovHelps = ($governmentInstance->ifGovernmentPayedMaxmimumStartupHelp()); - - // Return result here - return $ifGovHelps; - } - - /** - * Checks wether the user can take points from the money bank - * - * @return $bankLends Wether the money bank is able to lend money - * @todo Need to implement MoneyBank::ifBankLendsMoreMoney() - */ - public function ifUserAllowedTakeCreditsFromMoneyBank () { - // Per default the money bank cannot pay - $bankLends = false; - - // Initialize bank instance - $bankInstance->initBankInstance(); - - // Does the money bank lend more money? - $bankLends = ($bankInstance->ifBankLendsMoreMoney()); - - // Return result - return $bankLends; - } - - /** - * Checks wether the user has maximum credits with the money bank. This - * should be done seperately from checking if the user is allowed to take - * credits from the bank. - * - * @return $hasMaxCredits Wether the user has maximum credits with the bank - * @todo Need to check the bank if they can lend more money - */ - public function ifUserHasMaximumCreditsWithMoneyBank () { - // For default he can still get money - $hasMaxCredits = false; - - // Initialize the bank instance - $bankInstance = $this->initBankInstance(); - - // Now check if the user has maximum credits - $hasMaxCredits = ($bankInstance->ifUserHasMaxCredits()); - - // Return the result - return $hasMaxCredits; - } - - /** - * Checks wether the money bank has opened - * - * @return $hasOpened Wether the money bank has opened - */ - public function ifMoneyBankHasOpened () { - // Default is not opened - $hasOpened = false; - - // Initialize the bank instance - $bankInstance = $this->initBankInstance(); - - // Has this bank opened? - $hasOpened = ($bankInstance->ifMoneyBankHasOpened()); - - // Return result - return $hasOpened; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/user/extended/.htaccess b/application/ship-simu/main/user/extended/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/user/extended/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/user/extended/class_ShipSimuGuest.php b/application/ship-simu/main/user/extended/class_ShipSimuGuest.php deleted file mode 100644 index a66de18..0000000 --- a/application/ship-simu/main/user/extended/class_ShipSimuGuest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuGuest extends ShipSimuBaseUser implements ManageableGuest { - // Exceptions - const EXCEPTION_USERNAME_NOT_FOUND = 0x170; - const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x171; - const EXCEPTION_USER_PASS_MISMATCH = 0x172; - - /** - * Protected constructor - * - * @param $className Name of the class - * @return void - */ - protected function __construct ($className = __CLASS__) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Creates an instance of this user class by a provided username. This - * factory method will check if username is already taken and if not - * so it will throw an exception. - * - * @param $userName Username we need a class instance for - * @return $userInstance An instance of this user class - * @throws UsernameMissingException If the username does not exist - */ - public static final function createGuestByUsername ($userName) { - // Get a new instance - $userInstance = new ShipSimuGuest(); - - // Set the username - $userInstance->setUserName($userName); - - // Check if username exists - if ($userInstance->ifUsernameExists() === false) { - // Throw an exception here - throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND); - } // END - if - - // Return the instance - return $userInstance; - } - - /** - * Creates an instance of this user class by a provided email address. This - * factory method will not check if email address is there. - * - * @param $email Email address of the user - * @return $userInstance An instance of this user class - */ - public static final function createGuestByEmail ($email) { - // Get a new instance - $userInstance = new ShipSimuGuest(); - - // Set the username - $userInstance->setEmail($email); - - // Return the instance - return $userInstance; - } - - /** - * Updates the last activity timestamp and last performed action in the - * database result. You should call flushPendingUpdates() to flush these updates - * to the database layer. - * - * @param $requestInstance A requestable class instance - * @return void - */ - public function updateLastActivity (Requestable $requestInstance) { - // No activity will be logged for guest accounts - } - - /** - * Flushs all pending updates to the database layer - * - * @return void - */ - public function flushPendingUpdates () { - // No updates will be flushed to database! - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/user/extended/class_ShipSimuMember.php b/application/ship-simu/main/user/extended/class_ShipSimuMember.php deleted file mode 100644 index a37ef16..0000000 --- a/application/ship-simu/main/user/extended/class_ShipSimuMember.php +++ /dev/null @@ -1,220 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, BookableAccount { - /** - * Protected constructor - * - * @param $className Name of the class - * @return void - */ - protected function __construct ($className = __CLASS__) { - // Call parent constructor - parent::__construct($className); - } - - /** - * Destructor for e.g. flushing pending updates to the database - * - * @return void - */ - public function __destruct () { - // Flush any updated entries to the database - $this->flushPendingUpdates(); - - // Call parent destructor - parent::__destruct(); - } - - /** - * Creates an instance of this user class by a provided username. This - * factory method will check if username is already taken and if not - * so it will throw an exception. - * - * @param $userName Username we need a class instance for - * @return $userInstance An instance of this user class - * @throws UsernameMissingException If the username does not exist - */ - public static final function createMemberByUsername ($userName) { - // Get a new instance - $userInstance = new ShipSimuMember(); - - // Set the username - $userInstance->setUserName($userName); - - // Check if username exists - if ($userInstance->ifUsernameExists() === false) { - // Throw an exception here - throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND); - } // END - if - - // Return the instance - return $userInstance; - } - - /** - * Creates an instance of this user class by a provided email address. This - * factory method will not check if email address is there. - * - * @param $email Email address of the user - * @return $userInstance An instance of this user class - */ - public static final function createMemberByEmail ($email) { - // Get a new instance - $userInstance = new ShipSimuMember(); - - // Set the username - $userInstance->setEmail($email); - - // Return the instance - return $userInstance; - } - - /** - * Creates a user by a given request instance - * - * @param $requestInstance An instance of a Requestable class - * @return $userInstance An instance of this user class - * @todo Add more ways of creating user instances - */ - public static final function createMemberByRequest (Requestable $requestInstance) { - // Determine if by email or username - if (!is_null($requestInstance->getRequestElement('username'))) { - // Username supplied - $userInstance = self::createMemberByUserName($requestInstance->getRequestElement('username')); - } elseif (!is_null($requestInstance->getRequestElement('email'))) { - // Email supplied - $userInstance = self::createMemberByEmail($requestInstance->getRequestElement('email')); - } else { - // Unsupported mode - $userInstance = new ShipSimuMember(); - $userInstance->partialStub("We need to add more ways of creating user classes here."); - $userInstance->debugBackTrace(); - exit(); - } - - // Return the prepared instance - return $userInstance; - } - - /** - * Updates the last activity timestamp and last performed action in the - * database result. You should call flushPendingUpdates() to flush these updates - * to the database layer. - * - * @param $requestInstance A requestable class instance - * @return void - */ - public function updateLastActivity (Requestable $requestInstance) { - // Set last action - $lastAction = $requestInstance->getRequestElement('action'); - - // If there is no action use the default on - if (is_null($lastAction)) { - $lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action'); - } // END - if - - // Get a critieria instance - $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - - // Add search criteria - $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName()); - $searchInstance->setLimit(1); - - // Now get another criteria - $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class'); - - // And add our both entries - $updateInstance->addCriteria('last_activity', date('Y-m-d H:i:s', time())); - $updateInstance->addCriteria('last_action', $lastAction); - - // Add the search criteria for searching for the right entry - $updateInstance->setSearchInstance($searchInstance); - - // Set wrapper class name - $updateInstance->setWrapperConfigEntry('user_db_wrapper_class'); - - // Remember the update in database result - $this->getResultInstance()->add2UpdateQueue($updateInstance); - } - - /** - * Books the given 'amount' in the request instance on the users 'points - * account' - * - * @param $requestInstance An instance of a Requestable class - * @return void - */ - public function bookAmountDirectly (Requestable $requestInstance) { - // Init points instance - $pointsInstance = null; - - try { - // Get the points class from registry - $pointsInstance = Registry::getRegistry()->getInstance('points'); - } catch (NullPointerException $e) { - // Instance not found in registry - // @TODO We should log this later - } - - // Is the points instance null? - if (is_null($pointsInstance)) { - // Then get a new one - $pointsInstance = ObjectFactory::createObjectByConfiguredName('user_points_class', array($this)); - - // And store it in registry - Registry::getRegistry()->addInstance('points', $pointsInstance); - } // END - if - - // Get the amount - $amount = $requestInstance->getRequestElement('amount'); - - // Call the method for booking points - $pointsInstance->bookPointsDirectly($amount); - } - - /** - * Flushs all pending updates to the database layer - * - * @return void - */ - public function flushPendingUpdates () { - // Is the object valid? - if (!$this->getResultInstance() instanceof SearchableResult) { - // Abort here - return; - } // END - if - - // Do we have data to update? - if ($this->getResultInstance()->ifDataNeedsFlush()) { - // Get a database wrapper - $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class'); - - // Yes, then send the whole result to the database layer - $wrapperInstance->doUpdateByResult($this->getResultInstance()); - } // END - if - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/wrapper/.htaccess b/application/ship-simu/main/wrapper/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/main/wrapper/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php b/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php deleted file mode 100644 index 1552e67..0000000 --- a/application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class CompanyDatabaseWrapper extends BaseDatabaseWrapper { - /** - * Company instance - */ - private $companyInstance = null; - - // Constants for database tables - const DB_TABLE_COMPANY_DATA = 'company'; - const DB_TABLE_COMPANY_USER = 'company_user'; - - // Constants for database columns - const DB_COLUMN_PARTICIPANT_ID = 'participant_id'; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this wrapper class - * - * @param $companyInstance An instance of a generic company class or null if no specific - * @return $wrapperInstance An instance of this wrapper class - * @todo Find an interface which is suitable for all companies - */ - public static final function createCompanyDatabaseWrapper (ShippingCompany $companyInstance = null) { - // Create a new instance - $wrapperInstance = new CompanyDatabaseWrapper(); - - // Set (primary!) table name - $wrapperInstance->setTableName(self::DB_TABLE_COMPANY_DATA); - - // Set the company instance if not null - if (!is_null($companyInstance)) { - $wrapperInstance->setCompanyInstance($companyInstance); - } // END - if - - // Return the instance - return $wrapperInstance; - } - - /** - * Checks wether the given user participates in a company - * - * @param $userInstance An instance of a user class - * @return $participates Wether the user participates at lease in one company - */ - public function ifUserParticipatesInCompany (ManageableAccount $userInstance) { - // By default no user owns any company... ;) - $participates = false; - - // Get a search criteria class - $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); - - // Add the user primary key as a search criteria - $searchInstance->addCriteria(self::DB_COLUMN_PARTICIPANT_ID, $userInstance->getPrimaryKey()); - $searchInstance->setLimit(1); - - // Set company->user table - $this->setTableName(self::DB_TABLE_COMPANY_USER); - - // Get the result back - $resultInstance = $this->doSelectByCriteria($searchInstance); - - // Is there a result? - if ($resultInstance->next()) { - // Then cache it - $this->setResultInstance($resultInstance); - - // Entry found for further analysis/processing - $participates = true; - } // END - if - - // Return the result - return $participates; - } - - /** - * Setter for company instance - * - * @param $companyInstance An instance of a generic company - * @return void - * @todo Find an interface suitable for all types of companies - */ - protected final function setCompanyInstance (ShippingCompany $companyInstance) { - $this->companyInstance = $companyInstance; - } - - /** - * Getter for company instance - * - * @return $companyInstance An instance of a generic company - * @todo Find an interface suitable for all types of companies - */ - public final function getCompanyInstance () { - return $this->companyInstance; - } -} - -// [EOF] -?> diff --git a/application/ship-simu/main/wrapper/class_UserGovernmentDatabaseWrapper.php b/application/ship-simu/main/wrapper/class_UserGovernmentDatabaseWrapper.php deleted file mode 100644 index 6392d6b..0000000 --- a/application/ship-simu/main/wrapper/class_UserGovernmentDatabaseWrapper.php +++ /dev/null @@ -1,70 +0,0 @@ -user data - * - * @author Roland Haeder - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class UserGovernmentDatabaseWrapper extends BaseDatabaseWrapper { - // Constants for database tables - const DB_TABLE_USER_GOVERNMENT = 'gov_user'; - - // Database columns - const DB_COLUMN_GOV_USERID = 'gov_uid'; - const DB_COLUMN_GOV_ACTIVITY = 'gov_activity_status'; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - } - - /** - * Creates an instance of this wrapper class - * - * @return $wrapperInstance An instance of this wrapper class - */ - public static final function createUserGovernmentDatabaseWrapper () { - // Create a new instance - $wrapperInstance = new UserGovernmentDatabaseWrapper(); - - // Set (primary!) table name - $wrapperInstance->setTableName(self::DB_TABLE_USER_GOVERNMENT); - - // Return the instance - return $wrapperInstance; - } - - /** - * Registers the given startup help request with the government - * - * @param $requestInstance A Requestable instance - * @return void - */ - public function registerStartupHelpByRequest (Requestable $requestInstance) { - $requestInstance->debugInstance(); - } -} - -// [EOF] -?> diff --git a/application/ship-simu/starter.php b/application/ship-simu/starter.php deleted file mode 100644 index 7ba3538..0000000 --- a/application/ship-simu/starter.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Is there an application helper instance? We need the method main() for -// maining the application -$app = call_user_func_array(array(FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), 'getSelfInstance'), array()); - -// Some sanity checks -if ((empty($app)) || (is_null($app))) { - // Something went wrong! - ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because the helper class %s is not loaded.", - $application, - FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class') - )); -} elseif (!is_object($app)) { - // No object! - ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because 'app' is not an object.", - $application - )); -} elseif (!method_exists($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method'))) { - // Method not found! - ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because the method %s is missing.", - $application, - FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method') - )); -} - -// Call user function -call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), array()); - -// [EOF] -?> diff --git a/application/ship-simu/templates/.htaccess b/application/ship-simu/templates/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/de/.htaccess b/application/ship-simu/templates/de/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/de/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/de/.xml b/application/ship-simu/templates/de/.xml deleted file mode 100644 index d7d7d08..0000000 --- a/application/ship-simu/templates/de/.xml +++ /dev/null @@ -1,24 +0,0 @@ - - diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp deleted file mode 100644 index b9df5fc..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp +++ /dev/null @@ -1,97 +0,0 @@ -prefetchValueInstance('user'); - -// Add link group for company founder -$linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine Reederei gründen, um dich selbstständig zu machen?"); - -// Maximum of allowed companies reached? -if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) { - // No more companies allowed to found - $linkInstance->addLinkNote('company_maximum', "Du hast zu viele Firmen gegründet. Bitte denke über eine Fusion (Zusammenlegung) nach."); -} elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('found_new_company')) { - // Enough money to found company - $linkInstance->addActionLinkById('company_found', 'found_company'); -} - -// Add link group for government -$linkInstance->addLinkGroup('government', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom Staat ab wenn du nicht flüssig bist!"); - -if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) { - // Enough money to write applications to other companies - $linkInstance->addActionLinkById('company_list', 'list_company'); -} elseif ($linkInstance->getValueInstance()->ifGovernmentPaysTraining()) { - // Government is able to pay a training in general - $linkInstance->addActionLinkById('government_training', 'list_training_by_government'); - - // Can the government pay startup help? - if ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) { - // Add link note - $linkInstance->addLinkNote('government_startup_help', "Starthilfe beantragen:"); - - // Display link to government for startup help - $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government'); - } // END - if -} elseif ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) { - // Display link to government for startup help - $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government'); -} else { - // Even government cannot help the gamer here - $linkInstance->addLinkNote('government_depleted', "Leider kann dir der Staat nicht mehr weiterhelfen, dich zu bewerben, da du zu oft Starthilfen erhalten hast oder ein Training absolviert hast. Hier muss aber noch weiter am Spiel gearbeitet werden. :-)"); -} - -// Checks wether the money bank has opened -if ($linkInstance->getValueInstance()->ifMoneyBankHasOpened()) { - // Add link group for money bank - $linkInstance->addLinkGroup('moneybank', "Leihe dir zu günstigen Zinsen Geld aus, wenn du mehr brauchst!"); - - // Add link to moneybank - if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { - // Display link to money bank page - $linkInstance->addActionLinkById('moneybank', 'virtual_money_bank'); - } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { - // Maximum credits reached which a money bank can lent - $linkInstance->addLinkNote('moneybank_depleted', "Die Spielebank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); - $linkInstance->addActionLinkById('moneybank_payback_credits', 'payback_credits_to_money_bank'); - } else { - // Unexpected state of the bank - $linkInstance->addLinkNote('moneybank_error', "Es wurde ein Fehler in der Spielebank erkannt. Bitte melde dies dem Support."); - } -} else { - // Money bank is closed! - $linkInstance->addLinkGroup('moneybank', "Die Spielebank hat geschlossen."); - $linkInstance->addLinkNote('moneybank_closed', "Die Spielebank hat derzeit geschlossen. Bitte später nochmal versuchen."); -} - -// Add link group for refill page -$linkInstance->addLinkGroup('refill_page', "Hole dir Geld von uns zu fairen Preisen!"); - -if ($linkInstance->ifRefillPageActive()) { - // Display link to refill page - $linkInstance->addActionLinkById('refill', 'refill_virtual_money'); -} else { - // Refill page not active - $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert."); -} - -// Flush content to the template -$linkInstance->flushContent(); - -// [EOC] -?> -
-
- Auflistung der Reedereien, an denenen du dich beteiligst: -
- -
- {?company_list?} -
- - -
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_government_startup_help.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_government_startup_help.ctp deleted file mode 100644 index e300a01..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_government_startup_help.ctp +++ /dev/null @@ -1,62 +0,0 @@ -prefetchValueInstance('user'); - -// Add main form group -$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen! (Die Profildaten sollte jedoch echt sein.)"); - -// Add group for personal data -$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Beantragung nötig sind:"); - -// Display email, surname and family name -$helperInstance->addFormNote('surname', "Vorname: ".$helperInstance->getValueField('surname').""); -$helperInstance->addFormNote('family', "Nachname: ".$helperInstance->getValueField('family').""); -$helperInstance->addFormNote('email', "Email-Adresse: ".$helperInstance->getValueField('email').""); -$helperInstance->addFormNote('birthday', "Geburtstag: ".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year').""); - -// Add link placeholder for profile page -$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile?}"); - -// Ask again for current account password -$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein."); -$helperInstance->addFieldText('password', "Derzeitiges Passwort:"); -$helperInstance->addInputPasswordField('password'); - -// CAPTCHA enabled? -if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst."); - $helperInstance->addCaptcha(); -} // END - if - -// Final notices -$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); -$helperInstance->addInputResetButton("Alles nochmal eingeben"); -$helperInstance->addInputSubmitButton("Starthilfe beantragen"); -$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); - -// Flush the finished form -$helperInstance->flushContent(); - -// Get link helper for profile link -$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'shipsimu_profile')); - -// Add action -$linkInstance->addActionLinkById('profile', 'profile'); - -// Flush the finished form -$linkInstance->flushContent(); - -// [EOC] -?> -
-
- Virtuelle Beantragung von Starthilfe -
- -
- {?shipsimu_government_startup?} -
-
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_government_training.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_government_training.ctp deleted file mode 100644 index 7c921ff..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_government_training.ctp +++ /dev/null @@ -1,62 +0,0 @@ -prefetchValueInstance('user'); - -// Add main form group -$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!"); - -// Add group for personal data -$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Kursusteilnahme nötig sind:"); - -// Ask again for current account password -$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein."); -$helperInstance->addFieldText('password', "Derzeitiges Passwort:"); -$helperInstance->addInputPasswordField('password'); - -// Display email, surname and family name -$helperInstance->addFormNote('surname', "Vorname: ".$helperInstance->getValueField('surname').""); -$helperInstance->addFormNote('family', "Nachname: ".$helperInstance->getValueField('family').""); -$helperInstance->addFormNote('email', "Email-Adresse: ".$helperInstance->getValueField('email').""); -$helperInstance->addFormNote('birthday', "Geburtstag: ".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year').""); - -// Add link placeholder for profile page -$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile?}"); - -// CAPTCHA enabled? -if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung eines Trainingkursus ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, um den Trainingskursus zu beantragen."); - $helperInstance->addCaptcha(); -} // END - if - -// Final notices -$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); -$helperInstance->addInputResetButton("Alles nochmal eingeben"); -$helperInstance->addInputSubmitButton("Trainingskurs beantragen"); -$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); - -// Flush the finished form -$helperInstance->flushContent(); - -// Get link helper for profile link -$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'shipsimu_profile')); - -// Add action -$linkInstance->addActionLinkById('profile', 'profile'); - -// Flush the finished form -$linkInstance->flushContent(); - -// [EOC] -?> -
-
- Virtuelle Beantragung eines Training-Kursus -
- -
- {?shipsimu_government_training?} -
-
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp deleted file mode 100644 index 5443af2..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp +++ /dev/null @@ -1,30 +0,0 @@ -addLinkWithTextById('logout_now'); - -// Flush the content -$helperInstance->flushContent(); - -// Get helper instance -$helperInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'return_login')); - -// Set link text -$helperInstance->addLinkWithTextById('return_login'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
-
- Willst du dich wirklich aus dem Spiel ausloggen? -
- -
- {?logout_now?} | {?return_login?} -
-
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp deleted file mode 100644 index 8037a4e..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp +++ /dev/null @@ -1,145 +0,0 @@ -prefetchValueInstance('user'); - -// Password can only be changed when the old one is entered and new one twice! -$helperInstance->addFormGroup('pass', "Neues Passwort einrichten:"); -$helperInstance->addFormSubGroup('pass', "Bitte gebe zum Ändern deines Passwortes zweimal das gewünschte neue Passwort ein."); -$helperInstance->addFieldText('pass1', "Neues Passwort:"); -$helperInstance->addInputPasswordField('pass1'); -$helperInstance->addFieldText('pass2', "Neues Passwort, Wiederholung:"); -$helperInstance->addInputPasswordField('pass2'); - -// Display current email -$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: ".$helperInstance->getValueField('email').""); - -// Only for changing email address -if ($helperInstance->ifEmailChangeAllowed()) { - $helperInstance->addFormGroup('email', "Änderung deiner Email-Addresse:"); - $helperInstance->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese ändern möchtest!"); - $helperInstance->addFieldText('email1', "Email-Adresse:"); - $helperInstance->addInputTextField('email1'); - $helperInstance->addFieldText('email2', "Wiederholung Email-Adresse:"); - $helperInstance->addInputTextField('email2'); - - if ($helperInstance->ifEmailMustBeUnique()) { - $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); - } // END - if - - if ($helperInstance->ifEmailChangeRequireConfirmation()) { - $helperInstance->addFormNote('confirm', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an."); - } // END - if -} // END - if - -// Add form group for user profile -$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern."); - -// Persoenliche Daten mit in der Anmeldung abfragen? -if ($helperInstance->ifRegisterIncludesPersonaData()) { - $helperInstance->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); - $helperInstance->addFieldText('surname', "Dein Vorname:"); - $helperInstance->addInputTextFieldWithDefault('surname'); - $helperInstance->addFieldText('family', "Dein Nachname:"); - $helperInstance->addInputTextFieldWithDefault('family'); - $helperInstance->addFieldText('street', "Strasse und Hausnummer:"); - $helperInstance->addInputTextFieldWithDefault('street'); - $helperInstance->addFieldText('city', "Wohnort:"); - $helperInstance->addInputTextFieldWithDefault('city'); - - // Include birthday? - if ($helperInstance->ifProfileIncludesBirthDay()) { - $helperInstance->addFormSubGroup('birthday', "Verrate uns doch dein Geburtsdatum, als Dankeschön erhälst du interessante Prämien - ausschliesslich per Email - zum Geburtstag zugesandt! Gültiges Format: TT.MM.JJJJ"); - $helperInstance->addInputTextField('birth_day'); - $helperInstance->addFieldText('birth_day', "."); - $helperInstance->addInputTextField('birth_month'); - $helperInstance->addFieldText('birth_day', "."); - $helperInstance->addInputTextField('birth_year'); - } // END - if -} // END - if - -// Add sub group for zip code -$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); -$helperInstance->addFieldText('zip', "Postleitzahl:"); -$helperInstance->addInputTextFieldWithDefault('zip'); - -// Add sub group for chat protocols -$helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); - -// Add ICQ chat? -if ($helperInstance->ifChatEnabled('icq')) { - $helperInstance->addFieldText('icq', "ICQ-Nummer:"); - $helperInstance->addInputTextFieldWithDefault('icq'); -} // END - if - -// Add Jabber chat? -if ($helperInstance->ifChatEnabled('jabber')) { - $helperInstance->addFieldText('jabber', "Jabber:"); - $helperInstance->addInputTextFieldWithDefault('jabber'); -} // END - if - -// Add Yahoo! chat? -if ($helperInstance->ifChatEnabled('yahoo')) { - $helperInstance->addFieldText('yahoo', "Yahoo!:"); - $helperInstance->addInputTextFieldWithDefault('yahoo'); -} // END - if - -// Add AOL chat? -if ($helperInstance->ifChatEnabled('aol')) { - $helperInstance->addFieldText('aol', "AOL-Screenname:"); - $helperInstance->addInputTextFieldWithDefault('aol'); -} // END - if - -// Add MSN chat? -if ($helperInstance->ifChatEnabled('msn')) { - $helperInstance->addFieldText('msn', "MSN:"); - $helperInstance->addInputTextFieldWithDefault('msn'); -} // END - if - -if (!$helperInstance->ifRegisterRequiresEmailVerification()) { - $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per Email sind im Loginbereich verfeinerbar, welche du genau haben willst."); -} // END - if - -// Rules already accepted? -if ($helperInstance->ifRulesHaveChanged()) { - $helperInstance->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); - $helperInstance->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); - $helperInstance->addInputCheckboxField('rules', false); -} else { - $helperInstance->addFormNote('rules_accepted', "Du hast die aktuellen Spielregeln akzeptiert. Vielen Dank!"); - $helperInstance->addInputHiddenField('rules', "1"); -} - -// CAPTCHA enabled? -if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_user', "Das Ändern von Profildaten ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit deine Änderungen gespeichert werden können."); - $helperInstance->addCaptcha(); -} // END - if - -// Ask again for current account password -$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein."); -$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:"); -$helperInstance->addInputPasswordField('pass_old'); - -// Final notices -$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); -$helperInstance->addInputResetButton("Alles nochmal eingeben"); -$helperInstance->addInputSubmitButton("Accountdaten aktualisieren"); -$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); - -// Flush finished form -$helperInstance->flushContent(); - -// [EOC] -?> -
- Deine Profildaten bearbeiten -
- -
- {?shipsimu_profile?} -
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp deleted file mode 100644 index fdc7c4e..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp +++ /dev/null @@ -1,60 +0,0 @@ -prefetchValueInstance('payments'); - -// Add form group -$helperInstance->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an."); - -// Add sub group -$helperInstance->addInputSelectField('type', "--- Bitte auswählen ---"); - -// In-game currencies (if more than default add them here!) -$helperInstance->addSelectSubOption('currencies', "--- Währungen ---"); -$helperInstance->addSelectOption('currency', "{?currency?}"); - -// Raw resources -$helperInstance->addSelectSubOption('raw_resources', "--- Rohstoffe ---"); -$helperInstance->addSelectOption('raw_wood', "Holz"); -$helperInstance->addSelectOption('raw_iron', "Metall"); -$helperInstance->addSelectOption('raw_stones', "Steine"); - -// This is needed to close the select tag -$helperInstance->addInputSelectField('type', ""); - -// Field for amount -$helperInstance->addFormSubGroup('amount', "Gebe hier in ganzen Zahlen die Menge an, die du nachbestellen willst."); -$helperInstance->addInputTextField('amount', 1000); - -// Add payments -$helperInstance->getValueInstance()->addResultsToHelper($helperInstance); - -// Ask again for current account password -$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Nachbestellung dein derzeitiges Passwort ein."); -$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:"); -$helperInstance->addInputPasswordField('pass_old'); - -// CAPTCHA enbaled? -if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:"); - $helperInstance->addCaptcha(); -} // END - if - -// Submit button -$helperInstance->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!"); -$helperInstance->addInputResetButton("Eingaben löschen"); -$helperInstance->addInputSubmitButton("Nachbestellung verbindlich aufgeben"); -$helperInstance->flushContent(); - -// [EOC] -?> -
-
- Jetzt dein {?currency?}-Konto aufladen! -
-
- {?shipsimu_refill?} -
-
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp deleted file mode 100644 index df4a8de..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp +++ /dev/null @@ -1,79 +0,0 @@ -prefetchValueInstance('user'); - -// Add submit button or notice -if ($helperInstance->ifUserAccountUnconfirmed()) { - // Add submit button - $helperInstance->addInputHiddenFieldWithDefault('email'); - $helperInstance->addInputSubmitButton("Bestätigungslink erneut aussenden"); -} elseif ($helperInstance->ifUserAccountLocked()) { - // Account is locked - $helperInstance->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre: - ".$helperInstance->getValueField('lock_reason')." - Bitte melde dich beim Support, damit dieser dir weiterhelfen kann." - ); -} elseif ($helperInstance->ifUserAccountGuest()) { - // Account is guest account - $helperInstance->addFormNote('status_guest', "Gästeaccounts sind in der Funktionalität - leicht eingeschränkt. Bitte melde dich an, damit du ein - vollwertiges Account bekommst." - ); -} - -// Flush content and automatically close the form -$helperInstance->flushContent(); - -// Build the form for confirmation -$helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, 'confirm_code')); - -// Pre-fetch field data with a given registry key -$helperInstance->prefetchValueInstance('user'); - -if ($helperInstance->ifUserAccountUnconfirmed()) { - // Add code box - $helperInstance->addFormGroup('code', "Bitte gebe hier den Bestätigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen."); - $helperInstance->addFieldText('code', "Bestätigungscode aus der Mail:"); - $helperInstance->addInputTextField('code'); - - // Add submit button - $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!"); - $helperInstance->addInputResetButton("Nochmal eingeben"); - $helperInstance->addInputSubmitButton("Bestätigungscode absenden"); -} else { - // Add message - $helperInstance->addFormNote('status_not_unconfirmed', "Möglicherweise hast du einen Bestätigungslink angeklickt, obwohl dein Account bereits freigegeben oder gesperrt ist."); -} - -// Flush content and automatically close the form -$helperInstance->flushContent(); - -// [EOC] -?> -
- Problem mit deinem Account gefunden: -
- -
- Du bist möglicherweise für deine ausgewählte Aktion nicht - berechtigt oder du hast noch deine Email-Adresse nicht bestätigt. Du - kannst dir nun den Bestätigungslink erneut aussenden lassen, oder den - Bestätigungscode unten eingeben. - - - -
- Weitere Möglichkeiten: -
- -
- {?confirm_code?} -
-
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp deleted file mode 100644 index 413a72a..0000000 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp +++ /dev/null @@ -1,3 +0,0 @@ -
- {?shipsimu_login_news?} -
diff --git a/application/ship-simu/templates/de/code/block_company_data.ctp b/application/ship-simu/templates/de/code/block_company_data.ctp deleted file mode 100644 index 9752acf..0000000 --- a/application/ship-simu/templates/de/code/block_company_data.ctp +++ /dev/null @@ -1,18 +0,0 @@ -addActionLinkById('company', 'company'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
- Firmenstatus: {?company_status?} -
- diff --git a/application/ship-simu/templates/de/code/block_persona_data.ctp b/application/ship-simu/templates/de/code/block_persona_data.ctp deleted file mode 100644 index bff6bfa..0000000 --- a/application/ship-simu/templates/de/code/block_persona_data.ctp +++ /dev/null @@ -1,27 +0,0 @@ -prefetchValueInstance('user'); - -// Flush the content out -$helperInstance->flushContent(); - -// [EOC] -?> -
- Spielername: {?block_username?} -
-
- Spielerstatus: {?block_user_status?} -
-
- {?currency?}: {?block_points?} -
-
- {?profile?} -
-
- Angemeldet seit: {?block_registered?} -
diff --git a/application/ship-simu/templates/de/code/captch_graphic_code.ctp b/application/ship-simu/templates/de/code/captch_graphic_code.ctp deleted file mode 100644 index 121fb00..0000000 --- a/application/ship-simu/templates/de/code/captch_graphic_code.ctp +++ /dev/null @@ -1,23 +0,0 @@ -addFieldText('captcha_code', "Bitte wiederhole den Code:"); -$captchaHelper->addInputTextField('c_code'); - -// Add hidden field with validation hash -$captchaHelper->addInputHiddenField('hash', $this->readVariable('captcha_hash')); - -// Flush content -$captchaHelper->flushContent(); - -// [EOC] -?> -
- CAPTCHA-Bild -
-
- {?captcha_code?} -
diff --git a/application/ship-simu/templates/de/code/confirm_link.ctp b/application/ship-simu/templates/de/code/confirm_link.ctp deleted file mode 100644 index 25f6e67..0000000 --- a/application/ship-simu/templates/de/code/confirm_link.ctp +++ /dev/null @@ -1,25 +0,0 @@ -addLinkWithTextById('direct_login'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
- Bestätigung Deiner Email-Adresse: -
- -
- Hallo {?username?}! Du hast heute deine - Email-Addresse bestätigt, wodurch alle Spielefunktionen entsperrt - worden sind. Viel Spass beim Spielen! -
- - diff --git a/application/ship-simu/templates/de/code/emergency_exit.ctp b/application/ship-simu/templates/de/code/emergency_exit.ctp deleted file mode 100644 index e974daf..0000000 --- a/application/ship-simu/templates/de/code/emergency_exit.ctp +++ /dev/null @@ -1,29 +0,0 @@ -{?header:title="Problem in application framework detected!"?} - -
- $content[message] -
- -
-
- File inclusion backtrace: -
-
- $content[backtrace] -
-
- -
-
- Statistics -
-
- Total objects: $content[total_objects] -
-
- Loaded class files: $content[total_includes] - (Including exception and interfaces.) -
-
- -{?footer_msg:footer_msg="Please contact the support and supply the full above message, if you think you are not qualified to fix this problem."?} diff --git a/application/ship-simu/templates/de/code/footer.ctp b/application/ship-simu/templates/de/code/footer.ctp deleted file mode 100644 index aa82e68..0000000 --- a/application/ship-simu/templates/de/code/footer.ctp +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/de/code/footer_msg.ctp b/application/ship-simu/templates/de/code/footer_msg.ctp deleted file mode 100644 index fb1de36..0000000 --- a/application/ship-simu/templates/de/code/footer_msg.ctp +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/application/ship-simu/templates/de/code/government_failed_main.ctp b/application/ship-simu/templates/de/code/government_failed_main.ctp deleted file mode 100644 index b073132..0000000 --- a/application/ship-simu/templates/de/code/government_failed_main.ctp +++ /dev/null @@ -1,106 +0,0 @@ -prefetchValueInstance('user'); - -// Assign fields with template variables -$blockInstance->assignField('username'); -$blockInstance->assignFieldWithFilter('user_status', "user_status_translator"); - -// Shall we include registration date? -if ($blockInstance->ifIncludeRegistrationStamp()) { - // Then assign it as well! - $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp'); -} // END - if - -// Flush the content out to a template variable -$blockInstance->flushContent(); - -////////////////////////////////////// -// Assign the shipping company data // -////////////////////////////////////// - -// Get a new instance for personal data -$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data')); - -// Set the data source instance -$blockInstance->prefetchValueInstance('company', 'user'); - -// Assign the company name -if ($blockInstance->getValueInstance()->ifUserIsFounder()) { - // User is the founder of the company - $blockInstance->assignMessageField('company_status', "user_is_company_founder"); - $blockInstance->assignLinkFieldWithAction('company' , "company_overview"); - $blockInstance->assignMessageField('company', "link_text_company_overview"); - $blockInstance->assignMessageField('company_title', "link_title_company_overview"); -} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { - // User owns the company - $blockInstance->assignMessageField('company_status', "user_is_company_owner"); - $blockInstance->assignLinkFieldWithAction('company' , "company_overview"); - $blockInstance->assignMessageField('company', "link_text_company_overview"); - $blockInstance->assignMessageField('company_title', "link_title_company_overview"); -} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) { - // User is employed in company - $blockInstance->assignMessageField('company_status', "user_is_employed_in_company"); - $blockInstance->assignLinkFieldWithAction('company' , "employee_overview"); - $blockInstance->assignMessageField('company', "link_text_employee_overview"); - $blockInstance->assignMessageField('company_title', "link_title_employee_overview"); -} else { - // No company participation! - $blockInstance->assignMessageField('company_status', "user_not_assigned_company"); - $blockInstance->assignLinkFieldWithAction('company' , "company"); - $blockInstance->assignMessageField('company', "link_text_company"); - $blockInstance->assignMessageField('company_title', "link_title_company"); -} - -// Flush the content out to a template variable -$blockInstance->flushContent(); - -// Get helper instance -$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout')); - -// Add action -$linkInstance->addActionLinkById('logout', 'logout'); - -// Flush the content -$linkInstance->flushContent(); - -// [EOC] -?> -
- Willkommen zum Staat in {?app_full_name?}! -
- -
- {?government_failed_content?} -
- -
-
- Account-Infos: -
- -
- {?persona_data?} -
- -
- {?logout?} -
-
- -
-
- Reederei-Infos: -
- -
- {?company_data?} -
-
diff --git a/application/ship-simu/templates/de/code/header.ctp b/application/ship-simu/templates/de/code/header.ctp deleted file mode 100644 index ed67731..0000000 --- a/application/ship-simu/templates/de/code/header.ctp +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {?app_full_name?} - {?title?} - - - - - - - - - - - - {?header_extras_hook?} - - - -
diff --git a/application/ship-simu/templates/de/code/header_extras_hook.ctp b/application/ship-simu/templates/de/code/header_extras_hook.ctp deleted file mode 100644 index 4375e22..0000000 --- a/application/ship-simu/templates/de/code/header_extras_hook.ctp +++ /dev/null @@ -1 +0,0 @@ - diff --git a/application/ship-simu/templates/de/code/home.ctp b/application/ship-simu/templates/de/code/home.ctp deleted file mode 100644 index c530602..0000000 --- a/application/ship-simu/templates/de/code/home.ctp +++ /dev/null @@ -1,7 +0,0 @@ -
- Willkommen zum {?app_full_name?} -
- -
- {?shipsimu_news?} -
diff --git a/application/ship-simu/templates/de/code/login_failed.ctp b/application/ship-simu/templates/de/code/login_failed.ctp deleted file mode 100644 index 166c48e..0000000 --- a/application/ship-simu/templates/de/code/login_failed.ctp +++ /dev/null @@ -1,46 +0,0 @@ -addLinkWithTextById('login_retry'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
- Du bist nicht mehr im Spiel eingeloggt! -
- -
-
- Du bist nicht mehr in {?app_full_name?} eingeloggt. - Dies kann verschiedene Gründe haben: -
- -
    -
  1. Dein Browser nimmt keine Cookies an.
  2. -
  3. Du hast den Loginbereich aus deinen Bookmarks/Favoriten aufgerufen - und die Cookies sind gelöscht.
  4. -
  5. Es besteht ein Problem mit dem Server, wofür du meistens nichts - kannst. Bitte kontaktiere den Support, falls dieses Problem - weiterhin besteht.
  6. -
- - -
- - diff --git a/application/ship-simu/templates/de/code/login_form.ctp b/application/ship-simu/templates/de/code/login_form.ctp deleted file mode 100644 index ae60048..0000000 --- a/application/ship-simu/templates/de/code/login_form.ctp +++ /dev/null @@ -1,99 +0,0 @@ -ifLoginIsEnabled()) { - // Formular ist aktiv - $helperInstance->addFormGroup('login', "Gebe hier deine Logindaten ein:"); - - // Welches Loginverfahren wurde konfiguriert? - if ($helperInstance->ifLoginWithUsername()) { - // Login mit Username - $helperInstance->addFormSubGroup('username', "Bitte mit deinem Nickname einloggen."); - $helperInstance->addFieldText('username', "Dein Nickname:"); - $helperInstance->addInputTextField('username'); - } elseif ($helperInstance->ifLoginWithEmail()) { - // Login mit Email - $helperInstance->addFormSubGroup('email', "Bitte mit deiner Email-Adresse einloggen."); - $helperInstance->addFieldText('email', "Deine Email-Addresse:"); - $helperInstance->addInputTextField('email'); - } else { - // Login mit Email/Username - $helperInstance->addFormSubGroup('user_email', "Bitte mit deinem Nickname oder Email-Adresse einloggen."); - $helperInstance->addFieldText('user_email', "Dein Nickname/Email:"); - $helperInstance->addInputTextField('user_email'); - } - - $helperInstance->addFormSubGroup('pass', "Gebe dein Passwort von der Anmeldung ein."); - $helperInstance->addFieldText('pass', "Dein Passwort:"); - $helperInstance->addInputPasswordField('pass'); - - // CAPTCHA enabled? - if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_user', "Das Benutzer-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); - $helperInstance->addCaptcha(); - } // END - if - - // Submit buttons - $helperInstance->addFormGroup('buttons_user', "Alles richtig eingegeben?"); - $helperInstance->addInputResetButton("Formular leeren"); - $helperInstance->addInputSubmitButton("Zum Spiel einloggen"); -} else { - // Formular deaktiviert - $helperInstance->addFormNote('form_deactivated', "Einloggen in's Spiel ist derzeit administrativ deaktiviert worden. Bitte komme später noch mal wieder."); - $helperInstance->addFormNote('admin_notice', "Nachricht vom Admin: ".$this->getConfigInstance()->readConfig('login_disabled_reason').""); -} - -// Formular schliessen -$helperInstance->flushContent(); - -// Ist Gastlogin erlaubt? -if ($helperInstance->ifGuestLoginAllowed()) { - // Neue Helper-Instanz holen - $helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, 'shipsimu_guest_login')); - $helperInstance->addInputHiddenConfiguredField('user', 'guest_login'); - $helperInstance->addInputHiddenConfiguredField('passwd', 'guest_login'); - - // CAPTCHA enbaled? - if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha_guest', "Unser Gast-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); - $helperInstance->addCaptcha(); - } // END - if - - // Submit button - $helperInstance->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschränkt. Mehr dazu unter "Gastlogin"."); - $helperInstance->addInputSubmitButton("Als Gast einloggen"); - $helperInstance->flushContent(); -} - -// Get helper instance -$helperInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'register')); - -// Set link text -$helperInstance->addLinkWithTextById('register_login'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
- Einloggen zu {?app_full_name?} -
- -
-
- {?shipsimu_user_login?} -
- -
- {?shipsimu_guest_login?} -
-
- - diff --git a/application/ship-simu/templates/de/code/login_main.ctp b/application/ship-simu/templates/de/code/login_main.ctp deleted file mode 100644 index 56adbab..0000000 --- a/application/ship-simu/templates/de/code/login_main.ctp +++ /dev/null @@ -1,107 +0,0 @@ -prefetchValueInstance('user', 'user_points'); - -// Assign fields with template variables -$blockInstance->assignField('username'); -$blockInstance->assignFieldWithFilter('user_status', 'user_status_translator'); -$blockInstance->assignFieldWithFilter('points', 'format_number'); - -// Shall we include registration date? -if ($blockInstance->ifIncludeRegistrationStamp()) { - // Then assign it as well! - $blockInstance->assignFieldWithFilter('registered', 'format_timestamp'); -} // END - if - -// Flush the content out to a template variable -$blockInstance->flushContent(); - -////////////////////////////////////// -// Assign the shipping company data // -////////////////////////////////////// - -// Get a new instance for personal data -$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data')); - -// Set the data source instance -$blockInstance->prefetchValueInstance('company', 'user'); - -// Assign the company name -if ($blockInstance->getValueInstance()->ifUserIsFounder()) { - // User is the founder of the company - $blockInstance->assignMessageField('company_status', 'user_is_company_founder'); - $blockInstance->assignLinkFieldWithAction('company' , 'company_overview'); - $blockInstance->assignMessageField('company', 'link_text_company_overview'); - $blockInstance->assignMessageField('company_title', 'link_title_company_overview'); -} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { - // User owns the company - $blockInstance->assignMessageField('company_status', 'user_is_company_owner'); - $blockInstance->assignLinkFieldWithAction('company' , 'company_overview'); - $blockInstance->assignMessageField('company', 'link_text_company_overview'); - $blockInstance->assignMessageField('company_title', 'link_title_company_overview'); -} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) { - // User is employed in company - $blockInstance->assignMessageField('company_status', 'user_is_employed_in_company'); - $blockInstance->assignLinkFieldWithAction('company' , 'employee_overview'); - $blockInstance->assignMessageField('company', 'link_text_employee_overview'); - $blockInstance->assignMessageField('company_title', 'link_title_employee_overview'); -} else { - // No company participation! - $blockInstance->assignMessageField('company_status', 'user_not_assigned_company'); - $blockInstance->assignLinkFieldWithAction('company' , 'company'); - $blockInstance->assignMessageField('company', 'link_text_company'); - $blockInstance->assignMessageField('company_title', 'link_title_company'); -} - -// Flush the content out to a template variable -$blockInstance->flushContent(); - -// Get helper instance -$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout')); - -// Add action -$linkInstance->addActionLinkById('logout', 'logout'); - -// Flush the content -$linkInstance->flushContent(); - -// [EOC] -?> -
- Willkommen im Loginbereich von {?app_full_name?}! -
- -
- {?login_content?} -
- -
-
- Account-Infos: -
- -
- {?persona_data?} -
- -
- {?logout?} -
-
- -
-
- Reederei-Infos: -
- -
- {?company_data?} -
-
diff --git a/application/ship-simu/templates/de/code/logout_done.ctp b/application/ship-simu/templates/de/code/logout_done.ctp deleted file mode 100644 index 9843f50..0000000 --- a/application/ship-simu/templates/de/code/logout_done.ctp +++ /dev/null @@ -1,19 +0,0 @@ -addLinkWithTextById('relogin'); - -// Flush the content -$helperInstance->flushContent(); - -// [EOC] -?> -
- Du bist jetzt aus dem Spiel ausgeloggt! -
- -
- Du kannst dich nun {?relogin?} oder weiter auf unseren Seiten bleiben. ;-) -
diff --git a/application/ship-simu/templates/de/code/mail_debug.ctp b/application/ship-simu/templates/de/code/mail_debug.ctp deleted file mode 100644 index e62dd07..0000000 --- a/application/ship-simu/templates/de/code/mail_debug.ctp +++ /dev/null @@ -1,25 +0,0 @@ -
- Mail-Debug-Ausgabe: -
- -
-
- Von: {?sender?} -
-
- An: {?recipient?} -
-
- Betreff: {?subject?} -
-
- -
-
- Nachricht: -
- -
- {?message?} -
-
diff --git a/application/ship-simu/templates/de/code/register_form.ctp b/application/ship-simu/templates/de/code/register_form.ctp deleted file mode 100644 index 90dca57..0000000 --- a/application/ship-simu/templates/de/code/register_form.ctp +++ /dev/null @@ -1,134 +0,0 @@ -addFormGroup('login', "Bitte gebe hier gewünschten Nickname und dein Zugangspasswort ein."); -$helperInstance->addFormSubGroup('username', "Dein Nickname wird erst nach Absenden des Formulares geprüft. Später bauen wir dann einen automatischen Test ein, der dir sofort zeigt, ob der Nickname bereits vergeben ist."); -$helperInstance->addFieldText('username', "Nickname im Spiel:"); -$helperInstance->addInputTextField('username'); -$helperInstance->addFormSubGroup('pass', "Dein Passwort sollte nicht zu leicht erratbar sein. Später bauen wir hier noch einen automatischen Test ein, der dir sofort die Passwortstärke anzeigt."); -$helperInstance->addFieldText('pass1', "Passwort:"); -$helperInstance->addInputPasswordField('pass1'); -$helperInstance->addFieldText('pass2', "Passwortwiederholung:"); -$helperInstance->addInputPasswordField('pass2'); - -// Does this registration require an email? -if ($helperInstance->ifRegisterRequiresEmailVerification()) { - $helperInstance->addFormGroup('email', "Bitte gebe deine Email zweimal (ein zweites Mal zur Bestätigung) ein, damit wir dir deinen Freischaltlink zusenden können."); - $helperInstance->addFieldText('email1', "Email-Adresse:"); - $helperInstance->addInputTextField('email1'); - $helperInstance->addFieldText('email2', "Wiederholung Email-Adresse:"); - $helperInstance->addInputTextField('email2'); - - // Must the email address be unique in this system? - if ($helperInstance->ifEmailMustBeUnique()) { - $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); - } // END - if -} // END - if - -// Shall we also ask some personal data to complete the profile? -if ($helperInstance->ifRegisterIncludesProfile()) { - $helperInstance->addFormGroup('profile', "Hier kannst du zusätzlich deine Profildaten vorweg eingeben, du kannst sie aber auch nach dem Login vervollständigen!"); - - if (!$helperInstance->ifRegisterRequiresEmailVerification()) { - $helperInstance->addFormSubGroup('email', "Die Angabe deiner Email-Adresse ist nur dann nötig, wenn du auch Email-Benachrichtigungen (*1) haben möchtest."); - $helperInstance->addFieldText('email1', "Email-Adresse:"); - $helperInstance->addInputTextField('email1'); - - // Must the email address be unique in this system? - if ($helperInstance->ifEmailMustBeUnique()) { - $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); - } // END - if - } // END - if - - // Persoenliche Daten mit in der Anmeldung abfragen? - if ($helperInstance->ifRegisterIncludesPersonaData()) { - $helperInstance->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); - $helperInstance->addFieldText('surname', "Dein Vorname:"); - $helperInstance->addInputTextField('surname'); - $helperInstance->addFieldText('family', "Dein Nachname:"); - $helperInstance->addInputTextField('family'); - $helperInstance->addFieldText('street', "Strasse und Hausnummer:"); - $helperInstance->addInputTextField('street'); - $helperInstance->addFieldText('city', "Wohnort:"); - $helperInstance->addInputTextField('city'); - - // Include birthday? - if ($helperInstance->ifProfileIncludesBirthDay()) { - $helperInstance->addFormSubGroup('birthday', "Verrate uns doch dein Geburtsdatum, als Dankeschön erhälst du interessante Prämien - ausschliesslich per Email - zum Geburtstag zugesandt! Gültiges Format: TT.MM.JJJJ"); - $helperInstance->addInputTextField('birth_day'); - $helperInstance->addFieldText('birth_day', "."); - $helperInstance->addInputTextField('birth_month'); - $helperInstance->addFieldText('birth_day', "."); - $helperInstance->addInputTextField('birth_year'); - } // END - if - } // END - if - - $helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); - $helperInstance->addFieldText('zip', "Postleitzahl:"); - $helperInstance->addInputTextField('zip'); - - $helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); - - if ($helperInstance->ifChatEnabled('icq')) { - $helperInstance->addFieldText('icq', "ICQ-Nummer:"); - $helperInstance->addInputTextField('icq'); - } // END - if - - if ($helperInstance->ifChatEnabled('jabber')) { - $helperInstance->addFieldText('jabber', "Jabber:"); - $helperInstance->addInputTextField('jabber'); - } // END - if - - if ($helperInstance->ifChatEnabled('yahoo')) { - $helperInstance->addFieldText('yahoo', "Yahoo!:"); - $helperInstance->addInputTextField('yahoo'); - } // END - if - - if ($helperInstance->ifChatEnabled('aol')) { - $helperInstance->addFieldText('aol', "AOL-Screenname:"); - $helperInstance->addInputTextField('aol'); - } // END - if - - if ($helperInstance->ifChatEnabled('msn')) { - $helperInstance->addFieldText('msn', "MSN:"); - $helperInstance->addInputTextField('msn'); - } // END - if - - if (!$helperInstance->ifRegisterRequiresEmailVerification()) { - $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst."); - } // END - Extra note - -} // END - ask profile data - -// Spielregeln abfragen -$helperInstance->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); -$helperInstance->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); -$helperInstance->addInputCheckboxField('rules', false); - -// Add CAPTCHA? -if ($helperInstance->ifFormSecuredWithCaptcha()) { - $helperInstance->addFormGroup('captcha', "Bitte wiederhole den angezeigten Code damit die Anmeldung abgeschlossen werden kann."); - $helperInstance->addCaptcha(); -} // END - if - -// Final note and submit buttons -$helperInstance->addFormGroup('buttons', "Wenn du alle benötigten Felder korrekt ausgefüt hast, kannst du die Anmeldung abschliessen."); - -$helperInstance->addInputResetButton("Alles nochmal eingeben"); -$helperInstance->addInputSubmitButton("Anmeldung zum Spiel abschliessen"); -$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); -$helperInstance->flushContent(); - -// [EOC] -?> -
- Anmeldung bei {?app_full_name?} -
- -
- {?shipsimu_register?} -
diff --git a/application/ship-simu/templates/de/code/shipsimu_main.ctp b/application/ship-simu/templates/de/code/shipsimu_main.ctp deleted file mode 100644 index 3dd1296..0000000 --- a/application/ship-simu/templates/de/code/shipsimu_main.ctp +++ /dev/null @@ -1,27 +0,0 @@ -{?header?} - -
- {?shipsimu_header?} -
- - - - - -
- {?language_selector?} -
- -
- {?content?} -
- - - -{?footer?} diff --git a/application/ship-simu/templates/de/code/status.ctp b/application/ship-simu/templates/de/code/status.ctp deleted file mode 100644 index 730a240..0000000 --- a/application/ship-simu/templates/de/code/status.ctp +++ /dev/null @@ -1,7 +0,0 @@ -
- Es besteht ein Problem mit Ihrem Account -
- -
- {?status_problem?} -
diff --git a/application/ship-simu/templates/de/emails/.htaccess b/application/ship-simu/templates/de/emails/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/de/emails/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/de/emails/text_resend_link.tpl b/application/ship-simu/templates/de/emails/text_resend_link.tpl deleted file mode 100644 index ab28bab..0000000 --- a/application/ship-simu/templates/de/emails/text_resend_link.tpl +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/application/ship-simu/templates/de/html/.htaccess b/application/ship-simu/templates/de/html/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/de/html/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/de/html/nav_advert.tpl b/application/ship-simu/templates/de/html/nav_advert.tpl deleted file mode 100644 index 22da43b..0000000 --- a/application/ship-simu/templates/de/html/nav_advert.tpl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/application/ship-simu/templates/de/html/selector_ship-simu.tpl b/application/ship-simu/templates/de/html/selector_ship-simu.tpl deleted file mode 100644 index b96640e..0000000 --- a/application/ship-simu/templates/de/html/selector_ship-simu.tpl +++ /dev/null @@ -1,17 +0,0 @@ -
-
- Gründen Sie eine virtuelle Reederei an den bedeutestens - Welthäfen! Oder treten Sie einer Reederei als Angestellter bei und - arbeiten Sie sich bis in die Chef-Etagge hoch! -
- -
- Oder fangen Sie als Matrose auf einem Passagierschiff (virtuell) an zu - arbeiten und werden Sie nach wenigen Kreuzfahrten bald Kapitän! -
- -
- Oder buchen Sie eine virtuelle Kreuzfahrt durch die bekannten Meeren in - {!POINTS!} in einer Luxus-Suite! -
-
diff --git a/application/ship-simu/templates/de/image/base_code.xml b/application/ship-simu/templates/de/image/base_code.xml deleted file mode 100644 index 5de71be..0000000 --- a/application/ship-simu/templates/de/image/base_code.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/de/image/code_captcha.img b/application/ship-simu/templates/de/image/code_captcha.img deleted file mode 100644 index 223e4fb..0000000 --- a/application/ship-simu/templates/de/image/code_captcha.img +++ /dev/null @@ -1,78 +0,0 @@ -setImageName('code_captcha'); -$helper->setBaseImage('base_code'); - -// Set image dimensions -$helper->setWidth(100); -$helper->setHeight(50); - -// Get random number -$rand = $helper->getRngInstance()->randomNumber(0, 6); - -// Background and foreground color -switch ($rand) { - case 1: - // First varriant - $helper->setBackgroundColorRedGreenBlue('rand', 0x90 , 0x00 ); - $helper->setForegroundColorRedGreenBlue(0x00 , 0xff , 'rand'); - break; - - case 2: - // Second varriant - $helper->setBackgroundColorRedGreenBlue(0x90 , 'rand', 0x00 ); - $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand'); - break; - - case 3: - // Third varriant - $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 ); - $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xff ); - break; - - case 4: - // Forth varriant - $helper->setBackgroundColorRedGreenBlue(0x00 , 0x90 , 'rand'); - $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xa0 ); - break; - - case 5: - // Fith varriant - $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 ); - $helper->setForegroundColorRedGreenBlue(0x00 , 0xe0 , 'rand'); - break; - - default: - // Last varriant - $helper->setBackgroundColorRedGreenBlue(0x00 , 'rand', 0x90 ); - $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand'); - break; -} - -// Random X/Y factors... -$xRand = $helper->getRngInstance()->randomNumber(0, 45); -$yRand = $helper->getRngInstance()->randomNumber(0, 25); - -// Add code -$helper->addTextLine('code'); -$helper->setCoord((5 + $xRand), (5 + $yRand)); -$helper->setFontSize('rand'); -$helper->setImageString('{?decrypted_code?}'); - -// Only for debug! -/* -$helper->addTextLine('debug'); -$helper->setCoord(90, 35); -$helper->setFontSize(3); -$helper->setImageString($rand); -*/ - -// Flush content to the template engine -$helper->flushContent(); - -// Comment this out if image is done -//$this->debugInstance(); - -// [EOF] -?> diff --git a/application/ship-simu/templates/de/image/emergency_exit.img b/application/ship-simu/templates/de/image/emergency_exit.img deleted file mode 100644 index bf67aa7..0000000 --- a/application/ship-simu/templates/de/image/emergency_exit.img +++ /dev/null @@ -1,18 +0,0 @@ -setImageName('emergency_exit'); -$helper->setBaseImage('base_exit'); - -// Set image dimensions -$helper->setWidth(100); -$helper->setHeight(50); - -// Flush content to the template engine -//$helper->flushContent(); - -// Comment this out if image is done -$this->debugInstance(); - -// [EOF] -?> diff --git a/application/ship-simu/templates/de/menu/.htaccess b/application/ship-simu/templates/de/menu/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/de/menu/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/de/menu/base_menu.xml b/application/ship-simu/templates/de/menu/base_menu.xml deleted file mode 100644 index 1c93350..0000000 --- a/application/ship-simu/templates/de/menu/base_menu.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - <title-id>{?menu_title_id?}</title-id> - <title-class>{!menu_title_class?}</title-class> - <title-text>{?menu_title?}</title-text> - - - - - {?entry_id?} - - {?anchor_id?} - {?anchor_text?} - {?anchor_title?} - {?anchor_href?} - - - - - {!footer_id?} - {?footer_design_class?} - {?menu_footer?} - - - - diff --git a/application/ship-simu/templates/de/menu/generic_menu_entries.xml b/application/ship-simu/templates/de/menu/generic_menu_entries.xml deleted file mode 100644 index 65c742e..0000000 --- a/application/ship-simu/templates/de/menu/generic_menu_entries.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - <title-id><![CDATA[home_menu_title]]></title-id> - <title-class><![CDATA[menu_title]]></title-class> - <title-text><![CDATA[Home:]]></title-text> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <title-id><![CDATA[law_menu_title]]></title-id> - <title-class><![CDATA[menu_title]]></title-class> - <title-text><![CDATA[Rechtliches:]]></title-text> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/!MISSING b/application/ship-simu/templates/game/!MISSING deleted file mode 100644 index 57cf1de..0000000 --- a/application/ship-simu/templates/game/!MISSING +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/application/ship-simu/templates/game/.htaccess b/application/ship-simu/templates/game/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/building/.htaccess b/application/ship-simu/templates/game/building/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/building/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/building/advanced_research_lab.xml b/application/ship-simu/templates/game/building/advanced_research_lab.xml deleted file mode 100644 index 48d3e5e..0000000 --- a/application/ship-simu/templates/game/building/advanced_research_lab.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - advanced_research_lab - research - - - - - - - - - - architecture - {?technology_type?} - 10 - - - - laboratory_equipment - {?technology_type?} - 8 - - - - diff --git a/application/ship-simu/templates/game/building/base_building.xml b/application/ship-simu/templates/game/building/base_building.xml deleted file mode 100644 index 0949690..0000000 --- a/application/ship-simu/templates/game/building/base_building.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - {?width?} - - {?height?} - - {?length?} - - - - - - - - - - - - {?id?} - {?name?} - {?type?} - {?level?} - {?max_floors?} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {?construction_currency?} - - - - {?construct_id?} - - - - - - - {?resource_id?} - {?resource_amount?} - - - - - - - - - - - - - - - - - - - - - - {?cleaning_currency?} - - - - - - - {?repair_currency?} - - - - - - - {?mortgage_currency?} - - - - - - - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - - - - - - diff --git a/application/ship-simu/templates/game/building/research_lab.xml b/application/ship-simu/templates/game/building/research_lab.xml deleted file mode 100644 index 091ad0a..0000000 --- a/application/ship-simu/templates/game/building/research_lab.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - research_lab - research - - - - - - - - - architecture - {?technology_type?} - 5 - - - - laboratory_equipment - {?technology_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/chemicals/.htaccess b/application/ship-simu/templates/game/chemicals/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/chemicals/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/company/.htaccess b/application/ship-simu/templates/game/company/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/company/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/container/.htaccess b/application/ship-simu/templates/game/container/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/container/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/container/base_container.xml b/application/ship-simu/templates/game/container/base_container.xml deleted file mode 100644 index be79f56..0000000 --- a/application/ship-simu/templates/game/container/base_container.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - {?id?} - - {?name?} - - {?type?} - - - {?width?} - {?length?} - {?height?} - - - - - - - - - - - - - - - - - - - {?content_id?} - {?content_type?} - {?content_amount?} - - - - - - - {?maintenance_id?} - {?maintenance_name?} - {?maintenance_type?} - - - diff --git a/application/ship-simu/templates/game/contract/.htaccess b/application/ship-simu/templates/game/contract/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/contract/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/contract/base_contract.xml b/application/ship-simu/templates/game/contract/base_contract.xml deleted file mode 100644 index bb59563..0000000 --- a/application/ship-simu/templates/game/contract/base_contract.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/drink/.htaccess b/application/ship-simu/templates/game/drink/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/drink/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/drink/base_drink.xml b/application/ship-simu/templates/game/drink/base_drink.xml deleted file mode 100644 index 6ac3a06..0000000 --- a/application/ship-simu/templates/game/drink/base_drink.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/electronic/.htaccess b/application/ship-simu/templates/game/electronic/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/electronic/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/electronic/base_electronic.xml b/application/ship-simu/templates/game/electronic/base_electronic.xml deleted file mode 100644 index 06945a5..0000000 --- a/application/ship-simu/templates/game/electronic/base_electronic.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - {?id?} - {?name?} - {?type?} - - - {?width?} - {?height?} - {?length?} - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_level?} - - - - - - - {?research_id?} - {?research_name?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/electronic/cellphone.xml b/application/ship-simu/templates/game/electronic/cellphone.xml deleted file mode 100644 index 2c7f2d8..0000000 --- a/application/ship-simu/templates/game/electronic/cellphone.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - cellphone - communication - - - 30 - 35 - 30 - - - - - - - - cellular_network - 1 - - - - - - - electronics - 6 - - - - diff --git a/application/ship-simu/templates/game/electronic/hifi_system.xml b/application/ship-simu/templates/game/electronic/hifi_system.xml deleted file mode 100644 index 76a1a8e..0000000 --- a/application/ship-simu/templates/game/electronic/hifi_system.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - hifi_system - entertainment - - - 70 - 70 - 80 - - - - - - - - - intergrated_currents - 6 - - - sound_equalizer - 3 - - - radio_receiving - 4 - - - - - - - electronics - 4 - - - - diff --git a/application/ship-simu/templates/game/electronic/radio_receiver.xml b/application/ship-simu/templates/game/electronic/radio_receiver.xml deleted file mode 100644 index ce5eb0d..0000000 --- a/application/ship-simu/templates/game/electronic/radio_receiver.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - radio_receiver - entertainment - - - 30 - 40 - 20 - - - - - - - - - intergrated_currents - 3 - - - radio_receiving - 1 - - - - - - - electronics - 3 - - - - diff --git a/application/ship-simu/templates/game/electronic/surround_system.xml b/application/ship-simu/templates/game/electronic/surround_system.xml deleted file mode 100644 index 31651a3..0000000 --- a/application/ship-simu/templates/game/electronic/surround_system.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - surround_system - entertainment - - - 120 - 140 - 120 - - - - - - - - - sound_processor - 3 - - - sound_equalizer - 5 - - - radio_receiving - 6 - - - - diff --git a/application/ship-simu/templates/game/electronic/television.xml b/application/ship-simu/templates/game/electronic/television.xml deleted file mode 100644 index 44da2f1..0000000 --- a/application/ship-simu/templates/game/electronic/television.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - television - entertainment - - - 100 - 110 - 90 - - - - - - - - - video_receiving - 1 - - - transistor - 1 - - - - diff --git a/application/ship-simu/templates/game/engine/.htaccess b/application/ship-simu/templates/game/engine/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/engine/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/engine/base_engine.xml b/application/ship-simu/templates/game/engine/base_engine.xml deleted file mode 100644 index 675d90f..0000000 --- a/application/ship-simu/templates/game/engine/base_engine.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type?} - {?horse_power?} - - - - {?fuel_id?} - {?fuel_name?} - {?fuel_type?} - - - - {?width?} - {?height?} - {?length?} - - - - - - - - {[?technology_id?} - {[?technology_name?} - {[?technology_level?} - - - - diff --git a/application/ship-simu/templates/game/farmer/.htaccess b/application/ship-simu/templates/game/farmer/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/farmer/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/farmer/base_farmer.xml b/application/ship-simu/templates/game/farmer/base_farmer.xml deleted file mode 100644 index 6542df2..0000000 --- a/application/ship-simu/templates/game/farmer/base_farmer.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type?} - - - {?month?} - {?day?} - {?year?} - - - {?productivity?} - {?experience?} - - - - - - {?produce_id?} - {?produce_name?} - {?produce_type?} - - - - - {?technology_id?} - {?technology_name?} - {?technology_level?} - - - - - diff --git a/application/ship-simu/templates/game/fruit/.htaccess b/application/ship-simu/templates/game/fruit/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/fruit/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/fruit/base_fruit.xml b/application/ship-simu/templates/game/fruit/base_fruit.xml deleted file mode 100644 index 482faad..0000000 --- a/application/ship-simu/templates/game/fruit/base_fruit.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/fuel/.htaccess b/application/ship-simu/templates/game/fuel/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/fuel/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/fuel/base_fuel.xml b/application/ship-simu/templates/game/fuel/base_fuel.xml deleted file mode 100644 index 0f023fb..0000000 --- a/application/ship-simu/templates/game/fuel/base_fuel.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - {?id?} - {?name?} - {?type?} - - diff --git a/application/ship-simu/templates/game/grain/.htaccess b/application/ship-simu/templates/game/grain/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/grain/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/grain/base_grain.xml b/application/ship-simu/templates/game/grain/base_grain.xml deleted file mode 100644 index eac45e4..0000000 --- a/application/ship-simu/templates/game/grain/base_grain.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/lifestock/.htaccess b/application/ship-simu/templates/game/lifestock/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/lifestock/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/lifestock/base_lifestock.xml b/application/ship-simu/templates/game/lifestock/base_lifestock.xml deleted file mode 100644 index 267077b..0000000 --- a/application/ship-simu/templates/game/lifestock/base_lifestock.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/merchant/.htaccess b/application/ship-simu/templates/game/merchant/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/merchant/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/merchant/base_merchant.xml b/application/ship-simu/templates/game/merchant/base_merchant.xml deleted file mode 100644 index 22d4c78..0000000 --- a/application/ship-simu/templates/game/merchant/base_merchant.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type? - - - - - - - - - - - - - - - - - - {?goods_id?} - {?goods_name?} - {?goods_type?} - {?goods_amount?} - {?goods_added?} - {?goods_remoed?} - - - diff --git a/application/ship-simu/templates/game/mineral/.htaccess b/application/ship-simu/templates/game/mineral/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/mineral/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/mineral/base_mineral.xml b/application/ship-simu/templates/game/mineral/base_mineral.xml deleted file mode 100644 index 64847ff..0000000 --- a/application/ship-simu/templates/game/mineral/base_mineral.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - {?id?} - {?type?} - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/produce/.htaccess b/application/ship-simu/templates/game/produce/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/produce/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/produce/base_produce.xml b/application/ship-simu/templates/game/produce/base_produce.xml deleted file mode 100644 index 29ca874..0000000 --- a/application/ship-simu/templates/game/produce/base_produce.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/research/.htaccess b/application/ship-simu/templates/game/research/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/research/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/research/base_research.xml b/application/ship-simu/templates/game/research/base_research.xml deleted file mode 100644 index 3c4d185..0000000 --- a/application/ship-simu/templates/game/research/base_research.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type?} - {?max_level?} - - - - - - - - - - - - - - - - - - - - - - - - - {?level?} - - - - - - - - - - - - - - - - - {?level_technology_id?} - {?level_technology_name?} - {?level_technology_type?} - {?level_technology_level?} - - - - - {?level_research_id?} - {?level_research_name?} - {?level_research_type?} - {?level_research_level?} - - - - - {?level_building_id?} - {?level_building_name?} - {?level_building_type?} - {?level_building_level?} - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - {?research_id?} - {?research_name?} - {?research_type?} - {?research_level?} - - - - - {?building_id?} - {?building_name?} - {?building_type?} - {?building_level?} - - - - diff --git a/application/ship-simu/templates/game/research/electricity.xml b/application/ship-simu/templates/game/research/electricity.xml deleted file mode 100644 index c6b3480..0000000 --- a/application/ship-simu/templates/game/research/electricity.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - electricity - electronics - 10 - - diff --git a/application/ship-simu/templates/game/research/electronics.xml b/application/ship-simu/templates/game/research/electronics.xml deleted file mode 100644 index c2a1f6e..0000000 --- a/application/ship-simu/templates/game/research/electronics.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - electronics - electronics - 20 - - - - - plastics - chemicals - 2 - - - - - electricity - {?research_type?} - 4 - - - - diff --git a/application/ship-simu/templates/game/research/mathematics.xml b/application/ship-simu/templates/game/research/mathematics.xml deleted file mode 100644 index 843c44e..0000000 --- a/application/ship-simu/templates/game/research/mathematics.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - mathematics - base - 10 - - diff --git a/application/ship-simu/templates/game/research/radio_receiving.xml b/application/ship-simu/templates/game/research/radio_receiving.xml deleted file mode 100644 index 3428478..0000000 --- a/application/ship-simu/templates/game/research/radio_receiving.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - radio_receiving - electronics - 10 - - - - - - - signal_modulation - electronics - 1 - - - - diff --git a/application/ship-simu/templates/game/research/statics.xml b/application/ship-simu/templates/game/research/statics.xml deleted file mode 100644 index 302412e..0000000 --- a/application/ship-simu/templates/game/research/statics.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - statics - construction - 20 - - - - - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - mathematics - {?research_type?} - 4 - - - - - {?building_name?} - {?building_type?} - {?building_level?} - - - - diff --git a/application/ship-simu/templates/game/resource/.htaccess b/application/ship-simu/templates/game/resource/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/resource/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/resource/base_resource.xml b/application/ship-simu/templates/game/resource/base_resource.xml deleted file mode 100644 index 8860210..0000000 --- a/application/ship-simu/templates/game/resource/base_resource.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type?} - - - - - - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - diff --git a/application/ship-simu/templates/game/ship/.htaccess b/application/ship-simu/templates/game/ship/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/ship/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/ship/base_ship.xml b/application/ship-simu/templates/game/ship/base_ship.xml deleted file mode 100644 index a33efe8..0000000 --- a/application/ship-simu/templates/game/ship/base_ship.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - {?id?} - - {?type?} - {?propeller?} - {?weight?} - {?displacement?} - - - - {?construction_id?} - - {?construction_contract_id?} - - {?construction_started?} - - {?construction_finished? - - - - - - - {?company_id?} - - - {?holder_started?} - {?holder_ended?} - - - - - - - - - - {?structure_id?} - {?structure_amount?} - {?structure_type?} - - - - - {?engine_id?{ - {?engine_type?} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - - - {?research_id?} - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/tank/.htaccess b/application/ship-simu/templates/game/tank/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/tank/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/tank/base_tank.xml b/application/ship-simu/templates/game/tank/base_tank.xml deleted file mode 100644 index c943576..0000000 --- a/application/ship-simu/templates/game/tank/base_tank.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - {?id?} - {?name?} - {?type?} - - - {?content_id?} - {?content_name?} - {?content_type?} - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/.htaccess b/application/ship-simu/templates/game/technology/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/technology/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/technology/architecture.xml b/application/ship-simu/templates/game/technology/architecture.xml deleted file mode 100644 index 6547cc5..0000000 --- a/application/ship-simu/templates/game/technology/architecture.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - architecture - construction - - - - - - - - drawings - {?technology_type?} - 5 - - - - - - - statics - {?research_type?} - 3 - - - mathematics - {?research_type?} - 6 - - - - diff --git a/application/ship-simu/templates/game/technology/base_technology.xml b/application/ship-simu/templates/game/technology/base_technology.xml deleted file mode 100644 index 846a215..0000000 --- a/application/ship-simu/templates/game/technology/base_technology.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - {?id?} - {?name?} - {?type?} - - - - - - - - - - - - - - - - {?list_level?} - {?level_gained?} - - - - - - - - - - - - - - - {?technology_level_id?} - {?technology_level_name?} - {?technology_level_level?} - - - - - - - {?research_level_id?} - {?research_level_name?} - {?research_level_level?} - - - - - - - - - - - - {?technology_id?} - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - - - {?research_id?} - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/cellular_network.xml b/application/ship-simu/templates/game/technology/cellular_network.xml deleted file mode 100644 index 77f4a82..0000000 --- a/application/ship-simu/templates/game/technology/cellular_network.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - cellular_network - communication - - - - - - - - - - - - - - - - - - electronics - {?research_type?} - 5 - - - - diff --git a/application/ship-simu/templates/game/technology/drawings.xml b/application/ship-simu/templates/game/technology/drawings.xml deleted file mode 100644 index 43dbf50..0000000 --- a/application/ship-simu/templates/game/technology/drawings.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - drawings - base - - diff --git a/application/ship-simu/templates/game/technology/glass_making.xml b/application/ship-simu/templates/game/technology/glass_making.xml deleted file mode 100644 index 7679857..0000000 --- a/application/ship-simu/templates/game/technology/glass_making.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - glass_making - production - - - - - - {?list_level?} - - - - - - - {?technology_level_name?} - {?technology_level_type?} - {?technology_level_level?} - - - - - - - {?research_level_name?} - {?research_level_type?} - {?research_level_level?} - - - - - - - - - - - - {?technology_name?} - {?technology_type?} - {?technology_level?} - - - - - - - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/household_devices.xml b/application/ship-simu/templates/game/technology/household_devices.xml deleted file mode 100644 index e19e14f..0000000 --- a/application/ship-simu/templates/game/technology/household_devices.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - household_devices - electronics - - - - - - - plastics - chemicals - 3 - - - - - - - electronics - {?research_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/technology/intergrated_currents.xml b/application/ship-simu/templates/game/technology/intergrated_currents.xml deleted file mode 100644 index bdfebce..0000000 --- a/application/ship-simu/templates/game/technology/intergrated_currents.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - intergrated_currents - eletronics - - - - - - - - transistor - electronics - 10 - - - - - - - silicium_mining - {?research_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/technology/laboratory_equipment.xml b/application/ship-simu/templates/game/technology/laboratory_equipment.xml deleted file mode 100644 index 1b40430..0000000 --- a/application/ship-simu/templates/game/technology/laboratory_equipment.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - laboratory_equipment - equipment - - - - - - plastics - chemicals - 3 - - - glass_making - {?technology_type?} - 5 - - - - diff --git a/application/ship-simu/templates/game/technology/naval_architecture.xml b/application/ship-simu/templates/game/technology/naval_architecture.xml deleted file mode 100644 index 5a00d72..0000000 --- a/application/ship-simu/templates/game/technology/naval_architecture.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - naval_architecture - ship_construction - - - - - - - architecture - {?technology_type?} - 3 - - - statics - {?technology_type?} - 5 - - - drawings - {?technology_type?} - 6 - - - - - - mathematics - {?research_type?} - 8 - - - - diff --git a/application/ship-simu/templates/game/technology/plastics.xml b/application/ship-simu/templates/game/technology/plastics.xml deleted file mode 100644 index 94f2720..0000000 --- a/application/ship-simu/templates/game/technology/plastics.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - plastics - production - - - - - - - - - {?technology_name?} - chemicals - {?technology_name?} - - - - - - - chemistry - chemicals - 3 - - - - diff --git a/application/ship-simu/templates/game/technology/signal_amplifying.xml b/application/ship-simu/templates/game/technology/signal_amplifying.xml deleted file mode 100644 index 5cc9e01..0000000 --- a/application/ship-simu/templates/game/technology/signal_amplifying.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - signal_amplifying - electronics - - - - - - - - transistor - electronics - 3 - - - - - - - modulation - {?research_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/technology/signal_modulation.xml b/application/ship-simu/templates/game/technology/signal_modulation.xml deleted file mode 100644 index 186a569..0000000 --- a/application/ship-simu/templates/game/technology/signal_modulation.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - signal_modulation - electronics - - - - - - - - transistor - electronics - 3 - - - - - - - modulation - {?research_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/technology/sound_equalizer.xml b/application/ship-simu/templates/game/technology/sound_equalizer.xml deleted file mode 100644 index 8d10f58..0000000 --- a/application/ship-simu/templates/game/technology/sound_equalizer.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - sound_equalizer - electronic - - - - - - - - transistor - electronics - 5 - - - - - - - - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/sound_processor.xml b/application/ship-simu/templates/game/technology/sound_processor.xml deleted file mode 100644 index d223b4f..0000000 --- a/application/ship-simu/templates/game/technology/sound_processor.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - sound_processor - electronic - - - - - - - - intergrated_current - electronics - 7 - - - surround_mixing - electronics - 1 - - - - - - - - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/surround_mixing.xml b/application/ship-simu/templates/game/technology/surround_mixing.xml deleted file mode 100644 index 9c674de..0000000 --- a/application/ship-simu/templates/game/technology/surround_mixing.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - surround_mixing - electronic - - - - - - - - intergrated_current - electronics - 6 - - - - - - - - {?research_name?} - {?research_type?} - {?research_level?} - - - - diff --git a/application/ship-simu/templates/game/technology/transistor.xml b/application/ship-simu/templates/game/technology/transistor.xml deleted file mode 100644 index f41d448..0000000 --- a/application/ship-simu/templates/game/technology/transistor.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - transistor - eletronics - - - - - - - - semiconductor - electronics - 1 - - - plastics - chemicals - 5 - - - - - - - - silicium_mining - {?research_type?} - 1 - - - - diff --git a/application/ship-simu/templates/game/technology/video_receiving.xml b/application/ship-simu/templates/game/technology/video_receiving.xml deleted file mode 100644 index 353d40a..0000000 --- a/application/ship-simu/templates/game/technology/video_receiving.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - video_receiving - eletronics - - - - - - - - signal_amplifying - electronics - 1 - - - signal_modulation - electronics - 1 - - - transistor - electronics - 1 - - - - diff --git a/application/ship-simu/templates/game/types/.htaccess b/application/ship-simu/templates/game/types/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/types/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/types/building_types.xml b/application/ship-simu/templates/game/types/building_types.xml deleted file mode 100644 index 58da39a..0000000 --- a/application/ship-simu/templates/game/types/building_types.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/application/ship-simu/templates/game/types/container_types.xml b/application/ship-simu/templates/game/types/container_types.xml deleted file mode 100644 index 46a0c35..0000000 --- a/application/ship-simu/templates/game/types/container_types.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - diff --git a/application/ship-simu/templates/game/types/content_types.xml b/application/ship-simu/templates/game/types/content_types.xml deleted file mode 100644 index f2853a6..0000000 --- a/application/ship-simu/templates/game/types/content_types.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/types/contract_types.xml b/application/ship-simu/templates/game/types/contract_types.xml deleted file mode 100644 index 1e1ce09..0000000 --- a/application/ship-simu/templates/game/types/contract_types.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/types/electronic_types.xml b/application/ship-simu/templates/game/types/electronic_types.xml deleted file mode 100644 index a5248dd..0000000 --- a/application/ship-simu/templates/game/types/electronic_types.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - diff --git a/application/ship-simu/templates/game/types/engine_types.xml b/application/ship-simu/templates/game/types/engine_types.xml deleted file mode 100644 index ea42838..0000000 --- a/application/ship-simu/templates/game/types/engine_types.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/application/ship-simu/templates/game/types/farmer_types.xml b/application/ship-simu/templates/game/types/farmer_types.xml deleted file mode 100644 index a11f5cc..0000000 --- a/application/ship-simu/templates/game/types/farmer_types.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/types/fuel_types.xml b/application/ship-simu/templates/game/types/fuel_types.xml deleted file mode 100644 index 00399a4..0000000 --- a/application/ship-simu/templates/game/types/fuel_types.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/application/ship-simu/templates/game/types/merchant_types.xml b/application/ship-simu/templates/game/types/merchant_types.xml deleted file mode 100644 index 878359f..0000000 --- a/application/ship-simu/templates/game/types/merchant_types.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/types/owner_occupants.xml b/application/ship-simu/templates/game/types/owner_occupants.xml deleted file mode 100644 index e72ceea..0000000 --- a/application/ship-simu/templates/game/types/owner_occupants.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/types/product_types.xml b/application/ship-simu/templates/game/types/product_types.xml deleted file mode 100644 index 8c82ddc..0000000 --- a/application/ship-simu/templates/game/types/product_types.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/types/research_types.xml b/application/ship-simu/templates/game/types/research_types.xml deleted file mode 100644 index 0fc7280..0000000 --- a/application/ship-simu/templates/game/types/research_types.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/application/ship-simu/templates/game/types/ship_types.xml b/application/ship-simu/templates/game/types/ship_types.xml deleted file mode 100644 index 2d47c7b..0000000 --- a/application/ship-simu/templates/game/types/ship_types.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/types/signer_types.xml b/application/ship-simu/templates/game/types/signer_types.xml deleted file mode 100644 index 611853a..0000000 --- a/application/ship-simu/templates/game/types/signer_types.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - diff --git a/application/ship-simu/templates/game/types/tank_types.xml b/application/ship-simu/templates/game/types/tank_types.xml deleted file mode 100644 index 2aa4d22..0000000 --- a/application/ship-simu/templates/game/types/tank_types.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/ship-simu/templates/game/types/technology_types.xml b/application/ship-simu/templates/game/types/technology_types.xml deleted file mode 100644 index b139d89..0000000 --- a/application/ship-simu/templates/game/types/technology_types.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/ship-simu/templates/game/vegetable/.htaccess b/application/ship-simu/templates/game/vegetable/.htaccess deleted file mode 100644 index 3a42882..0000000 --- a/application/ship-simu/templates/game/vegetable/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/ship-simu/templates/game/vegetable/base_vegetable.xml b/application/ship-simu/templates/game/vegetable/base_vegetable.xml deleted file mode 100644 index 80925e5..0000000 --- a/application/ship-simu/templates/game/vegetable/base_vegetable.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - diff --git a/application/shipsimu/.htaccess b/application/shipsimu/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/admin/.htaccess b/application/shipsimu/admin/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/admin/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/class_ApplicationHelper.php b/application/shipsimu/class_ApplicationHelper.php new file mode 100644 index 0000000..7000c38 --- /dev/null +++ b/application/shipsimu/class_ApplicationHelper.php @@ -0,0 +1,227 @@ + + * @version 0.0 + * @copyright Copyright (c) 2007 - 2008 Roland Haeder, 2009 - 2012 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication, Registerable { + /** + * The version number of this application + */ + private $appVersion = ''; + + /** + * The human-readable name for this application + */ + private $appName = ''; + + /** + * The short uni*-like name for this application + */ + private $shortName = ''; + + /** + * An instance of this class + */ + private static $selfInstance = NULL; + + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Getter for an instance of this class + * + * @return $selfInstance An instance of this class + */ + public static final function getSelfInstance () { + // Is the instance there? + if (is_null(self::$selfInstance)) { + self::$selfInstance = new ApplicationHelper(); + } // END - if + + // Return the instance + return self::$selfInstance; + } + + /** + * Getter for the version number + * + * @return $appVersion The application's version number + */ + public final function getAppVersion () { + return $this->appVersion; + } + /** + * Setter for the version number + * + * @param $appVersion The application's version number + * @return void + */ + public final function setAppVersion ($appVersion) { + // Cast and set it + $this->appVersion = (string) $appVersion; + } + + /** + * Getter for human-readable name + * + * @return $appName The application's human-readable name + */ + public final function getAppName () { + return $this->appName; + } + + /** + * Setter for human-readable name + * + * @param $appName The application's human-readable name + * @return void + */ + public final function setAppName ($appName) { + // Cast and set it + $this->appName = (string) $appName;; + } + + /** + * Getter for short uni*-like name + * + * @return $shortName The application's short uni*-like name + */ + public final function getAppShortName () { + return $this->shortName; + } + + /** + * Setter for short uni*-like name + * + * @param $shortName The application's short uni*-like name + * @return void + */ + public final function setAppShortName ($shortName) { + // Cast and set it + $this->shortName = (string) $shortName; + } + + /** + * Launches the application + * + * @return void + */ + public final function entryPoint () { + // Set this application in registry + Registry::getRegistry()->addInstance('app', $this); + + // Default response is console + $response = $this->getResponseTypeFromSystem(); + $responseType = $this->getResponseTypeFromSystem(); + + // Create a new request object + $requestInstance = ObjectFactory::createObjectByName($this->convertToClassName($response) . 'Request'); + + // Remember request instance here + $this->setRequestInstance($requestInstance); + + // Do we have another response? + if ($requestInstance->isRequestElementSet('request')) { + // Then use it + $response = strtolower($requestInstance->getRequestElement('request')); + $responseType = $response; + } // END - if + + // ... and a new response object + $responseClass = sprintf("%sResponse", $this->convertToClassName($response)); + $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this)); + + // Remember response instance here + $this->setResponseInstance($responseInstance); + + // Get the parameter from the request + $commandName = $requestInstance->getRequestElement('command'); + + // If it is null then get default command + if (is_null($commandName)) { + // Get default command + $commandName = $responseInstance->getDefaultCommand(); + + // Set it in request + $requestInstance->setRequestElement('command', $commandName); + } // END - if + + // Get a controller resolver + $resolverClass = $this->convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver'); + $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this)); + + // Get a controller instance as well + $this->setControllerInstance($resolverInstance->resolveController()); + + // Launch the main routine here + $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance); + } + + /** + * Handle the indexed array of fatal messages and puts them out in an + * acceptable fasion + * + * @param $messageList An array of fatal messages + * @return void + */ + public function handleFatalMessages (array $messageList) { + // Walk through all messages + foreach ($messageList as $message) { + exit(__METHOD__ . ':MSG:' . $message); + } // END - foreach + } + + /** + * Builds the master template's name + * + * @return $masterTemplateName Name of the master template + */ + public function buildMasterTemplateName () { + return 'node_main'; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/config.php b/application/shipsimu/config.php new file mode 100644 index 0000000..b37151f --- /dev/null +++ b/application/shipsimu/config.php @@ -0,0 +1,539 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get a configuration instance for shorter lines +$cfg = FrameworkConfiguration::getSelfInstance(); + +// CFG: HEADER-CHARSET +$cfg->setConfigEntry('header_charset', 'utf-8'); + +// CFG: DEFAULT-WEB-COMMAND +$cfg->setConfigEntry('default_web_command', 'home'); + +// CFG: DEFAULT-IMAGE-COMMAND +$cfg->setConfigEntry('default_image_command', 'build'); + +// CFG: FORM-ACTION +$cfg->setConfigEntry('form_action', 'index.php?app={?app_short_name?}&page=do_form'); + +// CFG: FORM-METHOD +$cfg->setConfigEntry('form_method', 'post'); + +// CFG: FORM-TARGET +$cfg->setConfigEntry('form_target', '_self'); + +// CFG: REGISTER-REQUIRES-EMAIL +$cfg->setConfigEntry('register_requires_email', 'Y'); + +// CFG: REGISTER-INCLUDES-PROFILE +$cfg->setConfigEntry('register_includes_profile', 'Y'); + +// CFG: REGISTER-PERSONAL-DATA +$cfg->setConfigEntry('register_personal_data', 'Y'); + +// CFG: REGISTER-EMAIL-UNIQUE +$cfg->setConfigEntry('register_email_unique', 'Y'); + +// CFG: PROFILE-INCLUDES-BIRTHDAY +$cfg->setConfigEntry('profile_includes_birthday', 'Y'); + +// CFG: CHAT-ENABLED-ICQ +$cfg->setConfigEntry('chat_enabled_icq', 'Y'); + +// CFG: CHAT-ENABLED-JABBER +$cfg->setConfigEntry('chat_enabled_jabber', 'Y'); + +// CFG: CHAT-ENABLED-YAHOO +$cfg->setConfigEntry('chat_enabled_yahoo', 'Y'); + +// CFG: CHAT-ENABLED-AOL +$cfg->setConfigEntry('chat_enabled_aol', 'Y'); + +// CFG: CHAT-ENABLED-MSN +$cfg->setConfigEntry('chat_enabled_msn', 'Y'); + +// CFG: USER-REGISTRATION +$cfg->setConfigEntry('user_registration_class', 'ShipSimuRegistration'); + +// CFG: USER-LOGIN-CLASS +$cfg->setConfigEntry('user_login_class', 'ShipSimuUserLogin'); + +// CFG: GUEST-LOGIN-CLASS +$cfg->setConfigEntry('guest_login_class', 'ShipSimuGuestLogin'); + +// CFG: USER-STATUS-REGISTER +$cfg->setConfigEntry('user_status_unconfirmed', 'UNCONFIRMED'); + +// CFG: USER-STATUS-GUEST +$cfg->setConfigEntry('user_status_guest', 'GUEST'); + +// CFG: USER-STATUS-CONFIRMED +$cfg->setConfigEntry('user_status_confirmed', 'CONFIRMED'); + +// CFG: USER-STATUS-LOCKED +$cfg->setConfigEntry('user_status_locked', 'LOCKED'); + +// CFG: LOGIN-HELPER-CLASS +$cfg->setConfigEntry('login_helper_class', 'ShipSimuLoginHelper'); + +// CFG: AUTH-METHOD-CLASS +$cfg->setConfigEntry('auth_method_class', 'CookieAuth'); + +// CFG: APP-LOGIN-URL +$cfg->setConfigEntry('app_login_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: LOGIN-FAILED-URL +$cfg->setConfigEntry('login_failed_url', 'index.php?app={?app_short_name?}&page=login_failed'); + +// CFG: LOGIN-FAILED-LOGIN-RETRY-ACTION-URL +$cfg->setConfigEntry('login_failed_login_retry_action_url', 'index.php?app={?app_short_name?}&page=login&note=login_failed'); + +// CFG: LOGOUT-DONE-URL +$cfg->setConfigEntry('logout_done_url', 'index.php?app={?app_short_name?}&page=logout_done'); + +// CFG: ACTION-STATUS-PROBLEM +$cfg->setConfigEntry('action_status_problem', 'status_problem'); + +// CFG: LOGIN-USER-STATUS-URL +$cfg->setConfigEntry('login_user_status_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=status_problem&status=general'); + +// CFG: LOGIN-USER-STATUS-GUEST-URL +$cfg->setConfigEntry('login_user_status_guest_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=status_problem&status=guest'); + +// CFG: USER-NOT-UNCONFIRMED-URL +$cfg->setConfigEntry('user_not_unconfirmed_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=unconfirmed_problem'); + +// CFG: USER-UNCONFIRMED-EMAIL-MISSING-URL +$cfg->setConfigEntry('user_unconfirmed_email_missing_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=unconfirmed_email_missing'); + +// CFG: CONFIRM-CODE-INVALID-URL +$cfg->setConfigEntry('confirm_code_invalid_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=confirm_code_invalid'); + +// CFG: USER-NOT-FOUND-URL +$cfg->setConfigEntry('user_not_found_url', 'index.php?app={?app_short_name?}&page=login_area&action=status_problem&status=user_not_found'); + +// CFG: LOGIN-GOVERNMENT-STARTUP-FAILED-URL +$cfg->setConfigEntry('login_government_startup_failed_url', 'index.php?app={?app_short_name?}&page=government_failed&failed=startup'); + +// CFG: LOGIN-GOVERNMENT-TRAINING-FAILED-URL +$cfg->setConfigEntry('login_government_training_failed_url', 'index.php?app={?app_short_name?}&page=government_failed&failed=training'); + +// CFG: REFILL-PAGE-CURRENCY-DONE-URL +$cfg->setConfigEntry('refill_page_done_url', 'index.php?app={?app_short_name?}&page=login_area&status=refill_done&done={?refill_done?}&amount={?amount?}'); + +// CFG: LOGIN-DEFAULT-ACTION +$cfg->setConfigEntry('login_default_action', 'welcome'); + +// CFG: LOGIN-AREA-LOGOUT-ACTION-URL +$cfg->setConfigEntry('login_area_logout_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: GOVERNMENT-FAILED-LOGOUT-ACTION-URL +$cfg->setConfigEntry('government_failed_logout_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: LOGIN-AREA-PROFILE-ACTION-URL +$cfg->setConfigEntry('login_area_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&status=profile'); + +// CFG: GOVERNMENT-FAILED-PROFILE-ACTION-URL +$cfg->setConfigEntry('government_failed_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&status=profile'); + +// CFG: LOGIN-AREA-COMPANY-ACTION-URL +$cfg->setConfigEntry('login_area_company_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: GOVERNMENT-FAILED-COMPANY-ACTION-URL +$cfg->setConfigEntry('government_failed_company_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: LOGIN-AREA-LIST-COMPANIES-ACTION-URL +$cfg->setConfigEntry('login_area_list_companies_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: LOGIN-AREA-LOGOUT-NOW-ACTION-URL +$cfg->setConfigEntry('login_area_logout_now_action_url', 'index.php?app={?app_short_name?}&page=logout'); + +// CFG: LOGIN-AREA-RETURN-LOGIN-ACTION-URL +$cfg->setConfigEntry('login_area_return_login_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: LOGIN-AREA-SHIPSIMU-PROFILE-ACTION-URL +$cfg->setConfigEntry('login_area_shipsimu_profile_action_url', 'index.php?app={?app_short_name?}&page=login_area&action=profile'); + +// CFG: LOGOUT_DONE-RELOGIN-ACTION-URL +$cfg->setConfigEntry('logout_done_relogin_action_url', 'index.php?app={?app_short_name?}&page=login'); + +// CFG: LOGIN-REGISTER-ACTION-URL +$cfg->setConfigEntry('login_register_action_url', 'index.php?app={?app_short_name?}&page=register'); + +// CFG: CONFIRM-DIRECT-LOGIN-ACTION-URL +$cfg->setConfigEntry('confirm_direct_login_action_url', 'index.php?app={?app_short_name?}&page=login_area'); + +// CFG: WEB-CMD-USER-IS-NULL-URL +$cfg->setConfigEntry('web_cmd_user_is_null_url', 'index.php?app={?app_short_name?}&page=problem&problem=user_null'); + +// CFG: NEWS-READER-HOME-CLASS +$cfg->setConfigEntry('news_reader_home_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-CLASS +$cfg->setConfigEntry('news_reader_login_area_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-LOGOUT-CLASS +$cfg->setConfigEntry('news_reader_login_area_logout_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-COMPANY-CLASS +$cfg->setConfigEntry('news_reader_login_area_company_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-REFILL-CLASS +$cfg->setConfigEntry('news_reader_login_area_refill_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-PROFILE-CLASS +$cfg->setConfigEntry('news_reader_login_area_profile_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-GOVERNMENT-TRAINING-CLASS +$cfg->setConfigEntry('news_reader_login_area_government_training_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-GOVERNMENT-STARTUP-HELP-CLASS +$cfg->setConfigEntry('news_reader_login_area_government_startup_help_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-LOGIN-AREA-STATUS-PROBLEM-CLASS +$cfg->setConfigEntry('news_reader_login_area_status_problem_class', 'DefaultNewsReader'); + +// CFG: NEWS-READER-GOVERNMENT-FAILED-CLASS +$cfg->setConfigEntry('news_reader_government_failed_class', 'DefaultNewsReader'); + +// CFG: NEWS-DOWNLOAD-FILTER +$cfg->setConfigEntry('news_download_filter', 'NewsDownloadFilter'); + +// CFG: NEWS-PROCESS-FILTER +$cfg->setConfigEntry('news_process_filter', 'NewsProcessFilter'); + +// CFG: USER-AUTH-FILTER +$cfg->setConfigEntry('user_auth_filter', 'UserAuthFilter'); + +// CFG: USER-UPDATE-FILTER +$cfg->setConfigEntry('user_update_filter', 'UserUpdateFilter'); + +// CFG: USER-STATUS-CONFIRMED-FILTER +$cfg->setConfigEntry('user_status_confirmed_filter', 'UserStatusConfimedUpdateFilter'); + +// CFG: CAPTCHA-ENCRYPT-VALIDATOR-FILTER +$cfg->setConfigEntry('captcha_encrypt_validator_filter', 'CaptchaEncryptFilter'); + +// CFG: REFILL-REQUEST-VALIDATOR-FILTER +$cfg->setConfigEntry('refill_request_validator_filter', 'RefillRequestValidatorFilter'); + +// CFG: CAPTCHA-GUEST-VERIFIER-FILTER +$cfg->setConfigEntry('captcha_guest_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CAPTCHA-USER-VERIFIER-FILTER +$cfg->setConfigEntry('captcha_user_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CAPTCHA-REGISTER-VERIFIER-FILTER +$cfg->setConfigEntry('captcha_register_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CAPTCHA-REFILL-VERFIER-FILTER +$cfg->setConfigEntry('captcha_refill_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CAPTCHA-GOVERNMENT-VERFIER-FILTER +$cfg->setConfigEntry('captcha_government_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CAPTCHA-PROFILE-VERFIER-FILTER +$cfg->setConfigEntry('captcha_profile_verifier_filter', 'GraphicalCodeCaptchaVerifierFilter'); + +// CFG: CONFIRM-CODE-VERIFIER-FILTER +$cfg->setConfigEntry('confirm_code_verifier_filter', 'ConfirmCodeVerifierFilter'); + +// CFG: BIRTHDAY-REGISTER-VERIFIER-FILTER +$cfg->setConfigEntry('birthday_register_verifier_filter', 'BirthdayVerifierFilter'); + +// CFG: BIRTHDAY-PROFILE-VERIFIER-FILTER +$cfg->setConfigEntry('birthday_profile_verifier_filter', 'BirthdayVerifierFilter'); + +// CFG: REFILL-PAGE-FILTER +$cfg->setConfigEntry('refill_page_filter', 'RefillPageFilter'); + +// CFG: REFILL-REQUEST-CURRENCY-BOOK-FILTER +$cfg->setConfigEntry('refill_request_currency_test_book_filter', 'RefillRequestCurrencyTestBookFilter'); + +// CFG: PAYMENT-DISCOVERY-FILTER +$cfg->setConfigEntry('payment_discovery_filter', 'PaymentDiscoveryFilter'); + +// CFG: GOVERNMENT-PAYS-TRAINING-FILTER +$cfg->setConfigEntry('government_pays_training_filter', 'ShipSimuGovernmentPaysTrainingFilter'); + +// CFG: GOVERNMENT-PAYS-STARTUP-HELP-FILTER +$cfg->setConfigEntry('government_pays_startup_help_filter', 'ShipSimuGovernmentPaysStartupHelpFilter'); + +// CFG: USER-STATUS-GUEST-FILTER +$cfg->setConfigEntry('user_status_guest_filter', 'ShipSimuUserStatusGuestFilter'); + +// CFG: NEWS-HOME-LIMIT +$cfg->setConfigEntry('news_home_limit', 10); + +// CFG: NEWS-LOGIN-AREA-LIMIT +$cfg->setConfigEntry('news_login_area_limit', 15); + +// CFG: NEWS-GOVERNMENT-FAILED-LIMIT +$cfg->setConfigEntry('news_government_failed_limit', 15); + +// CFG: LOGIN-ENABLED +$cfg->setConfigEntry('login_enabled', 'Y'); + +// CFG: CONFIRM-EMAIL-ENABLED +$cfg->setConfigEntry('confirm_email_enabled', 'Y'); + +// CFG: LOGIN-DISABLED-REASON +$cfg->setConfigEntry('login_disabled_reason', 'Loginbereich befindet sich noch im Aufbau.'); + +// CFG: LOGIN-TYPE +$cfg->setConfigEntry('login_type', 'username'); // username, email, both + +// CFG: EMAIL-CHANGE-ALLOWED +$cfg->setConfigEntry('email_change_allowed', 'Y'); + +// CFG: EMAIL-CHANGE-CONFIRMATION +$cfg->setConfigEntry('email_change_confirmation', 'Y'); + +// CFG: GUEST-LOGIN-ALLOWED +$cfg->setConfigEntry('guest_login_allowed', 'Y'); + +// CFG: GUEST-LOGIN-USERNAME +$cfg->setConfigEntry('guest_login_user', 'guest'); + +// CFG: GUEST-LOGIN-PASS +$cfg->setConfigEntry('guest_login_passwd', 'guest'); + +// CFG: LOGIN-WELCOME-ACTION-CLASS +$cfg->setConfigEntry('login_welcome_action_class', 'ShipSimuLoginAction'); + +// CFG: LOGIN-LOGOUT-ACTION-CLASS +$cfg->setConfigEntry('login_logout_action_class', 'ShipSimuLogoutAction'); + +// CFG: LOGIN-PROFILE-ACTION-CLASS +$cfg->setConfigEntry('login_profile_action_class', 'ShipSimuProfileAction'); + +// CFG: SHIPSIMU-REGISTER-CAPTCHA +$cfg->setConfigEntry('shipsimu_register_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-USER-LOGIN-CAPTCHA +$cfg->setConfigEntry('shipsimu_user_login_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA +$cfg->setConfigEntry('shipsimu_guest_login_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-PROFILE-CAPTCHA +$cfg->setConfigEntry('shipsimu_profile_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-REFILL-CAPTCHA +$cfg->setConfigEntry('shipsimu_refill_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-GOVERNMENT-STARTUP-CAPTCHA +$cfg->setConfigEntry('shipsimu_government_startup_captcha', 'GraphicalCodeCaptcha'); + +// CFG: SHIPSIMU-GOVERNMENT-TRAINING-CAPTCHA +$cfg->setConfigEntry('shipsimu_government_training_captcha', 'GraphicalCodeCaptcha'); + +// CFG: CAPTCHA-STRING-LENGTH +$cfg->setConfigEntry('captcha_string_length', 5); + +// CFG: CAPTCHA-SEARCH-CHARS +$cfg->setConfigEntry('captcha_search_chars', '+/='); + +// CFG: RANDOM-STRING-LENGTH +$cfg->setConfigEntry('random_string_length', 100); + +// CFG: SHIPSIMU-REGISTER-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_register_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-USER-LOGIN-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_user_login_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_guest_login_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-PROFILE-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_profile_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-REFILL-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_refill_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-GOVERNMENT-STARTUP-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_government_startup_captcha_secured', 'Y'); + +// CFG: SHIPSIMU-GOVERNMENT-TRAINING-CAPTCHA-SECURED +$cfg->setConfigEntry('shipsimu_government_training_captcha_secured', 'Y'); + +// CFG: BLOCK-SHOWS-REGISTRATION +$cfg->setConfigEntry('block_shows_registration', 'Y'); + +// CFG: COMPANY-CLASS +$cfg->setConfigEntry('company_class', 'ShippingCompany'); + +// CFG: COMPANY-DB-WRAPPER-CLASS +$cfg->setConfigEntry('company_db_wrapper_class', 'CompanyDatabaseWrapper'); + +// CFG: USER-POINTS-DB-WRAPPER-CLASS +$cfg->setConfigEntry('user_points_db_wrapper_class', 'UserPointsDatabaseWrapper'); + +// CFG: USER-GOVERNMENT-WRAPPER-CLASS +$cfg->setConfigEntry('user_gov_wrapper_class', 'UserGovernmentDatabaseWrapper'); + +// CFG: PAYMENT-DB-WRAPPER-CLASS +$cfg->setConfigEntry('payment_db_wrapper_class', 'PaymentsDatabaseWrapper'); + +// CFG EMAIl-TPL-RESEND-LINK +$cfg->setConfigEntry('email_tpl_resend_link', 'text'); + +// CFG: MAIL-TEMPLATE-CLASS +$cfg->setConfigEntry('mail_template_class', 'MailTemplateEngine'); + +// CFG: IMAGE-TEMPLATE-CLASS +$cfg->setConfigEntry('image_template_class', 'ImageTemplateEngine'); + +// CFG: MENU-TEMPLATE-CLASS +$cfg->setConfigEntry('menu_template_class', 'MenuTemplateEngine'); + +// CFG: MENU-TEMPLATE-EXTENSION +$cfg->setConfigEntry('menu_template_extension', '.xml'); + +// CFG: ADMIN-EMAIL +$cfg->setConfigEntry('admin_email', 'you@some-hoster.invalid'); + +// CFG: USER-CLASS +$cfg->setConfigEntry('user_class', 'ShipSimuMember'); + +// CFG: GUEST-CLASS +$cfg->setConfigEntry('guest_class', 'ShipSimuGuest'); + +// CFG: MAX-ALLOWED-COMPANIES-FOUND +$cfg->setConfigEntry('max_allowed_companies_found', 10); + +// CFG: FOUND-NEW-COMPANY-ACTION-POINTS +$cfg->setConfigEntry('found_new_company_action_points', 1000000); + +// CFG: WRITE-APPLICATION-ACTION-POINTS +$cfg->setConfigEntry('write_applications_action_points', 10000); + +// CFG: USER-POINTS-CLASS +$cfg->setConfigEntry('user_points_class', 'UserPoints'); + +// CFG: GOVERNMENT-CLASS +$cfg->setConfigEntry('government_class', 'SimplifiedGovernment'); + +// CFG: BANK-CLASS +$cfg->setConfigEntry('bank_class', 'MoneyBank'); + +// CFG: REFILL-PAGE-ACTIVE +$cfg->setConfigEntry('refill_page_active', 'Y'); + +// CFG: REFILL-PAGE-MIN-CURRENCY-AMOUNT +$cfg->setConfigEntry('refill_page_min_currency_amount', 1000); + +// CFG: SHIP-SIMU-LOGIN-FILL-PAYMENT-DISCOVERY +$cfg->setConfigEntry('ship_simu_login_refill_payment_discovery', 'LocalPaymentDiscovery'); + +// CFG: GOVERNMENT-STARTUP-HELP-LIMIT +$cfg->setConfigEntry('government_startup_help_limit', 3); + +// CFG: GOVERNMENT-TRAINING-LIMIT +$cfg->setConfigEntry('government_training_limit', 2); + +// CFG: WEB-BLOCK-HELPER +$cfg->setConfigEntry('web_block_helper', 'WebBlockHelper'); + +// CFG: WEB-FORM-HELPER +$cfg->setConfigEntry('web_form_helper', 'WebFormHelper'); + +// CFG: WEB-LINK-HELPER +$cfg->setConfigEntry('web_link_helper', 'WebLinkHelper'); + +// CFG: WEB-CMD-GOVERNMENT-FAILED-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_government_failed_resolver_class', 'WebGovernmentFailedCommandResolver'); + +// CFG: WEB-CMD-LOGIN-FAILED-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_login_failed_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-COMPANY-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_company_resolver_class', 'WebCompanyCommandResolver'); + +// CFG: WEB-CMD-HOME-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_home_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-REGISTER-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_register_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-DO-FORM-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_do_form_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-LOGIN-AREA-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_login_area_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-CONFIRM-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_confirm_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-PROBLEM-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_problem_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-LOGOUT-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_logout_resolver_class', 'WebCommandResolver'); + +// CFG: WEB-CMD-LOGOUT-DONE-RESOLVER-CLASS +$cfg->setConfigEntry('web_cmd_logout_done_resolver_class', 'WebCommandResolver'); + +// CFG: REFILL-REQUEST-CURRENCY-PAYMENT-TYPE +$cfg->setConfigEntry('refill_request_currency_payment_type', 'test'); + +// CFG: LOGIN-REGISTER-LOGIN-FORM +$cfg->setConfigEntry('login_register_login_form', 'index.php?app={?app_short_name?}&page=register'); + +// CFG: HOME-MENU-CLASS +$cfg->setConfigEntry('home_menu_class', 'ShipSimuHomeMenu'); + +// CFG: LOGIN-FAILED-MENU-CLASS +$cfg->setConfigEntry('login_failed_menu_class', 'ShipSimuLoginFailedMenu'); + +// CFG: STATUS-MENU-CLASS +$cfg->setConfigEntry('status_menu_class', 'ShipSimuStatusMenu'); + +// CFG: LOGIN-MENU-CLASS +$cfg->setConfigEntry('login_menu_class', 'ShipSimuLoginMenu'); + +// CFG: LOGOUT-MENU-CLASS +$cfg->setConfigEntry('logout_menu_class', 'ShipSimuLogoutMenu'); + +// CFG: REGISTER-MENU-CLASS +$cfg->setConfigEntry('register_menu_class', 'ShipSimuRegisterMenu'); + +// CFG: CONFIRM-MENU-CLASS +$cfg->setConfigEntry('confirm_menu_class', 'ShipSimuConfirmMenu'); + +// CFG: LOGIN-AREA-MENU-CLASS +$cfg->setConfigEntry('login_area_menu_class', 'ShipSimuLoginAreaMenu'); + +// CFG: GOVERNMENT-FAILED-AREA-MENU-CLASS +$cfg->setConfigEntry('government_failed_area_menu_class', 'ShipSimuGovernmentFailedAreaMenu'); + +// CFG: MONEYBANK-ACTIVATED +$cfg->setConfigEntry('moneybank_activated', 'Y'); + +// CFG: MONEYBANK-OPENING-CLASS +$cfg->setConfigEntry('moneybank_opening_class', 'MoneyBankRealtimeOpening'); + +// [EOF] +?> diff --git a/application/shipsimu/data.php b/application/shipsimu/data.php new file mode 100644 index 0000000..efbb161 --- /dev/null +++ b/application/shipsimu/data.php @@ -0,0 +1,51 @@ +isClass("ApplicationSelector"))) { return; } + * + * isset() is required to prevent a warning and is_object() is highly required + * when the application itself is requested in URL (hint: index.php?app=your_app) + * + * @author Roland Haeder + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get config instance +$cfg = FrameworkConfiguration::getSelfInstance(); + +// Get an instance of the helper +$app = call_user_func_array( + array($cfg->getConfigEntry('app_helper_class'), 'getSelfInstance'), + array() +); + +// Set application name and version +$app->setAppName('Ship-Simu Shipping Simulator'); +$app->setAppVersion('0.0.0'); +$app->setAppShortName('shipsimu'); + +// [EOF] +?> diff --git a/application/shipsimu/debug.php b/application/shipsimu/debug.php new file mode 100644 index 0000000..11bf631 --- /dev/null +++ b/application/shipsimu/debug.php @@ -0,0 +1,61 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Reederei-Objekt debuggen +//define('DEBUG_COMPANY_OBJ', true); +// Hafen-Objekt debuggen +//define('DEBUG_HARBOR_OBJ', true); +// Schiff-Objekt debuggen +//define('DEBUG_SHIP_OBJ', true); +// Auftrag-Objekt debuggen +//define('DEBUG_CONTRACT_OBJ', true); +// Haendler-Objekt debuggen +//define('DEBUG_MERCHANT_OBJ', true); +// Personal-Objekt debuggen +//define('DEBUG_PERSONELL_OBJ', true); +// Personal debuggen +//define('DEBUG_PERSONELL', true); +// Reederei debuggen +//define('DEBUG_COMPANY', true); +// Mitarbeiter debuggen +//define('DEBUG_COMPANY_EMPLOYEE', true); +// Hafen debuggen +//define('DEBUG_HARBOR', true); +// Werft debuggen +//define('DEBUG_SHIPYARD', true); +// Schiff debuggen +//define('DEBUG_SHIP', true); +// Schiffstruktur debuggen +//define('DEBUG_STRUCTURE', true); +// Kabinen debuggen +//define('DEBUG_CABIN', true); +// Decks debuggen +//define('DEBUG_DECK', true); +// Bauauftraege debuggen +//define('DEBUG_CONTRACT', true); +// Haendler debuggen +//define('DEBUG_MERCHANT', true); + +// [EOF] +?> diff --git a/application/shipsimu/exceptions.php b/application/shipsimu/exceptions.php new file mode 100644 index 0000000..d9cc8d9 --- /dev/null +++ b/application/shipsimu/exceptions.php @@ -0,0 +1,85 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Our own exception handler +function __exceptionHandler (FrameworkException $e) { + // Call the app_die() method + ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s (%s) has terminated due to an uncaught exception: %s [%s]: %s Backtrace:
%s
", + ApplicationHelper::getSelfInstance()->getAppName(), + ApplicationHelper::getSelfInstance()->getAppShortName(), + $e->__toString(), + $e->getHexCode(), + $e->getMessage(), + $e->getPrintableBackTrace() + ), + $e->getHexCode(), + $e->getExtraData() + ); +} // END - function + +// Set the new handler +set_exception_handler('__exceptionHandler'); + +// Error handler +function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) { + // Construct the message + $message = sprintf("File: %s, Line: %s, Code: %s, Message: %s", + basename($errfile), + $errline, + $errno, + $errstr + ); + + // Throw an exception here + throw new FatalErrorException($message, BaseFrameworkSystem::EXCEPTION_FATAL_ERROR); +} // END - function + +// Set error handler +set_error_handler('__errorHandler'); + +// Assertion handler +function __assertHandler ($file, $line, $code) { + // Empty code? + if ($code === "") $code = "Unknown"; + + // Create message + $message = sprintf("File: %s, Line: %s, Code: %s", + basename($file), + $line, + $code + ); + + // Throw an exception here + throw new AssertionException($message, BaseFrameworkSystem::EXCEPTION_ASSERTION_FAILED); +} // END - function + +// Init assert handling +assert_options(ASSERT_ACTIVE, 1); +assert_options(ASSERT_WARNING, 0); +assert_options(ASSERT_BAIL, 0); +assert_options(ASSERT_QUIET_EVAL, 0); +assert_options(ASSERT_CALLBACK, '__assertHandler'); + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/.htaccess b/application/shipsimu/exceptions/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/exceptions/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/exceptions/class_BirthdayInvalidException.php b/application/shipsimu/exceptions/class_BirthdayInvalidException.php new file mode 100644 index 0000000..ed8e189 --- /dev/null +++ b/application/shipsimu/exceptions/class_BirthdayInvalidException.php @@ -0,0 +1,42 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BirthdayInvalidException extends FrameworkException { + public function __construct (array $birthArray, $code) { + // Add a message around the missing class + $message = sprintf("Das Geburtsdatum %s ist leider falsch.", + date("d.m.Y", mktime( + 0, 0, 0, + $birthArray[1], + $birthArray[2], + $birthArray[0] + )) + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_CabinShipMismatchException.php b/application/shipsimu/exceptions/class_CabinShipMismatchException.php new file mode 100644 index 0000000..6b9120b --- /dev/null +++ b/application/shipsimu/exceptions/class_CabinShipMismatchException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class CabinShipMismatchException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ContractAllreadySignedException.php b/application/shipsimu/exceptions/class_ContractAllreadySignedException.php new file mode 100644 index 0000000..fc17f64 --- /dev/null +++ b/application/shipsimu/exceptions/class_ContractAllreadySignedException.php @@ -0,0 +1,39 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ContractAllreadySignedException extends FrameworkException { + public function __construct (array $classArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Die Vertragsparteien %s und %s haben den Vertrag bereits unterzeichnet!", + $classArray[0]->__toString(), + $classArray[1]->getCompanyName(), + $classArray[2]->getCompanyName() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ContractPartnerMismatchException.php b/application/shipsimu/exceptions/class_ContractPartnerMismatchException.php new file mode 100644 index 0000000..fce9748 --- /dev/null +++ b/application/shipsimu/exceptions/class_ContractPartnerMismatchException.php @@ -0,0 +1,39 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ContractPartnerMismatchException extends FrameworkException { + public function __construct (array $classArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Der Vertragspartner von %s ist ungütig (%s) und darf diesen Vertrag nicht unterzeichnen!", + $classArray[0]->__toString(), + $classArray[1]->getCompanyName(), + $classArray[2]->getCompanyName() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_DeckShipMismatchException.php b/application/shipsimu/exceptions/class_DeckShipMismatchException.php new file mode 100644 index 0000000..937cd6e --- /dev/null +++ b/application/shipsimu/exceptions/class_DeckShipMismatchException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class DeckShipMismatchException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_EmptyStructuresListException.php b/application/shipsimu/exceptions/class_EmptyStructuresListException.php new file mode 100644 index 0000000..9c1eee2 --- /dev/null +++ b/application/shipsimu/exceptions/class_EmptyStructuresListException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class EmptyStructuresListException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Die Strukturen-Liste ist leer.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_InvalidContractPartnerException.php b/application/shipsimu/exceptions/class_InvalidContractPartnerException.php new file mode 100644 index 0000000..8f4823e --- /dev/null +++ b/application/shipsimu/exceptions/class_InvalidContractPartnerException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class InvalidContractPartnerException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Kein gütiger Vertragspartner.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_InvalidIDFormatException.php b/application/shipsimu/exceptions/class_InvalidIDFormatException.php new file mode 100644 index 0000000..78e2e00 --- /dev/null +++ b/application/shipsimu/exceptions/class_InvalidIDFormatException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class InvalidIDFormatException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Ungültige ID-Nummer übergeben.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ItemNotInPriceListException.php b/application/shipsimu/exceptions/class_ItemNotInPriceListException.php new file mode 100644 index 0000000..0013e92 --- /dev/null +++ b/application/shipsimu/exceptions/class_ItemNotInPriceListException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ItemNotInPriceListException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[Merchant:] Preis für den Artikel %s nicht gefunden.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ItemNotTradeableException.php b/application/shipsimu/exceptions/class_ItemNotTradeableException.php new file mode 100644 index 0000000..074f17e --- /dev/null +++ b/application/shipsimu/exceptions/class_ItemNotTradeableException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ItemNotTradeableException extends FrameworkException { + public function __construct (array $classArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Object not tradeable.", + $classArray[0]->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_MissingSimulatorIdException.php b/application/shipsimu/exceptions/class_MissingSimulatorIdException.php new file mode 100644 index 0000000..09a55f3 --- /dev/null +++ b/application/shipsimu/exceptions/class_MissingSimulatorIdException.php @@ -0,0 +1,38 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MissingSimulatorIdException extends FrameworkException { + public function __construct (array $classArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Die Simulator-ID %s scheint ungültig zu sein.", + $classArray[0]->__toString(), + $classArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_MotorShipMismatchException.php b/application/shipsimu/exceptions/class_MotorShipMismatchException.php new file mode 100644 index 0000000..7e688c2 --- /dev/null +++ b/application/shipsimu/exceptions/class_MotorShipMismatchException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MotorShipMismatchException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_NoShippingCompanyOwnedException.php b/application/shipsimu/exceptions/class_NoShippingCompanyOwnedException.php new file mode 100644 index 0000000..848362e --- /dev/null +++ b/application/shipsimu/exceptions/class_NoShippingCompanyOwnedException.php @@ -0,0 +1,46 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class NoShippingCompanyOwnedException extends FrameworkException { + /** + * Constructor of this exception + * + * @param $msgArray Message array with exception data + * @param $code Exception code + * @return void + */ + public function __construct (array $msgArray, $code) { + // Add a message around the missing class + $message = sprintf("[%s:%d] Current user (class %s) does not own any shipping companies.", + $msgArray[0]->__toString(), + $this->getLine(), + $msgArray[1]->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php b/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php new file mode 100644 index 0000000..52cf913 --- /dev/null +++ b/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php @@ -0,0 +1,41 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class NoShipyardsConstructedException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // No class given + $message = sprintf("Please provide a class for %s", __CLASS__); + if (is_object($class)) { + // Add a message around the missing class + $message = sprintf("[%s:] Keine Werften gefunden!", + $class->__toString() + ); + } // END - if + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_PersonellListAlreadyCreatedException.php b/application/shipsimu/exceptions/class_PersonellListAlreadyCreatedException.php new file mode 100644 index 0000000..c89dc44 --- /dev/null +++ b/application/shipsimu/exceptions/class_PersonellListAlreadyCreatedException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class PersonellListAlreadyCreatedException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Die interne Crew-Liste wurde bereits initialisiert.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_RoomShipMismatchException.php b/application/shipsimu/exceptions/class_RoomShipMismatchException.php new file mode 100644 index 0000000..d84528c --- /dev/null +++ b/application/shipsimu/exceptions/class_RoomShipMismatchException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class RoomShipMismatchException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ShipNotConstructedException.php b/application/shipsimu/exceptions/class_ShipNotConstructedException.php new file mode 100644 index 0000000..3313c36 --- /dev/null +++ b/application/shipsimu/exceptions/class_ShipNotConstructedException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipNotConstructedException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ShipPartNotConstructableException.php b/application/shipsimu/exceptions/class_ShipPartNotConstructableException.php new file mode 100644 index 0000000..48b4fe7 --- /dev/null +++ b/application/shipsimu/exceptions/class_ShipPartNotConstructableException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipPartNotConstructableException extends FrameworkException { + public function __construct (array $partArray, $code) { + // Add a message around the missing class + $message = sprintf("Schiffteil %s ist nicht constrierbar!", + $partArray[0] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_StructureShipMismatchException.php b/application/shipsimu/exceptions/class_StructureShipMismatchException.php new file mode 100644 index 0000000..62152e8 --- /dev/null +++ b/application/shipsimu/exceptions/class_StructureShipMismatchException.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class StructureShipMismatchException extends FrameworkException { +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_StructuresOutOfBoundsException.php b/application/shipsimu/exceptions/class_StructuresOutOfBoundsException.php new file mode 100644 index 0000000..916207f --- /dev/null +++ b/application/shipsimu/exceptions/class_StructuresOutOfBoundsException.php @@ -0,0 +1,35 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class StructuresOutOfBoundsException extends FrameworkException { + public function __construct ($idx, $code) { + // Add a message around the missing class + $message = sprintf("Der Index %s liegt ausserhalb des gütigen Bereiches! Schiffsteil nicht auffindbar.", $idx); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_ToMuchEmployeesException.php b/application/shipsimu/exceptions/class_ToMuchEmployeesException.php new file mode 100644 index 0000000..a6bffb0 --- /dev/null +++ b/application/shipsimu/exceptions/class_ToMuchEmployeesException.php @@ -0,0 +1,38 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ToMuchEmployeesException extends FrameworkException { + public function __construct (array $amountArray, $code) { + // Add a message around the missing class + $message = sprintf("%d Leute nicht einstellbar, da nur %d arbeitslos sind!", + $amountArray[0], + $amountArray[1] + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_TotalPriceNotCalculatedException.php b/application/shipsimu/exceptions/class_TotalPriceNotCalculatedException.php new file mode 100644 index 0000000..7aa57ae --- /dev/null +++ b/application/shipsimu/exceptions/class_TotalPriceNotCalculatedException.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class TotalPriceNotCalculatedException extends FrameworkException { + public function __construct (FrameworkInterface $class, $code) { + // Add a message around the missing class + $message = sprintf("[%s:] Gesamtpreis ist nicht ermittelbar.", + $class->__toString() + ); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_UnsupportedLimitationPartException.php b/application/shipsimu/exceptions/class_UnsupportedLimitationPartException.php new file mode 100644 index 0000000..ee7aa5a --- /dev/null +++ b/application/shipsimu/exceptions/class_UnsupportedLimitationPartException.php @@ -0,0 +1,35 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class UnsupportedLimitationPartException extends FrameworkException { + public function __construct ($str, $code) { + // Add a message around the missing class + $message = sprintf("Limitierungsinformation %s wird derzeit nicht unterstützt.", $str); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/exceptions/class_WrongGenderSpecifiedException.php b/application/shipsimu/exceptions/class_WrongGenderSpecifiedException.php new file mode 100644 index 0000000..306a680 --- /dev/null +++ b/application/shipsimu/exceptions/class_WrongGenderSpecifiedException.php @@ -0,0 +1,35 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WrongGenderSpecifiedException extends FrameworkException { + public function __construct ($gender, $code) { + // Add a message around the missing class + $message = sprintf("Das Geschlecht %s Ist nicht M (Männlich) oder F (Weiblich).", $gender); + + // Call parent constructor + parent::__construct($message, $code); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/init.php b/application/shipsimu/init.php new file mode 100644 index 0000000..d27a1f5 --- /dev/null +++ b/application/shipsimu/init.php @@ -0,0 +1,47 @@ +isClass("ApplicationSelector"))) { return; } + * + * isset() is required to prevent a warning and is_object() is highly required + * when the application itself is requested in URL (hint: index.php?app=your_app) + * + * @author Roland Haeder + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get config instance +$cfg = FrameworkConfiguration::getSelfInstance(); + +// Initialize output system +require($cfg->getConfigEntry('base_path') . 'inc/output.php'); + +// This application needs a database connection then we have to simply include +// the inc/database.php script +require($cfg->getConfigEntry('base_path') . 'inc/database.php'); + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/.htaccess b/application/shipsimu/interfaces/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/interfaces/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/interfaces/class_BookableAccount.php b/application/shipsimu/interfaces/class_BookableAccount.php new file mode 100644 index 0000000..3f3a575 --- /dev/null +++ b/application/shipsimu/interfaces/class_BookableAccount.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface BookableAccount extends FrameworkInterface { + /** + * Books the given 'amount' in the request instance on the users "points + * account" + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + function bookAmountDirectly (Requestable $requestInstance); +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_ConstructableShip.php b/application/shipsimu/interfaces/class_ConstructableShip.php new file mode 100644 index 0000000..db76fd5 --- /dev/null +++ b/application/shipsimu/interfaces/class_ConstructableShip.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ConstructableShip extends FrameworkInterface { +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_ConstructableShipPart.php b/application/shipsimu/interfaces/class_ConstructableShipPart.php new file mode 100644 index 0000000..8135bc3 --- /dev/null +++ b/application/shipsimu/interfaces/class_ConstructableShipPart.php @@ -0,0 +1,28 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ConstructableShipPart extends FrameworkInterface { +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_ContractPartner.php b/application/shipsimu/interfaces/class_ContractPartner.php new file mode 100644 index 0000000..35b4b6d --- /dev/null +++ b/application/shipsimu/interfaces/class_ContractPartner.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface ContractPartner extends FrameworkInterface { + /** + * This is a contract partner + * + * @param $contractInstance Must be a valid instance of WorksContract + * @return boolean true = can be a contract partner, + * false = no partner for contracts + */ + function isContractPartner (SignableContract $contractInstance); +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_Customer.php b/application/shipsimu/interfaces/class_Customer.php new file mode 100644 index 0000000..5de5210 --- /dev/null +++ b/application/shipsimu/interfaces/class_Customer.php @@ -0,0 +1,55 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Customer extends FrameworkInterface { + /** + * Adds a contract to the customer's list + * + * @param $contractInstance A valid instance to WorksContract + * @return void + */ + function addNewWorksContract (SignableContract $contractInstance); + + /** + * Signs a works contract. + * + * @param $contractInstance A valid instance to WorksContract + * @param $partnerInstance An instance the other contract partner + * @return void + * @throws InvalidContractPartnerException If the in $contractInstance + * set contract partner is + * not the expected + */ + function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance); + + /** + * Withdraw from a signed contract + * + * @param $contractInstance A valid instance to WorksContract + * @return void + */ + function withdrawFromContract (SignableContract $contractInstance); +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_Personellizer.php b/application/shipsimu/interfaces/class_Personellizer.php new file mode 100644 index 0000000..b56df14 --- /dev/null +++ b/application/shipsimu/interfaces/class_Personellizer.php @@ -0,0 +1,200 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface Personellizer extends FrameworkInterface { + /////////////////////// + /// General methods /// + /////////////////////// + + /** + * Remove min/max age + * + * @return void + */ + function removeMinMaxAge (); + + /** + * Create a valid birthday + * + * @return void + */ + function createBirthday (); + + /** + * Verify if given year/month/day is a valid date combination + * + * @param $year 4-digit year (valid : 2007, 1946, + * invalid: 24, 2a, aa) + * @param $month 1 to 2-digit month (range: 1 to 12) + * @param $day 1 to 2-digit day (range: 1 to 31/30/29/28) + * @return boolean true = date is valid, + * false = date is invalid + */ + function isDateValid ($year, $month, $day); + + ///////////////////////// + //// Status requests //// + ///////////////////////// + + /** + * Is the person employed? + * + * @return boolean true = person is employed + * false = person is umemployed + */ + function isEmployed (); + + /** + * Is the person married? (to which one doesn't matter here) + * + * @return boolean true = person is married + * false = person is not married + */ + function isMarried (); + + /** + * Is the person a male? + * + * @return boolean true = person is male + * false = person is not male (maybe female? ;-)) + */ + function isMale (); + + /** + * Is the person a female? + * + * @return boolean true = person is female + * false = person is not female (maybe male? ;-)) + */ + function isFemale (); + + ///////////////// + //// Getters //// + ///////////////// + + /** + * Getter for surname + * + * @return $surname The person's surname + */ + function getSurname (); + + /** + * Getter for family name + * + * @return $family The person's family name + */ + function getFamily (); + + /** + * Getter for gender + * + * @return $gender The person's gender (F/M) + */ + function getGender (); + + /** + * Getter for salary + * + * @return $salary The person's current salary + */ + function getSalary (); + + ///////////////// + //// Setters //// + ///////////////// + + /** + * Setter for surname + * + * @param $surname The person's new surname as a string + * @return void + */ + function setSurname ($surname); + + /** + * Setter for family name + * + * @param $family The person's new family name as a string + * @return void + */ + function setFamily ($family); + + /** + * Setter for gender. Do not use this so often... ;-) + * This method shall only be used when the person is "created" + * + * @param $gender The person's new gender as a 1-char string (M/F) + * @return void + */ + function setGender ($gender); + + /** + * Setter for employment status + * + * @param $employed The person's new employment stats + * @return void + */ + function setEmployed ($employed); + + /** + * Setter for marrital status + * + * @param $married The person's new marrital status + * @return void + */ + function setMarried ($married); + + /** + * Setter for a already validated birthday. + * + * @param $year The person's new year-of-birth (4 digits) + * @param $month The person's new month-of-birth (1 to 2 digits) + * @param $day The person's new day-of-birth (1 to 2 digits) + * @return void + */ + function setBirthday ($year, $month, $day); + + ///////////////////////////////////// + //// Methods for changing salary //// + ///////////////////////////////////// + + /** + * Increase person's salary by a specified amount + * + * @param $add Add this float amount to current salary + * @return void + */ + function increaseSalary ($add); + + /** + * Decrease person's salary by a specified amount + * + * @param $sub Subtract this float amount to current salary + * @return void + */ + function decreaseSalary ($sub); +} + +// [EOF] +?> diff --git a/application/shipsimu/interfaces/class_SignableContract.php b/application/shipsimu/interfaces/class_SignableContract.php new file mode 100644 index 0000000..a8f62ce --- /dev/null +++ b/application/shipsimu/interfaces/class_SignableContract.php @@ -0,0 +1,30 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface SignableContract extends FrameworkInterface { + // Sign the contract + function signContract (ContractPartner $partnerInstance, ContractPartner $partyInstance); +} + +// [EOF] +?> \ No newline at end of file diff --git a/application/shipsimu/interfaces/class_TradeableItem.php b/application/shipsimu/interfaces/class_TradeableItem.php new file mode 100644 index 0000000..f850be2 --- /dev/null +++ b/application/shipsimu/interfaces/class_TradeableItem.php @@ -0,0 +1,35 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface TradeableItem extends FrameworkInterface { + /** + * Is this item (=object) tradeable? + * + * @return boolean true = is a tradeable object, + * false = is not tradeable + */ + function isTradeable (); +} + +// [EOF] +?> diff --git a/application/shipsimu/loader.php b/application/shipsimu/loader.php new file mode 100644 index 0000000..d28600b --- /dev/null +++ b/application/shipsimu/loader.php @@ -0,0 +1,39 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get config instance +$cfg = FrameworkConfiguration::getSelfInstance(); + +// Load all classes for the application +foreach ($lowerClasses as $className) { + // Load the application classes + ClassLoader::getSelfInstance()->scanClassPath(sprintf("%s/%s/%s", $cfg->getConfigEntry('application_path'), $cfg->getConfigEntry('app_name'), $className)); +} // END - if + +// Clean up the global namespace +unset($lowerClasses); +unset($className); + +// [EOF] +?> diff --git a/application/shipsimu/main/.htaccess b/application/shipsimu/main/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/actions/.htaccess b/application/shipsimu/main/actions/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/actions/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/actions/class_ b/application/shipsimu/main/actions/class_ new file mode 100644 index 0000000..d84fab7 --- /dev/null +++ b/application/shipsimu/main/actions/class_ @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Action extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public final static function create???Action (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new ???Action(); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here + $this->partialStub("You have to implement me."); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Call parent addExtraFilters method + parent::addExtraFilters($controllerInstance, $requestInstance); + + // Unfinished method + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/class_BaseShipSimuAction.php b/application/shipsimu/main/actions/class_BaseShipSimuAction.php new file mode 100644 index 0000000..41dcce0 --- /dev/null +++ b/application/shipsimu/main/actions/class_BaseShipSimuAction.php @@ -0,0 +1,62 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseShipSimuAction extends BaseAction { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + protected function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Add code here executed with every action + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Unfinished method + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/ship-simu/.htaccess b/application/shipsimu/main/actions/ship-simu/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/actions/ship-simu/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/actions/ship-simu/class_ShipSimuLoginAction.php b/application/shipsimu/main/actions/ship-simu/class_ShipSimuLoginAction.php new file mode 100644 index 0000000..2fbee37 --- /dev/null +++ b/application/shipsimu/main/actions/ship-simu/class_ShipSimuLoginAction.php @@ -0,0 +1,65 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLoginAction extends BaseShipSimuAction implements PerformableAction { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @return $actionInstance An instance of this action class + */ + public static final function createShipSimuLoginAction () { + // Get a new instance + $actionInstance = new ShipSimuLoginAction(); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe we need to do something later here + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/ship-simu/class_ShipSimuProfileAction.php b/application/shipsimu/main/actions/ship-simu/class_ShipSimuProfileAction.php new file mode 100644 index 0000000..56090bf --- /dev/null +++ b/application/shipsimu/main/actions/ship-simu/class_ShipSimuProfileAction.php @@ -0,0 +1,65 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuProfileAction extends BaseShipSimuAction implements PerformableAction { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @return $actionInstance An instance of this action class + */ + public static final function createShipSimuProfileAction () { + // Get a new instance + $actionInstance = new ShipSimuProfileAction(); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe we need to do something later here + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/.htaccess b/application/shipsimu/main/actions/web/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/actions/web/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLogin b/application/shipsimu/main/actions/web/class_WebShipSimuLogin new file mode 100644 index 0000000..d60f442 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLogin @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLogin???Action extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public final static function createWebShipSimuLogin???Action (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLogin???Action(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute parent method + parent::execute($requestInstance, $responseInstance); + + // Add your code here + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginCompanyAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginCompanyAction.php new file mode 100644 index 0000000..842d6cb --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginCompanyAction.php @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginCompanyAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginCompanyAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginCompanyAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe add fetching company list of current user here? + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some more filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php new file mode 100644 index 0000000..fa62481 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php @@ -0,0 +1,85 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginGovernmentStartupHelpAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginGovernmentStartupHelpAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginGovernmentStartupHelpAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Check if government can pay startup help + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php new file mode 100644 index 0000000..fcbc711 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php @@ -0,0 +1,85 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginGovernmentTrainingAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginGovernmentTrainingAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginGovernmentTrainingAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some more filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Check if government can pay a training + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginLogoutAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginLogoutAction.php new file mode 100644 index 0000000..9b066a9 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginLogoutAction.php @@ -0,0 +1,81 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginLogoutAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginLogoutAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginLogoutAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginProfileAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginProfileAction.php new file mode 100644 index 0000000..58d6745 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginProfileAction.php @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginProfileAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginProfileAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginProfileAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginRefillAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginRefillAction.php new file mode 100644 index 0000000..31c7337 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginRefillAction.php @@ -0,0 +1,87 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginRefillAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginRefillAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginRefillAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Is the refill page active? + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); + + // Add payment discovery filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this))); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php new file mode 100644 index 0000000..8b26b8f --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginStatusProblemAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginStatusProblemAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginStatusProblemAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent method + parent::execute($requestInstance, $responseInstance); + + // Add your code + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php b/application/shipsimu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php new file mode 100644 index 0000000..d839bd1 --- /dev/null +++ b/application/shipsimu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php @@ -0,0 +1,81 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuLoginWelcomeAction extends BaseShipSimuAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public static final function createWebShipSimuLoginWelcomeAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginWelcomeAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Call parent execute method + parent::execute($requestInstance, $responseInstance); + + // Add your code here... + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some filters here + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Unfinished method + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/bank/.htaccess b/application/shipsimu/main/bank/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/bank/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/bank/class_BaseBank.php b/application/shipsimu/main/bank/class_BaseBank.php new file mode 100644 index 0000000..21ae0d5 --- /dev/null +++ b/application/shipsimu/main/bank/class_BaseBank.php @@ -0,0 +1,60 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * @todo Find an instance for all banks and move the abstract functions there + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +abstract class BaseBank extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className The class' real name + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Checks wether the bank lends more money to the current user + * + * @return $lendsMoreMoney Wether this bank lends more money to the user + */ + public abstract function ifBankLendsMoreMoney (); + + /** + * Checks wethert the current user has maximum allowed credits with this bank + * + * @return $hasMaximumCredits Wether the user has maximum allowed credits + */ + public abstract function ifUserHasMaxCredits (); + + /** + * Checks wether this money bank has opened + * + * @return $hasOpened Wether this money bank has opened + */ + public abstract function ifMoneyBankHasOpened (); +} + +// [EOF] +?> diff --git a/application/shipsimu/main/bank/money/class_MoneyBank.php b/application/shipsimu/main/bank/money/class_MoneyBank.php new file mode 100644 index 0000000..11d4d9e --- /dev/null +++ b/application/shipsimu/main/bank/money/class_MoneyBank.php @@ -0,0 +1,94 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MoneyBank extends BaseBank implements Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this money bank class + * + * @param $userInstance A class instance of a user object + * @return $bankInstance An instance of this class + */ + public static final function createMoneyBank (ManageableAccount $userInstance) { + // Get a new instance + $moneyInstance = new MoneyBank(); + + // Set the user instance + $moneyInstance->setUserInstance($userInstance); + + // Return the prepared instance + return $moneyInstance; + } + + /** + * Checks wether the bank lends more money to the current user + * + * @return $lendsMoreMoney Wether this bank lends more money to the user + */ + public function ifBankLendsMoreMoney () { + $this->partialStub(); + } + + /** + * Checks wethert the current user has maximum allowed credits with this bank + * + * @return $hasMaximumCredits Wether the user has maximum allowed credits + */ + public function ifUserHasMaxCredits () { + $this->partialStub(); + } + + /** + * Checks wether this money bank has opened + * + * @return $hasOpened Wether this money bank has opened + */ + public function ifMoneyBankHasOpened () { + // Has not opened by default + $hasOpened = false; + + // Is the money bank activated in config? + if ($this->getConfigInstance()->getConfigEntry('moneybank_activated')) { + // Okay, does the user ask within the opening times? To find this out we need a OpeningTimes class + $openingInstance = ObjectFactory::createObjectByConfiguredName('moneybank_opening_class', array($this)); + + // Then we simply "ask" the opening time instance if the user asks within the opening time + $hasOpened = $openingInstance->ifWithinOpeningTimes(); + } // END - if + + // Return status + return $hasOpened; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/class_ b/application/shipsimu/main/class_ new file mode 100644 index 0000000..956f6c5 --- /dev/null +++ b/application/shipsimu/main/class_ @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ??? extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this money bank class + * + * @return $???Instance An instance of this class + */ + public final static function create??? () { + // Get a new instance + $???Instance = new ???(); + + // Return the prepared instance + return $???Instance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/class_BasePersonell.php b/application/shipsimu/main/class_BasePersonell.php new file mode 100644 index 0000000..8e08ec3 --- /dev/null +++ b/application/shipsimu/main/class_BasePersonell.php @@ -0,0 +1,246 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BasePersonell extends BaseFrameworkSystem implements Personellizer { + // Maximum/minimum age + private $MIN_AGE = 21; + private $MAX_AGE = 40; + + // Male/female + private $gender = ""; // M=Male, F=Female, empty=uninitialized + + // Year/month/day of birth + private $yearBirth = 0; + private $monthBirth = 0; + private $dayBirth = 0; + + // Surname/family name + private $surname = ""; + private $family = ""; + + // Employed? + private $employed = false; + + // Married? + private $married = false; + + // Her/his salary + private $salary = 0.00; + + // Constructor + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Remove min/max ages + public final function removeMinMaxAge () { + unset($this->MIN_AGE); + unset($this->MAX_AGE); + } + + // Generates a birthday based on MAX_AGE/MIN_AGE and the current date + public final function createBirthday () { + // Is the birthday already set? + if ($this->isDateValid($this->yearBirth, $this->monthBirth, $this->dayBirth)) return false; + + // Get current year + $currYear = date("Y", time()); + + // Generate random year/month/day + $year = mt_rand(($currYear - $this->MIN_AGE), ($currYear - $this->MAX_AGE)); + $month = 0; + $day = 0; + while ($this->isDateValid($year, $month, $day) === false) { + $month = mt_rand(1, 12); + switch ($month) { + case 1: + case 3: + case 5: + case 7: + case 8: + case 10: + case 12: + $day = mt_rand(1, 31); + break; + + case 4: + case 6: + case 9: + case 11: + $day = mt_rand(1, 30); + break; + + case 2: // February + if ($year % 4 == 0) { + // Is a "Schaltjahr" + $day = mt_rand(1, 29); + } else { + // Regular year + $day = mt_rand(1, 28); + } + break; + } // END - switch + } // END - while + + // Set the new birthday + $this->setBirthday($year, $month, $day); + } + + // Is the current day valid? + public final function isDateValid ($year, $month, $day) { + // Create timestamp + $stamp = mktime(0, 0, 0, $month, $day, $year); + + // Get year/month/day back + $y = date("Y", $stamp); + $m = date("m", $stamp); + $d = date("d", $stamp); + + // Compare all + return (($y == $year) && ($m == $month) && ($d == $day)); + } + + // Employed? + public final function isEmployed () { + return $this->employed; + } + + // Married? + public final function isMarried () { + return $this->married; + } + + // Male? + public final function isMale () { + return ($this->gender == "M"); + } + + // Female + public final function isFemale () { + return ($this->gender == "F"); + } + + // Setter for surname + public final function setSurname ($surname) { + $this->surname = (string) $surname; + } + + // Getter for surname + public function getSurname () { + return $this->surname; + } + + // Setter for family name + public final function setFamily ($family) { + $this->family = (string) $family; + } + + // Getter for family name + public final function getFamily () { + return $this->family; + } + + // Setter for gender + public final function setGender ($gender) { + // Set random gender here + if (($gender == "M") || ($gender == "F") || ((empty($gender)) && ($this->getSurname() == ""))) { + $this->gender = $gender; + } else { + throw new WrongGenderSpecifiedException($gender, self::EXCEPTION_GENDER_IS_WRONG); + } + } + + // Getter for gender + public final function getGender () { + return $this->gender; + } + + // Setter for employment status + public final function setEmployed ($employed) { + $this->employed = (boolean) $employed; + } + + // Setter for marriage status + public final function setMarried ($married) { + $this->married = (boolean) $married; + } + + // Getter for salary + public final function getSalary () { + return $this->salary; + } + + // Increase salary + public final function increaseSalary ($add) { + $this->salary += (float) abs($add); + } + + // Decrease salary + public final function decreaseSalary ($sub) { + $this->salary -= (float) abs($sub); + } + + // Setter for birthday + public final function setBirthday ($year, $month, $day) { + $this->yearBirth = (int) abs($year); + $this->monthBirth = (int) abs($month); + $this->dayBirth = (int) abs($day); + } + + // Remove gender + public final function removeGender () { + unset($this->gender); + } + + // Remove both names + public final function removeNames () { + unset($this->surname); + unset($this->family); + } + + // Remove complete birthday + public final function removeBirthday () { + unset($this->yearBirth); + unset($this->monthBirth); + unset($this->dayBirth); + } + + // Remove salary + public final function removeSalary () { + unset($this->salary); + } + + // Remove employment status + public final function removeEmployed () { + unset($this->employed); + } + + // Remove marrital status + public final function removeMarried () { + unset($this->married); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/class_BaseSimulator.php b/application/shipsimu/main/class_BaseSimulator.php new file mode 100644 index 0000000..e460013 --- /dev/null +++ b/application/shipsimu/main/class_BaseSimulator.php @@ -0,0 +1,302 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseSimulator extends BaseFrameworkSystem { + // Schiffsteilinstanz + private $partInstance = null; + + // Abmasse (Breite/Hoehe/Laenge) + private $width = 0; + private $height = 0; + private $length = 0; + + // Aktuelles Schiff und Schiffsteil + private $currShip = null; + private $currPart = null; + + // Faktoren zur Erweiterung der Masse. Beispielsweise soll der Maschinenraum groesser wie der Motor sein + private $resizeFactorArray = array( + 'width' => 1, + 'height' => 1, + 'length' => 1 + ); + + // Konstruktor + protected function __construct ($className) { + // Call highest constructor + parent::__construct($className); + + // Clean up a little, dies sollte ganz zum Schluss erfolgen! + $this->removeResizeFactorArray(); + $this->removeCurrPart(); + $this->removeCurrShip(); + } + + // Setter-Methode fuer Laenge + public final function setLength ($length) { + $this->length = (float) $length; + } + + // Setter-Methode fuer Breite + public final function setWidth ($width) { + $this->width = (float) $width; + } + + // Setter-Methode fuer Hoehe + public final function setHeight ($height) { + $this->height = (float) $height; + } + + // Getter-Methode fuer Laenge + public final function getLength () { + return $this->length; + } + + // Getter-Methode fuer Breite + public final function getWidth () { + return $this->width; + } + + // Getter-Methode fuer Hoehe + public final function getHeight () { + return $this->height; + } + + // Setter-Methode fuer Teil-Instanz + public final function setPartInstance (ConstructableShipPart $partInstance) { + $this->partInstance = $partInstance; + } + + // Getter-Methode fuer Teil-Instanz + public final function getPartInstance () { + if (!isset($this->partInstance)) { + return null; + } + return $this->partInstance; + } + + // Remover-Methode fuer die Teil-Instanz + public final function removePartInstance () { + unset($this->partInstance); + } + + // Prueft ob all Umberechnungsfaktoren gesetzt sind + private function isResizeFactorValid () { + return (($this->getResizeFactorElement('width') > 1) + || ($this->getResizeFactorElement('height') > 1) + || ($this->getResizeFactorElement('length') > 1) + ); + } + + // Baut einen Motor in das Schiff ein + public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $partInstance) { + // Schiff/-steil merken + $this->currShip = $shipInstance; + $this->currPart = $partInstance; + + // Passt ueberhaupt das Schiffsteil in's Schiff? + if ($this->isShipPartSizeValid()) { + // Muessen die Masse angepasst werden? + if ($this->isResizeFactorValid()) { + // Neue Angaben berechnen (wir lassen etwas Lust fuer Kabelbaeume, Roehren, Maschinisten, etc.) + $this->newWidth = (float) $this->getCurrPart()->getWidth() * $this->resizeFactorArray['width']; + $this->newHeight = (float) $this->getCurrPart()->getHeight() * $this->resizeFactorArray['height']; + $this->newLength = (float) $this->getCurrPart()->getLength() * $this->resizeFactorArray['length']; + + // Passt dies nun immer noch? + if ($this->isNewSizeValid()) { + // Das passt auch, dann Werte setzen und Motor-Instanz merken + $this->setWidth($this->newWidth); + $this->setHeight($this->newHeight); + $this->setLength($this->newLength); + + // Einige Dinge entfernen... + $this->removeAllNewAttr(); + } else { + // Passt nicht! Also wieder Exception werfen... + throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s ist zu gross für das Schiff!", + $this->getCurrPart()->__toString(), + $this->getCurrPart()->getObjectDescription(), + $this->getCurrPart()->__toString() + ), 2); + } + } elseif ($this->currPart != null) { + // Aktuelle Masse setzen + $this->setWidth($this->getCurrPart()->getWidth()); + $this->setHeight($this->getCurrPart()->getHeight()); + $this->setLength($this->getCurrPart()->getLength()); + } + + // Existiert ein Schiffsteil? + if (!is_null($this->currPart)) { + // Schiffsteil-Instanz setzen + $this->setPartInstance($this->currPart); + + // Instanzen entfernen + $this->getCurrPart()->removeCurrShip(); + $this->getCurrPart()->removeCurrPart(); + $this->getCurrPart()->removePartInstance(); + $this->getCurrPart()->removeResizeFactorArray(); + } + } else { + // Exception werfen! + throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil %s vom Typ %s passt nicht in das Schiff!", + $this->getCurrPart()->realClass, + $this->getCurrPart()->getObjectDescription(), + $this->getCurrPart()->__toString() + ), 1); + } + + // Nochmals Clean up a little + $this->removeResizeFactorArray(); + $this->removeCurrShip(); + $this->removeCurrPart(); + } + + // Array fuer Umrechnungstabelle entfernen + public final function removeResizeFactorArray () { + unset($this->resizeFactorArray); + } + + /** + * Remove all new*** attributes + * + * @return void + */ + public final function removeAllNewAttr () { + unset($this->newWidth); + unset($this->newHeight); + unset($this->newLength); + } + + /** + * Remove current ship instance + * + * @return void + */ + public final function removeCurrShip () { + unset($this->currShip); + } + + // Aktuelle Schiffsteil-Instanz entfernen + public final function removeCurrPart () { + unset($this->currPart); + } + + // Breite entfernen + public final function removeWidth () { + unset($this->width); + } + + // Hoehe entfernen + public final function removeHeight () { + unset($this->height); + } + + // Laenge entfernen + public final function removeLength () { + unset($this->length); + } + + // Tiefgang entfernen + public final function removeDraught () { + unset($this->draught); + } + + // Getter-Methode fuer Element aus resizeFactor + public final function getResizeFactorElement ($el) { + if (isset($this->resizeFactorArray[$el])) { + // Element gefunden + return $this->resizeFactorArray[$el]; + } else { + // Element nicht gefunden! + return null; + } + } + + // Setter-Methode fuer Element in resizeFactor + public final function setResizeFactorElement ($el, $value) { + $this->resizeFactorArray[$el] = (float) $value; + } + + // Kontrolliert, ob die Abmasse Schiffsteil->Schiff stimmen + public function isShipPartSizeValid () { + return ( + ( + ( // Already defined ship messurings + ($this->getCurrPart()->getWidth() < $this->currShip->getWidth()) + && ($this->getCurrPart()->getHeight() < $this->currShip->getDraught()) + && ($this->getCurrPart()->getLength() < $this->currShip->getLength()) + ) || ( // Ship messurings shall be calculated + ($this->currShip->getWidth() == 0) + && ($this->currShip->getHeight() == 0) + && ($this->currShip->getLength() == 0) + ) + // The inserted part must be messured! + ) && ($this->getCurrPart()->getWidth() > 0) + && ($this->getCurrPart()->getHeight() > 0) + && ($this->getCurrPart()->getLength() > 0) + ); + } + + // Kontrolliert, ob die Abmasse Maschinenraum->Schiff stimmen + public function isNewSizeValid () { + return ( + ( // Already defined ship messurings + ($this->newWidth < $this->currShip->getWidth()) + && ($this->newHeight < $this->currShip->getDraught()) + && ($this->newLength < $this->currShip->getLength()) + ) || ( // Ship messurings shall be calculated + ($this->currShip->getWidth() == 0) + && ($this->currShip->getHeight() == 0) + && ($this->currShip->getLength() == 0) + ) + ); + } + + // Masse extrahieren + public function extractDimensions ($dim) { + // Abmasse setzen + if ((isset($dim)) && (is_array($dim)) && (count($dim) == 3)) { + // Abmasse aus Array holen + $this->setWidth($dim[0]); + $this->setHeight($dim[1]); + $this->setLength($dim[2]); + } else { + // Nicht gefundene Abmasse! + throw new DimNotFoundInArrayException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); + } + } + + /** + * Getter for current part instance + * + * @return $currPart Instance of the current ship part object + */ + public final function getCurrPart () { + return $this->currPart; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/class_Merchant.php b/application/shipsimu/main/class_Merchant.php new file mode 100644 index 0000000..648e299 --- /dev/null +++ b/application/shipsimu/main/class_Merchant.php @@ -0,0 +1,109 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Merchant extends BaseFrameworkSystem { + // Name des Haendlers + private $merchantName = "Namenloser Händler"; + + // Preislite (Objekte wiedermal!) + private $priceList = null; + + // Zugewiesener Hafen + private $harborInstance = null; + + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Haendler mit Namen erzeugen + public static final function createMerchant ($merchantName, Harbor $harborInstance) { + // String absichern + $merchantName = (string) $merchantName; + + // Get new instance + $merchantInstance = new Merchant(); + + // Debug message + if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) { + $merchantInstance->debugOutput(sprintf("[%s:%d] Ein Händler %s wird angelegt und soll sich am %s niederlassen.", + __CLASS__, + __LINE__, + $merchantName, + $harborInstance->getHarborName() + )); + } + + // Haendlernamen setzen + $merchantInstance->setMerchantName($merchantName); + + // In dem angegebenen Hafen den Haendler ansiedeln + $merchantInstance->setHarborInstance($harborInstance); + + // Preisliste initialisieren + $merchantInstance->createPriceList(); + + // Instanz zurueckliefern + return $merchantInstance; + } + + // Initialize pricing list + private function createPriceList () { + $this->priceList = new FrameworkArrayObject("FakedPriceList"); + } + + // Setter for merchant name + public final function setMerchantName ($merchantName) { + // Debug message + $this->merchantName = (string) $merchantName; + } + + // Getter for merchant name + public final function getMerchantName () { + return $this->merchantName; + } + + // Setter for harbor instance + public final function setHarborInstance (Harbor $harborInstance) { + $this->harborInstance = $harborInstance; + } + + // Getter for harbor instance + public final function getHarborInstance () { + return $this->harborInstance; + } + + // Add new item to merchant's price list + public function addItemToPriceList (TradeableItem $itemInstance, $price) { + $this->makeDeprecated(); + } + + // Get a price from the merchant's list + public final function getPriceFromList (TradeableItem $itemInstance) { + $this->makeDeprecated(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/class_WorksContract.php b/application/shipsimu/main/class_WorksContract.php new file mode 100644 index 0000000..bbe2f35 --- /dev/null +++ b/application/shipsimu/main/class_WorksContract.php @@ -0,0 +1,329 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WorksContract extends BaseFrameworkSystem implements SignableContract { + // Zukuenftiger Schiffsname + private $shipName = ""; + + // Instanz zum Schiffstypen + private $shipInstance = null; + + // Contract partner + private $contractPartner = null; + + // Other contract partner + private $contractParty = null; + + // Is the contract signed? + private $signed = false; + + // Merchant instance + private $merchantInstance = null; + + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Neuen Bauvertrag generieren + public static final function createWorksContract ($shipType, $shipName, ContractPartner $partnerInstance) { + // Strings absichern + $shipType = (string) $shipType; + $shipName = (string) $shipName; + + // Get new instance + $contractInstance = new WorksContract(); + + // Schiffsnamen setzen + $contractInstance->setShipName($shipName); + + // Existiert die Klasse ueberhaupt? + if (!class_exists($shipType)) { + // Klasse nicht gefunden + throw new NoClassException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND); + } + + // Schiff-Instanz temporaer erzeugen und in den Bauvertrag einfuegen + $shipInstance = ObjectFactory::createObjectByName($shipType, array($shipName)); + $contractInstance->setShipInstance($shipInstance); + + // Remove the ship instance + unset($shipInstance); + + // Set itself as contract partner + $contractInstance->setContractPartner($partnerInstance); + + // Instanz zurueckgeben + return $contractInstance; + } + + // Setter for ship instance + private final function setShipInstance (ConstructableShip $shipInstance) { + $this->shipInstance = $shipInstance; + } + + // Setter for ship name + private final function setShipName ($shipName) { + $this->shipName = (string) $shipName; + } + + // Getter for ship name + public final function getShipName () { + return $this->shipName; + } + + // Getter for ship instance + public final function getShipInstance () { + return $this->shipInstance; + } + + // Add detail to the contract + public function addContractDetails ($shipPart, $parentPart, array $dataArray) { + // Secure strings + $shipPart = (string) $shipPart; + $parentPart = (string) $parentPart; + + // Debug message + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiffsteil %s wird zusammen mit dem Konstruktionsteil %s in den Bauvertrag aufgenommen.", + __CLASS__, + __LINE__, + $shipPart, + $parentPart + )); + + // Initialize the instance (shall not be done within dynamic part) + $partInstance = null; + + // Try to get an instance for this ship part + try { + $partInstance = ObjectFactory::createObjectByName($shipPart, $dataArray); + } catch (DimNotFoundInArrayException $e) { + $this->debugOutput(sprintf("[main:] Die %s konnte nicht vervollständigt werden. Grund: %s
", + $this->getShipInstance()->getShipName(), + $e->getMessage() + )); + + // Debug message + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.", + __CLASS__, + __LINE__ + )); + + // Is this ship part constructable? + if (!$partInstance instanceof ConstructableShipPart) { + // Ship part not constructable! + throw new ShipPartNotConstructableException(array($shipPart), self::EXCEPTION_NOT_CONSTRUCTABLE); + } elseif ($this->getShipInstance()->createShipPart($partInstance, $parentPart) === false) { + // Schiff konnte nicht gebaut werden! + throw new ShipNotConstructedException(sprintf("Das Schiff %s konnte wegen eines Fehlers nicht gebaut werden. Siehe obere Meldungen.", + $this->getShipInstance()->getShipName() + )); + } + } catch (NoClassException $e) { + // Throw it again... + throw new NoClassException($e->getMessage(), $e->getCode()); + } + + // Get price for this item + $price = $this->getMerchantInstance()->getPriceFromList($partInstance); + + // Add price + $partInstance->setPrice($price); + } + + // Setter for contract partner + public final function setContractPartner (ContractPartner $partnerInstance) { + $this->contractPartner = $partnerInstance; + } + + // Getter for contract partner + public final function getContractPartner () { + return $this->contractPartner; + } + + // Setter for contract party + public final function setContractParty (ContractPartner $partyInstance) { + $this->contractParty = $partyInstance; + } + + // Getter for contract party + public final function getContractParty () { + return $this->contractParty; + } + + // Setter for signature + public final function setSigned ($signed) { + $this->signed = (boolean) $signed; + } + + // Getter for signature + public function isSigned () { + return $this->signed; + } + + // Sign the contract + public function signContract (ContractPartner $partnerInstance, ContractPartner $partyInstance) { + // Is this contract already signed? + if ($this->isSigned()) { + // Throw an exception + throw new ContractAllreadySignedException(array($this, $this->getContractPartner(), $this->getContractParty()), self::EXCEPTION_CONTRACT_ALREADY_SIGNED); + } + + // Is the first contract partner still the same? + if ($partnerInstance->equals($this->getContractPartner())) { + // Set contract party (other partner is already set) + $this->setContractParty($partyInstance); + + // Finally sign it + $this->setSigned(true); + } else { + // Throw an exception + throw new ContractPartnerMismatchException(array($this, $this->getContractPartner(), $partyInstance), self::EXCEPTION_CONTRACT_PARTNER_MISMATCH); + } + + // Debug message + if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) { + if ($partnerInstance->equals($partyInstance)) { + // With itself + $this->debugOutput(sprintf("[%s:%d] Die %s %s stimmt einem Bauvertrag über das %s %s zu.", + __CLASS__, + __LINE__, + $partnerInstance->getObjectDescription(), + $partnerInstance->getCompanyName(), + $this->getShipInstance()->getObjectDescription(), + $this->getShipInstance()->getShipName() + )); + } else { + // Other contract party + $this->debugOutput(sprintf("[%s:%d] Die %s %s geht mit der %s %s einen Bauvertrag über das %s %s ein.", + __CLASS__, + __LINE__, + $partnerInstance->getObjectDescription(), + $partnerInstance->getCompanyName(), + $partyInstance->getObjectDescription(), + $partyInstance->getCompanyName(), + $this->getShipInstance()->getObjectDescription(), + $this->getShipInstance()->getShipName() + )); + } + } + } + + // Setter for merchant instance + public final function setMerchantInstance (Merchant $merchantInstance) { + $this->merchantInstance = $merchantInstance; + } + + // Getter for merchant instance + public final function getMerchantInstance () { + return $this->merchantInstance; + } + + // Getter for total price + public final function getTotalPrice () { + // Get ship instance + $shipInstance = $this->getShipInstance(); + + // Is this a ship? + if (is_null($shipInstance)) { + // Opps! Empty partner instance? + throw new NullPointerException($shipInstance, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($shipInstance)) { + // Not an object! ;-( + throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); + } elseif (!$shipInstance instanceof ConstructableShip) { + // Does not have the required feature (method) + throw new ShipIsInvalidException(array($shipInstance), self::EXCEPTION_INVALID_SHIP_INSTANCE); + } + + // Get the structure array + $struct = $shipInstance->getStructuresArray(); + + // Is this a ship? + if (is_null($struct)) { + // Opps! Empty partner instance? + throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY); + } + + // Init total price + $totalPrice = 0; + + // Iterate through the list + for ($iter = $struct->getIterator(); $iter->valid(); $iter->next()) { + // Get item + $item = $iter->current(); + + // Is this a ship? + if (is_null($item)) { + // Opps! Empty partner instance? + throw new NullPointerException($item, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($item)) { + // Not an object! ;-( + throw new InvalidObjectException($item, self::EXCEPTION_IS_NO_OBJECT); + } elseif (!$item instanceof BaseSimulator) { + // Does not have the required feature (method) + throw new MissingMethodException(array($item, 'getPartInstance'), self::EXCEPTION_MISSING_METHOD); + } + + // Get part instance + $part = $item->getPartInstance(); + + // Is this a ship? + if (is_null($part)) { + // Opps! Empty partner instance? + throw new NullPointerException($part, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($part)) { + // Not an object! ;-( + throw new InvalidObjectException($part, self::EXCEPTION_IS_NO_OBJECT); + } elseif (!method_exists($part, 'getPrice')) { + // Does not have the required feature (method) + throw new MissingMethodException(array($part, 'getPrice'), self::EXCEPTION_MISSING_METHOD); + } + + // Get price for one item + $price = $part->getPrice(); + + // Is there numCabin() available? + if (method_exists($item, 'getNumCabin')) { + // Get total cabin and multiply it with the price + $price = $price * $item->getNumCabin(); + } + + // Add price to total price + $totalPrice += $price; + } + + // Total price calculated? + if ($totalPrice === 0) { + // Throw exception + throw new TotalPriceNotCalculatedException($this, self::EXCEPTION_TOTAL_PRICE_NOT_CALCULATED); + } + + // Return total price + return $totalPrice; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/.htaccess b/application/shipsimu/main/commands/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/commands/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/commands/web/.htaccess b/application/shipsimu/main/commands/web/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/commands/web/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/shipsimu/main/commands/web/class_WebShipsimuGuestLoginCommand.php new file mode 100644 index 0000000..14015a3 --- /dev/null +++ b/application/shipsimu/main/commands/web/class_WebShipsimuGuestLoginCommand.php @@ -0,0 +1,112 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipsimuGuestLoginCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipsimuGuestLoginCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // First get a GuestLogin instance + $loginInstance = ObjectFactory::createObjectByConfiguredName('guest_login_class'); + + // First set request and response instance + $loginInstance->setRequestInstance($requestInstance); + + // Encrypt the password + $loginInstance->encryptPassword('passwd'); + + // Do the login here + $loginInstance->doLogin($requestInstance, $responseInstance); + + // Was the login fine? Then redirect here + if ($loginInstance->ifLoginWasSuccessfull()) { + // Try to redirect here + try { + // Redirect... + $responseInstance->redirectToConfiguredUrl('app_login'); + + // Exit here + exit(); + } catch (FrameworkException $e) { + // Something went wrong here! + $responseInstance->addFatalMessage($e->getMessage()); + } + } else { + // Attach error message to the response + $responseInstance->addFatalMessage('failed_user_login'); + } + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add more filters + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add username verifier filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter')); + + // Add password verifier filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter')); + + // Add CAPTCHA verifier code + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/class_WebShipsimuProfileCommand.php b/application/shipsimu/main/commands/web/class_WebShipsimuProfileCommand.php new file mode 100644 index 0000000..a266f26 --- /dev/null +++ b/application/shipsimu/main/commands/web/class_WebShipsimuProfileCommand.php @@ -0,0 +1,153 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuProfileCommand extends BaseCommand implements Commandable { + /** + * Filtered request data + */ + private $requestData = array(); + + /** + * Allowed profile data to pass through + */ + private $allowedData = array( + 'pass' => 'pass1', + 'email' => 'email1', + 'surname', + 'family', + 'street', + 'city', + 'zip', + 'icq', + 'jabber', + 'yahoo', + 'aol', + 'msn', + 'rules', + 'birth_day', + 'birth_month', + 'birth_year' + ); + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipsimuProfileCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Add functionality here + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Make sure only allowed values are comming through + foreach ($this->allowedData as $alias => $element) { + // Get data + $data = $requestInstance->getRequestElement($element); + + // Silently skip empty fields + if (empty($data)) continue; + + // Do we have an alias? + if (is_string($alias)) { + // Yes, so use it + $this->requestData[$alias] = $data; + } else { + // No, default entry + $this->requestData[$element] = $data; + } + } // END - foreach + + // Remove the array, we don't need it anymore + unset($this->allowedData); + + // Unfinished! + $this->partialStub("Unfinished work."); + $this->debugBackTrace(); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some more pre/post filters to the controller + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // User status filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // User status if not 'guest' filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_guest_filter')); + + // Updated rules accepted + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); + + // Account password validation + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + + // Validate CAPTCHA input + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter')); + + // Validate birthday input + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter')); + + // Email changed + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter')); + + // Password changed + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/class_WebShipsimuRefillCommand.php b/application/shipsimu/main/commands/web/class_WebShipsimuRefillCommand.php new file mode 100644 index 0000000..1c9bd8e --- /dev/null +++ b/application/shipsimu/main/commands/web/class_WebShipsimuRefillCommand.php @@ -0,0 +1,112 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuRefillCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipsimuRefillCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipsimuRefillCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get template instance + $templateInstance = $responseInstance->getTemplateInstance(); + + // Set amount and type as variables + $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type')); + $templateInstance->assignVariable('amount' , $requestInstance->getRequestElement('amount')); + + // This method does currently redirect if all goes right. Booking is done in filters + $responseInstance->redirectToConfiguredUrl('refill_page_done'); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Is the refill page active? + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); + + // Verify password + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + + // Verify CAPTCHA code + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); + + // Verify refill request + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter')); + + // Construct config entry for wether automatic payment from API or waiting for approval + $paymentTypeConfig = sprintf("refill_request_%s_payment_type", $requestInstance->getRequestElement('type')); + + // Prepare a filter based on the requested type we shall refill + $filterName = sprintf("refill_request_%s_%s_book_filter", + $requestInstance->getRequestElement('type'), + $this->getConfigInstance()->getConfigEntry($paymentTypeConfig) + ); + + // Now, try to load that filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName($filterName)); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/shipsimu/main/commands/web/class_WebShipsimuRegisterCommand.php new file mode 100644 index 0000000..181ce2f --- /dev/null +++ b/application/shipsimu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -0,0 +1,117 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipsimuRegisterCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipsimuRegisterCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // First get a UserRegistration instance + $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class'); + + // First set request and response instance + $registerInstance->setRequestInstance($requestInstance); + $registerInstance->setResponseInstance($responseInstance); + + // Encrypt the password + $registerInstance->encryptPassword('pass1'); + + // Do things before registration + $registerInstance->doPreRegistration(); + + // Register the new user + $registerInstance->registerNewUser(); + + // Do things after registration like notifying partner pages or queueing + // them for notification + $registerInstance->doPostRegistration(); + + // Redirect or login after registration + $registerInstance->doPostAction(); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add some more pre/post filters to the controller + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Validate email address (if configured: check on double email addresses) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter')); + + // Validate username and check if it does not exist + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter')); + + // Validate if username is "guest" and not taken + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter')); + + // Validate if password is set + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter')); + + // Check if rules where accepted + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); + + // Validate CAPTCHA input + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter')); + + // Validate birthday + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/class_WebShipsimuUserLoginCommand.php b/application/shipsimu/main/commands/web/class_WebShipsimuUserLoginCommand.php new file mode 100644 index 0000000..2a33a8f --- /dev/null +++ b/application/shipsimu/main/commands/web/class_WebShipsimuUserLoginCommand.php @@ -0,0 +1,124 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipsimuUserLoginCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipsimuUserLoginCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // First get a UserLogin instance + $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class'); + + // First set request and response instance + $loginInstance->setRequestInstance($requestInstance); + + // Encrypt the password + $loginInstance->encryptPassword('pass'); + + // Do the login here + $loginInstance->doLogin($requestInstance, $responseInstance); + + // Was the login fine? Then redirect here + if ($loginInstance->ifLoginWasSuccessfull()) { + // Try to redirect here + try { + // Redirect... + $responseInstance->redirectToConfiguredUrl('app_login'); + + // Exit here + exit(); + } catch (FrameworkException $e) { + // Something went wrong here! + $responseInstance->addFatalMessage($e->getMessage()); + } + } else { + // Attach error message to the response + $responseInstance->addFatalMessage('failed_user_login'); + } + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Add more filters + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Which login type do we have? + switch ($this->getConfigInstance()->getConfigEntry('login_type')) { + case 'username': // Login via username + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter')); + break; + + case 'email': // Login via email + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter')); + break; + + default: // Wether username or email is set + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter')); + break; + } + + // Password verifier filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter')); + + // Add filter for CAPTCHA + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/company/.htaccess b/application/shipsimu/main/commands/web/company/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/commands/web/company/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/commands/web/company/class_WebShipSimuCompanyCommand.php b/application/shipsimu/main/commands/web/company/class_WebShipSimuCompanyCommand.php new file mode 100644 index 0000000..7fed46f --- /dev/null +++ b/application/shipsimu/main/commands/web/company/class_WebShipSimuCompanyCommand.php @@ -0,0 +1,88 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipSimuCompanyCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this command and sets the resolver instance + * + * @param $resolverInstance An instance of a command resolver + * @return $commandInstance The created command instance + */ + public static final function createWebShipSimuCompanyCommand (CommandResolver $resolverInstance) { + // Get a new instance + $commandInstance = new WebShipSimuCompanyCommand(); + + // Set the resolver instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get template instance + $templateInstance = $responseInstance->getTemplateInstance(); + + // Set amount and type as variables + $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type')); + $templateInstance->assignVariable('amount' , $requestInstance->getRequestElement('amount')); + + // This method does currently redirect if all goes right + $responseInstance->redirectToConfiguredUrl('refill_page_done'); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/government/.htaccess b/application/shipsimu/main/commands/web/government/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/commands/web/government/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php b/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php new file mode 100644 index 0000000..e720850 --- /dev/null +++ b/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php @@ -0,0 +1,146 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebGovernmentFailedStartupCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public static final function createWebGovernmentFailedStartupCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebGovernmentFailedStartupCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get the action instance from registry + $actionInstance = Registry::getRegistry()->getInstance('action'); + + // Do we have an action here? + if ($actionInstance instanceof PerformableAction) { + // Execute the action (shall not output anything, see below why) + $actionInstance->execute($requestInstance, $responseInstance); + } // END - if + + // Get the application instance + $appInstance = $this->getResolverInstance()->getApplicationInstance(); + + // Prepare a template instance + $templateInstance = $this->prepareTemplateInstance($appInstance); + + // Assign base URL + $templateInstance->assignConfigVariable('base_url'); + + // Assign all the application's data with template variables + $templateInstance->assignApplicationData($appInstance); + + // Load the master template + $masterTemplate = $appInstance->buildMasterTemplateName(); + + // Load header template + $templateInstance->loadCodeTemplate('header'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('header', 'header'); + + // Load footer template + $templateInstance->loadCodeTemplate('footer'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('footer', 'footer'); + + // Load main template + $templateInstance->loadCodeTemplate('government_failed_main'); + + // Assign the main template with the master template as a content ... ;) + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('government_failed_main', 'content'); + + // Load the master template + $templateInstance->loadCodeTemplate($masterTemplate); + + // Set title + $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('page') . '_' . $requestInstance->getRequestElement('failed') . '_title')); + + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance)); + + // Render the menu + $menuInstance->renderMenu(); + + // Transfer it to the template engine instance + $menuInstance->transferContentToTemplateEngine(); + + // ... and all variables. This should be merged together in a pattern + // to make things easier. A cache mechanism should be added between + // these two calls to cache compiled templates. + $templateInstance->compileVariables(); + + // Get the content back from the template engine and put it in response class + $templateInstance->transferToResponse($responseInstance); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Maybe we need some filters here? + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Empty for now + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php b/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php new file mode 100644 index 0000000..45bcc32 --- /dev/null +++ b/application/shipsimu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php @@ -0,0 +1,146 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebGovernmentFailedTrainingCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public static final function createWebGovernmentFailedTrainingCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebGovernmentFailedTrainingCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get the action instance from registry + $actionInstance = Registry::getRegistry()->getInstance('action'); + + // Do we have an action here? + if ($actionInstance instanceof PerformableAction) { + // Execute the action (shall not output anything, see below why) + $actionInstance->execute($requestInstance, $responseInstance); + } // END - if + + // Get the application instance + $appInstance = $this->getResolverInstance()->getApplicationInstance(); + + // Prepare a template instance + $templateInstance = $this->prepareTemplateInstance($appInstance); + + // Assign base URL + $templateInstance->assignConfigVariable('base_url'); + + // Assign all the application's data with template variables + $templateInstance->assignApplicationData($appInstance); + + // Load the master template + $masterTemplate = $appInstance->buildMasterTemplateName(); + + // Load header template + $templateInstance->loadCodeTemplate('header'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('header', 'header'); + + // Load footer template + $templateInstance->loadCodeTemplate('footer'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('footer', 'footer'); + + // Load main template + $templateInstance->loadCodeTemplate('government_failed_main'); + + // Assign the main template with the master template as a content ... ;) + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('government_failed_main', 'content'); + + // Load the master template + $templateInstance->loadCodeTemplate($masterTemplate); + + // Set title + $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('page') . '_' . $requestInstance->getRequestElement('failed') . '_title')); + + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance)); + + // Render the menu + $menuInstance->renderMenu(); + + // Transfer it to the template engine instance + $menuInstance->transferContentToTemplateEngine(); + + // ... and all variables. This should be merged together in a pattern + // to make things easier. A cache mechanism should be added between + // these two calls to cache compiled templates. + $templateInstance->compileVariables(); + + // Get the content back from the template engine and put it in response class + $templateInstance->transferToResponse($responseInstance); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Maybe we need some filters here? + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Empty for now + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php b/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php new file mode 100644 index 0000000..3153962 --- /dev/null +++ b/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php @@ -0,0 +1,96 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuGovernmentStartupCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public static final function createWebShipsimuGovernmentStartupCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebShipsimuGovernmentStartupCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); + + // Register the startup help + $wrapperInstance->registerStartupHelpByRequest($requestInstance); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Maybe we need some filters here? + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Check if government can pay startup help + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter')); + + // Verify password + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + + // Verify CAPTCHA code + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_government_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php b/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php new file mode 100644 index 0000000..035e5e8 --- /dev/null +++ b/application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php @@ -0,0 +1,94 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebShipsimuGovernmentTrainingCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public static final function createWebShipsimuGovernmentTrainingCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebShipsimuGovernmentTrainingCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); + + // Register the training + $wrapperInstance->registerTrainingByRequest($requestInstance); + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + * @todo Maybe we need some filters here? + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user auth filter (we don't need an update of the user here because it will be redirected) + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); + + // Check if government can pay training help + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter')); + + // Verify password + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); + + // Verify CAPTCHA code + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/companies/.htaccess b/application/shipsimu/main/companies/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/companies/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/companies/class_ShippingCompany.php b/application/shipsimu/main/companies/class_ShippingCompany.php new file mode 100644 index 0000000..de959b6 --- /dev/null +++ b/application/shipsimu/main/companies/class_ShippingCompany.php @@ -0,0 +1,666 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShippingCompany extends BaseSimulator implements Customer, ContractPartner { + /** + * Full name of this company + */ + private $companyName = "Namenlose Reederei"; + + /** + * Shorted name of this company + */ + private $shortName = ""; + + /** + * Instance of the founder + */ + private $founderInstance = null; + + /** + * Headquarter harbor instance + */ + private $hqInstance = null; + + /** + * Employed people by this company + */ + private $employeeList = null; + + /** + * List of all assigned shipyards + */ + private $shipyardList = null; + + /** + * List of owned ships + */ + private $ownedShips = null; + + /** + * Work constracts this company is currently working on + */ + private $contractList = null; + + // Exception constants + const EXCEPTION_USER_OWNS_NO_COMPANY = 0x200; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this company class or throws an exception if the + * given user owns no company. + * + * @param $userInstance A user class + * @return $companyInstance Prepared company instance + * @todo Add functionality if user participates in a company + */ + public static final function createShippingCompany (ManageableAccount $userInstance) { + // Get new instance + $companyInstance = new ShippingCompany(); + + // Does the given user owns a company? + if ($companyInstance->ifUserParticipatesInCompany($userInstance)) { + // Then do some nasty caching here but don't throw an exception + // because then you will hurt our web helpers... :/ + $companyInstance->partialStub("Don't throw exceptions here."); + } // END - if + + // Init all lists + $companyInstance->initCompanyLists(); + + // Return instance + return $companyInstance; + } + + /** + * Checks wether the given user participates in a company + * + * @param $userInstance An instance of a user class + * @return $participates Wether the user participates at lease in one company + */ + protected function ifUserParticipatesInCompany (ManageableAccount $userInstance) { + // By default no user owns any company... ;) + $participates = false; + + // Get a company database wrapper class + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class', array($this)); + + // Ask the wrapper if this user participates + $participates = $wrapperInstance->ifUserParticipatesInCompany($userInstance); + + // Get the result instance + $resultInstance = $wrapperInstance->getResultInstance(); + + // Caches the result instance here, if set (we don't the wrapper anymore!) + if ($resultInstance instanceof SearchableResult) { + // Set the result instance + $this->setResultInstance($resultInstance); + } // END - if + + // Return result + return $participates; + } + + /** + * Checks wether the current user in registry is the company founder + * + * @return $isFounder Wether the current user is the company founder + * @todo Check if user is company founder + */ + public function ifUserIsFounder () { + // Default is not the founder + $isFounder = false; + + // Get result instance + $resultInstance = $this->getResultInstance(); + + // Is it set? + if ($resultInstance instanceof SearchableResult) { + // Result found so analyse it + $this->partialStub("Check if user is company founder."); + } // END - if + + // Return result + return $isFounder; + } + + /** + * Checks wether the current user in registry is the company owner + * + * @return $isOwner Wether the current user is the company owner + * @todo Check if user is company owner + */ + public function ifUserIsOwner () { + // Default is not the owner + $isOwner = false; + + // Get result instance + $resultInstance = $this->getResultInstance(); + + // Is it set? + if ($resultInstance instanceof SearchableResult) { + // Result found so analyse it + $this->partialStub("Check if user is company owner."); + } // END - if + + // Return result + return $isOwner; + } + + /** + * Checks wether the current user in registry is an employee in this company + * + * @return $isOwner Wether the current user is an employee in this company + */ + public function ifUserIsEmployee () { + // Default is no employee + $isEmployee = false; + + // Get result instance + $resultInstance = $this->getResultInstance(); + + // Is it set? + if ($resultInstance instanceof SearchableResult) { + // Result found so he is employee + $isEmployee = true; + } // END - if + + // Return result + return $isEmployee; + } + + //------------------------------------------------------------------------------\ + // Below here is very old code which needs to be translated and changed heavily | + //------------------------------------------------------------------------------/ + + /** + * Intialize all lists + * + * @return void + * @todo Maybe we don't need these big lists anymore?! So we can deprecate/remove it + */ + protected function initCompanyLists () { + // Employees + $this->employeeList = new FrameworkArrayObject("FakedEmployeeList"); + + // Ship yards + $this->shipyardList = new FrameworkArrayObject("FakedShipyardList"); + + // Contracts + $this->contractList = new FrameworkArrayObject("FakedContractList"); + } + + // Setter-Methode fuer Firmennamen + public final function setCompanyName ($companyName) { + $this->companyName = (string) $companyName; + } + + // Getter-Methode fuer Firmennamen + public final function getCompanyName () { + return $this->companyName; + } + + // Setter-Methode fuer Firmensitz + public final function setHQInstance (Harbor $hqInstance) { + $this->hqInstance = $hqInstance; + } + + // Kuerzel setzen + private function initShortName () { + // Mindestens eine Leerstelle? + $dummy = explode(" ", $this->getCompanyName()); + foreach ($dummy as $part) { + $this->shortName .= substr($part, 0, 1); + } // END - if + } + + // Reedereien Werften bauen lassen + public function createShipyardInHarbor($shipyardName, Harbor $harborInstance) { + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s baut im %s eine Werft %s.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $harborInstance->getHarborName(), + $shipyardName + )); + + // Wird im HQ gebaut? + if ($this->hqInstance->equals($harborInstance)) { + // Die neue Werft wird im HQ gebaut! + $this->hqInstance->addNewShipyardNotify($shipyardName, $this); + // Die Werft drueber in Kenntnis setzen, welcher Reederei sie angehoert + } else { + // Ausserhalb des Heimathafens soll eine Werft gebaut werden + $harborInstance->addNewShipyardNotify($shipyardName, $this); + } + } + + // Setter fuer Reederei-Gruender + public final function setCompanyFounder(CompanyEmployee $founderInstance) { + $this->founderInstance = $founderInstance; + } + + // Getter for founder instance + public final function getFounderInstance () { + return $this->founderInstance; + } + + // Neue(n) Angestellte(n) in Angestellten-Liste aufnehmen + public function addNewEmployee (SimulatorPersonell $employeeInstance) { + $this->employeeList->append($employeeInstance); + } + + // Neue Werft in Liste aufnehmen + public function addNewShipyard (Shipyard $shipyardInstance) { + $this->shipyardList->append($shipyardInstance); + } + + // Neue Mitarbeiter per Zufall einstellen/rekrutieren + public function recruitRandomEmployees($amount, SimulatorPersonell $personellInstance) { + // Anzahl Mitarbeiter absichern + $amount = (int) $amount; + + // Debug-Meldung ausgeben + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s stellt per Zufall %d neue Mitarbeiter ein.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $amount + )); + + // Gesamtanzahl verfuegbarer Erwerbsloser holen + $totalUnemployed = $personellInstance->getAllUnemployed(); + + // Existiert die gewuenschte Anzahl freier Arbeiter? (doppelt geht derzeit nicht) + if ($totalUnemployed < $amount) { + // Reichte nicht aus! + throw new ToMuchEmployeesException(array($amount, $personellInstance->getAllUnemployed()), self::EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES); + } // END - if + + // Get list for all unemployed people + $list = $personellInstance->getSpecialPersonellList(false); // Should be cached + + // Get iterator of the list + $iterator = $list->getIterator(); + + // Get the requested amount of personell + for ($idx = 0; $idx < $amount; $idx++) { + $employee = null; + // Is this personl unemployed? + while (is_null($employee) || $employee->isEmployed()) { + // Generate random number + $pos = mt_rand(0, ($totalUnemployed - 1)); // Don't remove the -1 here: + // E.g. 100 entries means latest position is 99... + + // Seek for the position + $iterator->seek($pos); + + // Is the current position valid? + if ($iterator->valid() === false) { + // Should normally not happen... :( + throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS); + } // END - if + + // Get current element + $employee = $iterator->current(); + } // END - while + + // A dummy just for the description and real class + $dummy = CompanyEmployee::createCompanyEmployee("", "", "M", 1970, 1, 1, $employee->isMarried(), 0); + + // Make this person employed and give him some money to work + $employee->setEmployed(true); + $employee->setRealClass($dummy->__toString()); + $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay? + + // Debug message + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s stellt den/die Angestellte(n) %s %s ein.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $employee->getSurname(), + $employee->getFamily() + )); + + // Add this employee + $this->addNewEmployee($employee); + } // End - for + + // Cache resetten + $personellInstance->resetCache(); + + // Debug-Meldung ausgeben + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat per Zufall %d neue Mitarbeiter eingestellt.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $amount + )); + } // End - method + + // Distribute all personells on all shipyards + public function distributeAllPersonellOnShipyards () { + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s verteilt alle ihre %d Mitarbeiter auf alle %d Werft(en).", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $this->getTotalEmployee(), + $this->getTotalShipyards() + )); + + // Do we have some shipyards? + if (is_null($this->shipyardList)) { + // No shipyards created + throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS); + } + + // Get iterator for shipyards + $shipyardIter = $this->shipyardList->getIterator(); + + // Iterate through all employees + for ($idx = $this->employeeList->getIterator(); $idx->valid(); $idx->next()) { + // Is the shipyard iterator still okay? + if ($shipyardIter->valid() === false) { + // Rewind to first position + $shipyardIter->seek(0); + } // END - if + + // Get Shipyard object + $shipyard = $shipyardIter->current(); + + // Is this a Shipyard object? + if (is_null($shipyard)) { + // No class returned + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($shipyard)) { + // Not an object! ;-( + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + } elseif ($shipyard->isClass("Shipyard") === false) { + // Nope, so throw exception + throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); + } + + // Add employee to the shipyard + $shipyard->addNewPersonell($idx->current()); + + // Continue to next shipyard + $shipyardIter->next(); + } + } + + // Getter for total employees + public final function getTotalEmployee () { + // Count all... + $total = $this->employeeList->count(); + + // Debug message + if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat %d Mitarbeiter.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $total + )); + + // Return amount + return $total; + } + + // Getter for total shipyards + public final function getTotalShipyards () { + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Für die Reederei %s werden die Anzahl der Werften in allen Häfen ermittelt.", + __CLASS__, + __LINE__, + $this->getCompanyName() + )); + + // Do we have some shipyards? + if (is_null($this->shipyardList)) { + // No shipyards created + throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS); + } + + // Get iterator + $total = $this->shipyardList->count(); + + // Debug message + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat %d Werft(en).", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $total + )); + + // Return amount + return $total; + } + + // Add a ship type (class) to all shipyards + public function addShipTypeToAllShipyards ($shipType) { + // Secure strings + $shipType = (string) $shipType; + + // Is the class there? + if (!class_exists($shipType)) { + // Throw exception + throw new NoClassException($shipType, self::EXCEPTION_CLASS_NOT_FOUND); + } + + // Create dummy ship + eval(sprintf("\$shipInstance = %s::create%s(\"M/S Dummy\");", + $shipType, + $shipType + )); + + // Iterate shipyard list + for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { + // Get current element + $shipyard = $idx->current(); + + // Is this a shipyard? + if (is_null($shipyard)) { + // Opps! Empty list? + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($shipyard)) { + // Not an object! ;-( + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + } elseif ($shipyard->isClass("Shipyard") === false) { + // Class is not a shipyard + throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); + } + + // Add the new ship type to the shipyard + $shipyard->addNewConstructableShipType($shipType); + } // END - for + } + + // Validate the requested ship type with the company if they can construct it + public function validateWorksContractShipType (SignableContract $contractInstance) { + // First get the ship type + $shipInstance = $contractInstance->getShipInstance(); + + // Ist there a ship instance? + if (is_null($shipInstance)) { + // Opps! Empty entry? + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($shipInstance)) { + // Not an object! ;-( + throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); + } + + // Get it's real class name + $shipType = $shipInstance->__toString(); + + // Now check if ship type is in any list and return the result + return ($this->isShipTypeConstructable($shipType)); + } + + // Is the ship type constructable? + public function isShipTypeConstructable ($shipType) { + // The type must be a string! + $shipType = (string) $shipType; + + // Debug message + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s fragt alle Werften ab, ob diese Schiffe vom Typ %s bauen können.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $shipType + )); + + // First everthing is failed... + $result = false; + + // Iterate through all shipyards + for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { + // Get current Shipyard instance + $shipyard = $idx->current(); + + // Is this a shipyard? + if (is_null($shipyard)) { + // Opps! Empty list? + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($shipyard)) { + // Not an object! ;-( + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + } elseif ($shipyard->isClass("Shipyard") === false) { + // Class is not a shipyard + throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); + } + + // Validate if first found shipyard can construct the requested type + $result = $shipyard->isShipTypeConstructable($shipType); + + // Does this shipyard construct the requested ship type? + if ($result) break; // Then abort the search! + } // END - for + + // Debug message + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s hat die Suche nach einer Werft beendet, die Schiffe vom Typ %s bauen kann.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $shipType + )); + + // Return result + return $result; + } + + // As a customer the shipping company can add new contracts + public function addNewWorksContract (SignableContract $contractInstance) { + $this->contractList->append($contractInstance); + } + + // As a customer the shippng company can withdraw from a contract + public function withdrawFromContract (SignableContract $contractInstance) { + ApplicationEntryPoint::app_die("WITHDRAW:
".print_r($contractInstance, true)."
"); + } + + // Get latest added contract instance + public final function getLastContractInstance () { + // Get iterator + $iter = $this->contractList->getIterator(); + + // Get latest entry (total - 1) + $iter->seek($iter->count() - 1); + + // Return entry + return $iter->current(); + } + + // Sign a contract with an other party which must also implement Customer + public function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance) { + // Check wether the other party is our contract partner + if ($partnerInstance->isContractPartner($contractInstance) === false) { + // Invalid contract partner! + throw new InvalidContractPartnerException($partnerInstance, self::EXCEPTION_CONTRACT_PARTNER_INVALID); + } // END - if + + // Determine if company "signs" own contract (must be done) or with an other party + if ($this->equals($partnerInstance)) { + // With itself + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s erteilt an sich selbst einen Bauauftrag für das %s "%s".", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $contractInstance->getShipInstance()->getObjectDescription(), + $contractInstance->getShipInstance()->getShipName() + )); + } else { + // Other external company + if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei %s unterzeichnet einen Bauauftrag für das %s "%s" mit der %s.", + __CLASS__, + __LINE__, + $this->getCompanyName(), + $contractInstance->getShipInstance()->getObjectDescription(), + $contractInstance->getShipInstance()->getShipName(), + $partnerInstance->getCompanyName() + )); + } + + // Sign the contract + $contractInstance->signContract($this, $partnerInstance); + + /** + * @todo Maybe do something more here... + */ + } + + // Is this the right contract partner? + public function isContractPartner (SignableContract $contractInstance) { + // Get contract partner instance and compare it with $this contract partner + return ($this->equals($contractInstance->getContractPartner())); + } + + // Setter for merchant instance + public final function setMerchantInstance (Merchant $merchantInstance) { + // Get contract + $contractInstance = $this->getLastContractInstance(); + + if (is_null($contractInstance)) { + // Opps! Empty contract instance? + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($contractInstance)) { + // Not an object! ;-( + throw new InvalidObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); + } elseif ($contractInstance->isClass("WorksContract") === false) { + // Is not a merchant + throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING); + } + + // Set the merchant in the contract (for getting prices) + $contractInstance->setMerchantInstance($merchantInstance); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/.htaccess b/application/shipsimu/main/constructions/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/berths/.htaccess b/application/shipsimu/main/constructions/berths/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/berths/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/berths/class_Berth.php b/application/shipsimu/main/constructions/berths/class_Berth.php new file mode 100644 index 0000000..c96ba10 --- /dev/null +++ b/application/shipsimu/main/constructions/berths/class_Berth.php @@ -0,0 +1,39 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Berth extends BaseConstruction { + // Durchlaufende Nummer der Liegeplaetze + private $berthIndex = 0; + + // Zugewiesener Hafen + private $harborInstance = null; + + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/class_BaseConstruction.php b/application/shipsimu/main/constructions/class_BaseConstruction.php new file mode 100644 index 0000000..af08a39 --- /dev/null +++ b/application/shipsimu/main/constructions/class_BaseConstruction.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseConstruction extends BaseSimulator { + // Tiefgang fuer z.B. Trockdocks + private $draught = 0; + + // Konstruktor + protected function __construct ($className) { + // Eltern-Konstrutor aufrufen + parent::__construct($className); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/docks/.htaccess b/application/shipsimu/main/constructions/docks/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/docks/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/docks/class_DryDock.php b/application/shipsimu/main/constructions/docks/class_DryDock.php new file mode 100644 index 0000000..c9d6f8e --- /dev/null +++ b/application/shipsimu/main/constructions/docks/class_DryDock.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class DryDock extends BaseConstruction { + // Zugewiesener Hafen + private $harborInstance = null; + + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/harbors/.htaccess b/application/shipsimu/main/constructions/harbors/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/harbors/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/harbors/class_Harbor.php b/application/shipsimu/main/constructions/harbors/class_Harbor.php new file mode 100644 index 0000000..cf350ce --- /dev/null +++ b/application/shipsimu/main/constructions/harbors/class_Harbor.php @@ -0,0 +1,87 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Harbor extends BaseConstruction { + // Namen des Hafens (z.B. Hamburger Hafen) + private $harborName = "Unbekannter Hafen"; + + // Schiffsliste aller gebauten Schiffe + private $constructedShips = null; + + // Liegeplatz-Liste + private $berthList = null; + + // List of all assigned shipyards + private $shipyardList = null; + + // Constructor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Creates a harbor + public static final function createHarbor ($harborName) { + // Hafen-Instanz holen + $harborInstance = new Harbor(); + + // Hafenname setzen + $harborInstance->setHarborName($harborName); + + // Werftliste initialisieren + $harborInstance->createshipyardList(); + + // Instanz zurueckliefern + return $harborInstance; + } + + // Werft-Liste generieren + public function createshipyardList () { + $this->shipyardList = new FrameworkArrayObject("FakedShipyardList"); + } + + // Setter fuer Hafennamen + public final function setHarborName ($harborName) { + $this->harborName = (string) $harborName; + } + + // Getter fuer Hafennamen + public final function getHarborName () { + return $this->harborName; + } + + // Werft in den Hafen einbauen und Werft->Reederei zuweisen + public function addNewShipyardNotify ($shipyardName, ShippingCompany $companyInstance) { + // Werft generieren und in die Werftliste aufnehmen + $this->shipyardList->append(Shipyard::createShipyardNotify($this, $shipyardName, $companyInstance)); + } + + // Werft in den Hafen einbauen ohne Zuweisung einer Reederei (gehoert der "Stadt" dann) + public function addNewShipyard ($shipyardName) { + // Werft generieren und in die Werftliste aufnehmen + $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName)); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/terminals/.htaccess b/application/shipsimu/main/constructions/terminals/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/terminals/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/terminals/class_Terminal.php b/application/shipsimu/main/constructions/terminals/class_Terminal.php new file mode 100644 index 0000000..9ae9985 --- /dev/null +++ b/application/shipsimu/main/constructions/terminals/class_Terminal.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Terminal extends BaseConstruction { + // Zugewiesener Hafen + private $harborInstance = null; + + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/constructions/yards/.htaccess b/application/shipsimu/main/constructions/yards/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/constructions/yards/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/constructions/yards/class_Shipyard.php b/application/shipsimu/main/constructions/yards/class_Shipyard.php new file mode 100644 index 0000000..1959f83 --- /dev/null +++ b/application/shipsimu/main/constructions/yards/class_Shipyard.php @@ -0,0 +1,215 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Shipyard extends BaseConstruction { + // Werft-Name + private $shipyardName = "Namenlose Werft"; + + // Arbeiter-Liste + private $staffList = null; + + // Queue-Liste fuer zu bauende Schiffe + private $queueList = null; + + // Aktuell im Bau befindliches Schiff + private $currShipInConst = null; + + // Liste konstruierbarer Schiffstypen + private $shipTypeList = null; + + // Zugewiesener Hafen + private $harborInstance = null; + + // Zugewiesene Reederei + private $shippingCompany = null; + + // Constructor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Staff-Liste/Schiffstyp-Liste erzeugen + $this->createStaffList(); + $this->createShipTypeList(); + } + + // Create a shipyard and notify it about it's owner + public static final function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) { + // Werft-Instanz holen + $shipyardInstance = self::createShipyard($harborInstance, $shipyardName); + + // Reederei der Werft zuweisen + $shipyardInstance->setCompanyInstance($companyInstance); + + // Die Reederei ueber ihre Werft informieren + $companyInstance->addNewShipyard($shipyardInstance); + + // Instanz zurueckgeben + return $shipyardInstance; + } + + // Create a shipyard, first we need to create a harbor + public static final function createShipyard (Harbor $harborInstance, $shipyardName) { + // Instanz temporaer holen + $shipyardInstance = new Shipyard(); + + // Debug message + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.", + __CLASS__, + __LINE__, + $shipyardName, + $harborInstance->getHarborName() + )); + + // Werft-Name setzen + $shipyardInstance->setShipyardName($shipyardName); + + // Hafen-Instanz setzen + $shipyardInstance->setHarborInstance($harborInstance); + + // Abmasse setzen in Meter + $shipyardInstance->setWidth(30); + $shipyardInstance->setHeight(30); + $shipyardInstance->setLength(100); + + // Clean up a little + $shipyardInstance->removeDraught(); + + // Debug-Meldung + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft %s wurde gebaut.", + __CLASS__, + __LINE__, + $shipyardName + )); + + // Instanz zurueckliefern + return $shipyardInstance; + } + + // Create staff list + private function createStaffList () { + $this->staffList = new FrameworkArrayObject("FakedStaffList"); + } + + // Create ship type list + private function createShipTypeList () { + $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList"); + } + + // Setter-Methode fuer Werft-Name + public final function setShipyardName ($shipyardName) { + $this->shipyardName = (string) $shipyardName; + } + + // Getter-Methode fuer Werft-Name + public final function getShipyardName () { + return $this->shipyardName; + } + + // Setter-Methode fuer Hafen-Instanz + public final function setHarborInstance (Harbor $harborInstance) { + $this->harborInstance = $harborInstance; + } + + // Getter-Methode fuer Hafen-Instanz + public final function getHarborInstance () { + return $this->harborInstance; + } + + // Setter fuer Reederei-Instanz + public final function setCompanyInstance (ShippingCompany $companyInstance) { + $this->shippingCompany = $companyInstance; + } + + // Getter fuer Reederei-Instanz + public final function getCompanyInstance () { + return $this->shippingCompany; + } + + // Add new personell + public function addNewPersonell ($personell) { + // Add to list + $this->staffList->append($personell); + } + + // Add a new ship type to our list + public function addNewConstructableShipType ($shipType) { + // This must be a string! + $shipType = (string) $shipType; + + // Debug message + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.", + __CLASS__, + __LINE__, + $this->getShipyardName(), + $shipType + )); + + // Add to list + $this->shipTypeList->append($shipType); + } + + // Is the specified ship type in our list? + public function isShipTypeConstructable ($shipType) { + // First we can't build this ship + $result = false; + + // This must be a string! + $shipType = (string) $shipType; + + // Debug message + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.", + __CLASS__, + __LINE__, + $this->getShipyardName(), + $shipType + )); + + // Iterate through all types + for ($idx = $this->shipTypeList->getIterator(); $idx->valid(); $idx->next()) { + // Get current ship type + $type = (string) $idx->current(); + + // Is both the same? + $result = ($type == $shipType); + + // Type is found? + if ($result) break; // Then abort the search! + } + + // Debug message + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.", + __CLASS__, + __LINE__, + $this->getShipyardName(), + $shipType + )); + + // Return result + return $result; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/controller/.htaccess b/application/shipsimu/main/controller/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/controller/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/controller/web/.htaccess b/application/shipsimu/main/controller/web/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/controller/web/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/controller/web/class_WebCompanyController.php b/application/shipsimu/main/controller/web/class_WebCompanyController.php new file mode 100644 index 0000000..c5f1e2d --- /dev/null +++ b/application/shipsimu/main/controller/web/class_WebCompanyController.php @@ -0,0 +1,106 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebCompanyController extends BaseController implements Controller { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $controllerInstance A prepared instance of this class + * @todo Add some filters to this controller + */ + public static final function createWebCompanyController (CommandResolver $resolverInstance) { + // Create the instance + $controllerInstance = new WebCompanyController(); + + // Set the command resolver + $controllerInstance->setResolverInstance($resolverInstance); + + // User auth filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // User update filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); + + // News fetcher filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); + + // News proccess/display-preparation + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); + + // Return the prepared instance + return $controllerInstance; + } + + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { + // Get the command instance from the resolver by sending a request instance to the resolver + $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); + + // Add more filters by the command + $commandInstance->addExtraFilters($this, $requestInstance); + + // Try to run the pre filters, if auth exceptions come through redirect here + try { + // Run the pre filters + $this->executePreFilters($requestInstance, $responseInstance); + } catch (UserAuthorizationException $e) { + // Redirect to main page + $responseInstance->redirectToConfiguredUrl('login_failed'); + + // Exit here + exit(); + } + + // This request was valid! :-D + $requestInstance->requestIsValid(); + + // Execute the command + $commandInstance->execute($requestInstance, $responseInstance); + + // Run the pre filters + $this->executePostFilters($requestInstance, $responseInstance); + + // Flush the response out + $responseInstance->flushBuffer(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php b/application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php new file mode 100644 index 0000000..c51bf1c --- /dev/null +++ b/application/shipsimu/main/controller/web/class_WebGovernmentFailedController.php @@ -0,0 +1,106 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebGovernmentFailedController extends BaseController implements Controller { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $controllerInstance A prepared instance of this class + * @todo Add some filters to this controller + */ + public static final function createWebGovernmentFailedController (CommandResolver $resolverInstance) { + // Create the instance + $controllerInstance = new WebGovernmentFailedController(); + + // Set the command resolver + $controllerInstance->setResolverInstance($resolverInstance); + + // User auth filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); + + // User update filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); + + // News fetcher filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); + + // News proccess/display-preparation + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); + + // Return the prepared instance + return $controllerInstance; + } + + /** + * Handles the given request and response + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { + // Get the command instance from the resolver by sending a request instance to the resolver + $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); + + // Add more filters by the command + $commandInstance->addExtraFilters($this, $requestInstance); + + // Try to run the pre filters, if auth exceptions come through redirect here + try { + // Run the pre filters + $this->executePreFilters($requestInstance, $responseInstance); + } catch (UserAuthorizationException $e) { + // Redirect to main page + $responseInstance->redirectToConfiguredUrl('login_failed'); + + // Exit here + exit(); + } + + // This request was valid! :-D + $requestInstance->requestIsValid(); + + // Execute the command + $commandInstance->execute($requestInstance, $responseInstance); + + // Run the pre filters + $this->executePostFilters($requestInstance, $responseInstance); + + // Flush the response out + $responseInstance->flushBuffer(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/drives/.htaccess b/application/shipsimu/main/drives/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/drives/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/drives/class_BaseDrive.php b/application/shipsimu/main/drives/class_BaseDrive.php new file mode 100644 index 0000000..56f9802 --- /dev/null +++ b/application/shipsimu/main/drives/class_BaseDrive.php @@ -0,0 +1,64 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseDrive extends BaseSimulator { + // Price of this drive + private $price = 0.00; + // PS-Zahl + private $horsePower = 0; + // Anzahl Nocken + private $numCams = 0; + + // Konstruktor + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Setter-Methode fuert PS-Zahl + public final function setHorsePower ($hp) { + $this->horsePower = (int) $hp; + } + + // Setter-Methode fuer Nockenanzahl + public final function setNumCams ($cams) { + $this->numCams = (int) $cams; + } + + // Setter for price + public final function setPrice ($price) { + $this->price = (float) $price; + } + + // Getter for price + public final function getPrice () { + return $this->price; + } + + public final function removePrice () { + unset($this->price); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/drives/motor/.htaccess b/application/shipsimu/main/drives/motor/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/drives/motor/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/drives/motor/class_Motor.php b/application/shipsimu/main/drives/motor/class_Motor.php new file mode 100644 index 0000000..2f3479e --- /dev/null +++ b/application/shipsimu/main/drives/motor/class_Motor.php @@ -0,0 +1,56 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart { + // Constructor + protected function __construct() { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Einen Motor erstellen + public static final function createMotor ($descr, $hp, $cams, $w, $h, $l) { + // Get new instance + $motorInstance = new Motor(); + + // Beschreibung und Abmasse setzen + $motorInstance->setWidth($w); + $motorInstance->setHeight($h); + $motorInstance->setLength($l); + + // Weitere Daten setzen + $motorInstance->setHorsePower($hp); + $motorInstance->setNumCams($cams); + + // Instanz zurueckgeben + return $motorInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/factories/.htaccess b/application/shipsimu/main/factories/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/factories/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/factories/class_ShipSimuWebNewsFactory.php b/application/shipsimu/main/factories/class_ShipSimuWebNewsFactory.php new file mode 100644 index 0000000..e42b021 --- /dev/null +++ b/application/shipsimu/main/factories/class_ShipSimuWebNewsFactory.php @@ -0,0 +1,60 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuWebNewsFactory extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $factoryInstance An instance of this class + */ + public static final function createShipSimuWebNewsFactory () { + // Get a new instance + $factoryInstance = new ShipSimuWebNewsFactory(); + + // Return the prepared instance + return $factoryInstance; + } + + /** + * Create the news object itself here depending on the request + * + * @param $requestInstance An instance of a request class + * @return $newsInstance An instance of a news class + */ + public function createNewObject (Requestable $requestInstance) { + // Do some stuff here + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/.htaccess b/application/shipsimu/main/filter/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/book/.htaccess b/application/shipsimu/main/filter/book/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/book/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/book/refill/.htaccess b/application/shipsimu/main/filter/book/refill/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/book/refill/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php b/application/shipsimu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php new file mode 100644 index 0000000..b7ff113 --- /dev/null +++ b/application/shipsimu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php @@ -0,0 +1,72 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class RefillRequestCurrencyTestBookFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createRefillRequestCurrencyTestBookFilter () { + // Get a new instance + $filterInstance = new RefillRequestCurrencyTestBookFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Add code being executed in this filter + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Get the user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Run the update + $userInstance->bookAmountDirectly($requestInstance); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/class_ b/application/shipsimu/main/filter/class_ new file mode 100644 index 0000000..20653ff --- /dev/null +++ b/application/shipsimu/main/filter/class_ @@ -0,0 +1,65 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Filter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function create???Filter () { + // Get a new instance + $filterInstance = new ???Filter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Add code being executed in this filter + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + $this->partialStub("Add code here for your specific filter."); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/class_BaseShipSimuFilter.php b/application/shipsimu/main/filter/class_BaseShipSimuFilter.php new file mode 100644 index 0000000..7a80cf2 --- /dev/null +++ b/application/shipsimu/main/filter/class_BaseShipSimuFilter.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseShipSimuFilter extends BaseFilter { + /** + * Protected constructor + * + * @param $className Name of the filter class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Add something to do on every filter + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Add something to do on every filter + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/government/.htaccess b/application/shipsimu/main/filter/government/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/government/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php b/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php new file mode 100644 index 0000000..7becf12 --- /dev/null +++ b/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php @@ -0,0 +1,78 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuGovernmentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createShipSimuGovernmentPaysStartupHelpFilter () { + // Get a new instance + $filterInstance = new ShipSimuGovernmentPaysStartupHelpFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Get the user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Now simply check for it + if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysStartupHelp() === false)) { + // Request is invalid + $requestInstance->requestIsValid(false); + + // Redirect to configured URL + $responseInstance->redirectToConfiguredUrl('login_government_startup_failed'); + + // Stop processing here + exit(); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php b/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php new file mode 100644 index 0000000..75eb1cc --- /dev/null +++ b/application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php @@ -0,0 +1,78 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuGovernmentPaysTrainingFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createShipSimuGovernmentPaysTrainingFilter () { + // Get a new instance + $filterInstance = new ShipSimuGovernmentPaysTrainingFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo 0% done + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Get the user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Now simply check for it + if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysTraining() === false)) { + // Request is invalid + $requestInstance->requestIsValid(false); + + // Redirect to configured URL + $responseInstance->redirectToConfiguredUrl('login_government_training_failed'); + + // Stop processing here + exit(); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/page/.htaccess b/application/shipsimu/main/filter/page/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/page/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/page/class_RefillPageFilter.php b/application/shipsimu/main/filter/page/class_RefillPageFilter.php new file mode 100644 index 0000000..d4680ba --- /dev/null +++ b/application/shipsimu/main/filter/page/class_RefillPageFilter.php @@ -0,0 +1,75 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class RefillPageFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createRefillPageFilter () { + // Get a new instance + $filterInstance = new RefillPageFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @throws FilterChainException If this filter fails to operate + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Is the configuration variable set? + if ($this->getConfigInstance()->getConfigEntry('refill_page_active') === "N") { + // Password is empty + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('refill_page_not_active'); + + // Abort here + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/validator/.htaccess b/application/shipsimu/main/filter/validator/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/validator/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/validator/class_RefillRequestValidatorFilter.php b/application/shipsimu/main/filter/validator/class_RefillRequestValidatorFilter.php new file mode 100644 index 0000000..3abd7ba --- /dev/null +++ b/application/shipsimu/main/filter/validator/class_RefillRequestValidatorFilter.php @@ -0,0 +1,76 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createRefillRequestValidatorFilter () { + // Get a new instance + $filterInstance = new RefillRequestValidatorFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe we need to added some more generic tests on the request here? + * @throws FilterChainException If this filter fails to operate + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Are all required request fields set? + if (($requestInstance->isRequestElementSet('type') === false) || ($requestInstance->isRequestElementSet('amount') === false)) { + // Something important is missing + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('refill_page_required_fields_missing'); + + // Abort here + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php b/application/shipsimu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php new file mode 100644 index 0000000..989e1d4 --- /dev/null +++ b/application/shipsimu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php @@ -0,0 +1,79 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuUserStatusGuestFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createShipSimuUserStatusGuestFilter () { + // Get a new instance + $filterInstance = new ShipSimuUserStatusGuestFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe we need to added some more generic tests on the request here? + * @throws FilterChainException If this filter fails to operate + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Get a user instance for comparison + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Is the user account confirmed? + if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == $this->getConfigInstance()->getConfigEntry('user_status_guest')) { + // Request is invalid! + $requestInstance->requestIsValid(false); + + // Redirect to configured URL + $responseInstance->redirectToConfiguredUrl('login_user_status_guest'); + + // Stop processing here + exit(); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/filter/verifier/.htaccess b/application/shipsimu/main/filter/verifier/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/filter/verifier/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/filter/verifier/class_BirthdayVerifierFilter.php b/application/shipsimu/main/filter/verifier/class_BirthdayVerifierFilter.php new file mode 100644 index 0000000..51bb4db --- /dev/null +++ b/application/shipsimu/main/filter/verifier/class_BirthdayVerifierFilter.php @@ -0,0 +1,117 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BirthdayVerifierFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public static final function createBirthdayVerifierFilter () { + // Get a new instance + $filterInstance = new BirthdayVerifierFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + // Day of birth set? + if (!$requestInstance->isRequestElementSet('birth_day')) { + // Day of birth isn't set + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('day_of_birth_unset'); + } // END - if + + // Month of birth set? + if (!$requestInstance->isRequestElementSet('birth_month')) { + // Month of birth isn't set + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('month_of_birth_unset'); + } // END - if + + // Year of birth set? + if (!$requestInstance->isRequestElementSet('birth_year')) { + // Year of birth isn't set + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('year_of_birth_unset'); + } // END - if + + // Is the request still valid? + if (!$requestInstance->isRequestValid()) { + // Abort here + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); + } // END - if + + // Now comes the final check + $birthCheck = mktime( + 0, + 0, + 0, + $requestInstance->getRequestElement('birth_day'), + $requestInstance->getRequestElement('birth_month'), + $requestInstance->getRequestElement('birth_year') + ); + + // Is there a number or such? (we don't care about the value itself here) + if (empty($birthCheck)) { + // Validation has failed + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('birthday_invalid'); + + // Abort here + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/government/.htaccess b/application/shipsimu/main/government/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/government/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/government/class_SimplifiedGovernment.php b/application/shipsimu/main/government/class_SimplifiedGovernment.php new file mode 100644 index 0000000..8999153 --- /dev/null +++ b/application/shipsimu/main/government/class_SimplifiedGovernment.php @@ -0,0 +1,137 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * @todo Find an interface for governments + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class SimplifiedGovernment extends BaseFrameworkSystem implements Registerable { + // Constants + const STATUS_STARTER_HELP = 'STARTER_HELP'; + const STATUS_TRAINING = 'TRAINING'; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this government class by given user instance + * + * @param $userInstance The user instance + * @return $governmentInstance Instance of the prepared government instance + */ + public static final function createSimplifiedGovernment (ManageableAccount $userInstance) { + // Get a new instance + $governmentInstance = new SimplifiedGovernment(); + + // Set the user instance + $governmentInstance->setUserInstance($userInstance); + + // Return the prepared instance + return $governmentInstance; + } + + /** + * Checks wether the government has already payed a training course for te + * current user + * + * @return $alreadyPayed Wether the government has already payed + * @todo Needs do check training limit + */ + public function ifGovernmentAlreadyPayedTraining () { + // Default is not payed + $alreadyPayed = false; + + // Cache startup training limit + $trainingLimit = $this->getConfigInstance()->getConfigEntry('government_training_limit'); + + // Now get a search criteria and set the user's name as criteria + $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_USERID , $this->getUserInstance()->getUserId()); + $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_ACTIVITY, self::STATUS_TRAINING); + $searchInstance->setLimit(1); + + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); + + // Get result back + $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance); + + // Was the query fine? + if ($resultInstance->next()) { + // Get entry + $currEntry = $resultInstance->current(); + + // Entry was found so the government can no more pay a training + $alreadyPayed = true; + } // END - if + + // Return the result + return $alreadyPayed; + } + + /** + * Checks wether the government has payed maximum of startup helps to the + * current user + * + * @return $maximumPayed Wether the government has already payed + * @todo Needs do check help limit + */ + public function ifGovernmentPayedMaxmimumStartupHelp () { + // Default is not payed + $maximumPayed = false; + + // Cache startup help limit + $helpLimit = $this->getConfigInstance()->getConfigEntry('government_startup_help_limit'); + + // Now get a search criteria and set the user's name as criteria + $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_USERID , $this->getUserInstance()->getUserId()); + $searchInstance->addCriteria(UserGovernmentDatabaseWrapper::DB_COLUMN_GOV_ACTIVITY, self::STATUS_STARTER_HELP); + $searchInstance->setLimit($helpLimit); + + // Get a wrapper instance + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class'); + + // Get result back + $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance); + + // Was the query fine? + if ($resultInstance->next()) { + // Get entry + $currEntry = $resultInstance->current(); + + // Entry found, so lets have a look if this government wants to again... + $maximumPayed = true; + } // END - if + + // Return the result + return $maximumPayed; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/login/.htaccess b/application/shipsimu/main/login/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/login/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/login/class_ShipSimuGuestLogin.php b/application/shipsimu/main/login/class_ShipSimuGuestLogin.php new file mode 100644 index 0000000..16f76ed --- /dev/null +++ b/application/shipsimu/main/login/class_ShipSimuGuestLogin.php @@ -0,0 +1,152 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser { + /** + * The hashed password + */ + private $hashedPassword = ''; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this login class + * + * @return $loginInstance An instance of this login class + */ + public static final function createShipSimuGuestLogin () { + // Get a new instance + $loginInstance = new ShipSimuGuestLogin(); + + // Return the instance + return $loginInstance; + } + + /** + * Logins the user with the given request containing the credential. The + * result of the login can be thrown by exception or, if prefered stored + * in a boolean attribute which is then readable by a matching getter. + * + * @param $requestInstance An instance of a Requestable class + * @param $responseInstance An instance of a Responseable class + * @return void + * @throws UserAuthMethodException If wether username nor email login + * was detected + * @throws MissingMethodException If a method was not found in the + * User class + * @throws UserPasswordMismatchException If the supplied password did not + * match with the stored password + */ + public function doLogin (Requestable $requestInstance, Responseable $responseInstance) { + // By default no method is selected + $method = null; + $data = ""; + + // Detect login method (username or email) and try to get a userinstance + if (!is_null($requestInstance->getRequestElement('user'))) { + // Username found! + $method = 'createGuestByUsername'; + $data = $requestInstance->getRequestElement('user'); + } // END - if + + // Is a method detected? + if (is_null($method)) { + // Then abort here + throw new UserAuthMethodException($this, self::EXCEPTION_MISSING_METHOD); + } elseif (!method_exists($this->getConfigInstance()->getConfigEntry('guest_class'), $method)) { + // The method is invalid! + throw new MissingMethodException(array($this, $method), self::EXCEPTION_MISSING_METHOD); + } + + // Get a user instance + $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), $method), array($data)); + + // Remember this new instance in registry + Registry::getRegistry()->addInstance('user', $userInstance); + + // Is the password correct? + if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { + // Mismatching password + throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); + } // END - if + + // Now do the real login. This can be cookie- or session-based login + // which depends on the admins setting then on the user's taste. + // 1) Get a login helper instance + $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance)); + + // 2) Execute the login. This will now login... + $helperInstance->executeLogin($responseInstance); + } + + /** + * Determines wether the login was fine. This is done by checking if 'login' instance is in registry + * + * @return $loginDone Wether the login was fine or not + */ + public function ifLoginWasSuccessfull () { + // Is the registry key there? + $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); + + // Return the result + return $loginDone; + } + + /** + * Encrypt given request key or throw an exception if key was not found in + * request + * + * @param $requestKey Key in request class + * @return void + */ + public function encryptPassword ($requestKey) { + // Check if password is found in request + if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { + // So encrypt the password and store it for later usage in + // the request: + + // Get the plain password + $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + + // Get user instance + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Get a crypto helper and hash the password + $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); + + // Store the hash back in request + $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/login/class_ShipSimuUserLogin.php b/application/shipsimu/main/login/class_ShipSimuUserLogin.php new file mode 100644 index 0000000..cf43ef0 --- /dev/null +++ b/application/shipsimu/main/login/class_ShipSimuUserLogin.php @@ -0,0 +1,140 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { + /** + * The hashed password + */ + private $hashedPassword = ''; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this login class + * + * @return $loginInstance An instance of this login class + */ + public static final function createShipSimuUserLogin () { + // Get a new instance + $loginInstance = new ShipSimuUserLogin(); + + // Return the instance + return $loginInstance; + } + + /** + * Logins the user with the given request containing the credential. The + * result of the login can be thrown by exception or, if prefered stored + * in a boolean attribute which is then readable by a matching getter. + * + * @param $requestInstance An instance of a Requestable class + * @param $responseInstance An instance of a Responseable class + * @return void + * @throws UserPasswordMismatchException If the supplied password did not + * match with the stored password + * @todo We need to add something here which will make more than one + * @todo guest logins, users who are online but based on the same + * @todo user account. + */ + public function doLogin (Requestable $requestInstance, Responseable $responseInstance) { + // By default no method is selected + $method = null; + $data = ""; + + // Get member class + $userClass = $this->getConfigInstance()->getConfigEntry('user_class'); + + // Get a user instance + $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance)); + + // Remember this new instance in registry + Registry::getRegistry()->addInstance('user', $userInstance); + + // Is the password correct? + if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { + // Mismatching password + throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); + } // END - if + + // ToDo place + + // Now do the real login. This can be cookie- or session-based login + // which depends on the admins setting then on the user's taste. + // 1) Get a login helper instance + $helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper_class', array($requestInstance)); + + // 2) Execute the login. This will now login... + $helperInstance->executeLogin($responseInstance); + } + + /** + * Determines wether the login was fine. This is done by checking if 'login' instance is in registry + * + * @return $loginDone Wether the login was fine or not + */ + public function ifLoginWasSuccessfull () { + // Is the registry key there? + $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable); + + // Return the result + return $loginDone; + } + + /** + * Encrypt given request key or throw an exception if key was not found in + * request + * + * @param $requestKey Key in request class + * @return void + */ + public function encryptPassword ($requestKey) { + // Check if password is found in request + if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { + // So encrypt the password and store it for later usage in + // the request: + + // Get the plain password + $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + + // Get user instance + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Get a crypto helper and hash the password + $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword, $userInstance->getPasswordHash()); + + // Store the hash back in request + $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/login/helper/.htaccess b/application/shipsimu/main/login/helper/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/login/helper/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/login/helper/class_ShipSimuLoginHelper.php b/application/shipsimu/main/login/helper/class_ShipSimuLoginHelper.php new file mode 100644 index 0000000..b5c125e --- /dev/null +++ b/application/shipsimu/main/login/helper/class_ShipSimuLoginHelper.php @@ -0,0 +1,114 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin { + /** + * The login method we shall choose + */ + private $authMethod = ""; + + // Exception constants + const EXCEPTION_INVALID_USER_INSTANCE = 0x190; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class by given request instance + * + * @param $requestInstance An instance of a Requestable class + * @return $helperInstance An instance of this helper class + * @throws UserInstanceMissingException If the user instance in registry + * is missing or invalid + */ + public static final function createShipSimuLoginHelper (Requestable $requestInstance) { + // Get a new instance first + $helperInstance = new ShipSimuLoginHelper(); + + // Get a user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Is this instance valid? + if (!$userInstance instanceof ManageableAccount) { + // Thrown an exception here + throw new UserInstanceMissingException (array($helperInstance, 'user'), self::EXCEPTION_INVALID_USER_INSTANCE); + } // END - if + + // Set default login method from config + $helperInstance->setDefaultAuthMethod(); + + // Set request instance + $helperInstance->setRequestInstance($requestInstance); + + // Return the prepared instance + return $helperInstance; + } + + /** + * Setter for default login method from config + * + * @return void + */ + protected function setDefaultAuthMethod () { + $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class'); + } + + /** + * Execute the login request by given response instance. This instance can + * be used for sending cookies or at least the session id out. + * + * @param $responseInstance An instance of a Responseable class + * @return void + */ + public function executeLogin (Responseable $responseInstance) { + // Get an instance from the login method + $loginInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance)); + + // Set user cookie + $loginInstance->setUserAuth($this->getRequestInstance()->getRequestElement('username')); + + // Set password cookie + $loginInstance->setPasswordAuth($this->getRequestInstance()->getRequestElement('pass_hash')); + + // Remember this login instance for later usage + Registry::getRegistry()->addInstance('login', $loginInstance); + } +} + +// +?> diff --git a/application/shipsimu/main/menu/.htaccess b/application/shipsimu/main/menu/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/menu/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/menu/class_ShipSimu b/application/shipsimu/main/menu/class_ShipSimu new file mode 100644 index 0000000..93970de --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimu @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimu???Menu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public final static function createShipSimu???Menu () { + // Get a new instance + $menuInstance = new ShipSimu???Menu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuConfirmMenu.php b/application/shipsimu/main/menu/class_ShipSimuConfirmMenu.php new file mode 100644 index 0000000..1dc56b7 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuConfirmMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuConfirmMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuConfirmMenu () { + // Get a new instance + $menuInstance = new ShipSimuConfirmMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuHomeMenu.php b/application/shipsimu/main/menu/class_ShipSimuHomeMenu.php new file mode 100644 index 0000000..ef01389 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuHomeMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuHomeMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuHomeMenu () { + // Get a new instance + $menuInstance = new ShipSimuHomeMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuLoginAreaMenu.php b/application/shipsimu/main/menu/class_ShipSimuLoginAreaMenu.php new file mode 100644 index 0000000..038b123 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuLoginAreaMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLoginAreaMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuLoginAreaMenu () { + // Get a new instance + $menuInstance = new ShipSimuLoginAreaMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuLoginFailedMenu.php b/application/shipsimu/main/menu/class_ShipSimuLoginFailedMenu.php new file mode 100644 index 0000000..6978654 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuLoginFailedMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLoginFailedMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuLoginFailedMenu () { + // Get a new instance + $menuInstance = new ShipSimuLoginFailedMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuLoginMenu.php b/application/shipsimu/main/menu/class_ShipSimuLoginMenu.php new file mode 100644 index 0000000..7aa83e9 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuLoginMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLoginMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuLoginMenu () { + // Get a new instance + $menuInstance = new ShipSimuLoginMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuLogoutMenu.php b/application/shipsimu/main/menu/class_ShipSimuLogoutMenu.php new file mode 100644 index 0000000..76b6c68 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuLogoutMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuLogoutMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuLogoutMenu () { + // Get a new instance + $menuInstance = new ShipSimuLogoutMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuRegisterMenu.php b/application/shipsimu/main/menu/class_ShipSimuRegisterMenu.php new file mode 100644 index 0000000..d2438f2 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuRegisterMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuRegisterMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuRegisterMenu () { + // Get a new instance + $menuInstance = new ShipSimuRegisterMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/class_ShipSimuStatusMenu.php b/application/shipsimu/main/menu/class_ShipSimuStatusMenu.php new file mode 100644 index 0000000..fbc0434 --- /dev/null +++ b/application/shipsimu/main/menu/class_ShipSimuStatusMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuStatusMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuStatusMenu () { + // Get a new instance + $menuInstance = new ShipSimuStatusMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/menu/government/.htaccess b/application/shipsimu/main/menu/government/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/menu/government/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php b/application/shipsimu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php new file mode 100644 index 0000000..0d2112c --- /dev/null +++ b/application/shipsimu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuGovernmentFailedAreaMenu extends BaseMenu implements RenderableMenu { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $menuInstance An instance of this class + */ + public static final function createShipSimuGovernmentFailedAreaMenu () { + // Get a new instance + $menuInstance = new ShipSimuGovernmentFailedAreaMenu(); + + // Return the prepared instance + return $menuInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/opening/.htaccess b/application/shipsimu/main/opening/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/opening/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/opening/bank/.htaccess b/application/shipsimu/main/opening/bank/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/opening/bank/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/opening/bank/class_MoneyBankRealtimeOpening.php b/application/shipsimu/main/opening/bank/class_MoneyBankRealtimeOpening.php new file mode 100644 index 0000000..5136767 --- /dev/null +++ b/application/shipsimu/main/opening/bank/class_MoneyBankRealtimeOpening.php @@ -0,0 +1,63 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MoneyBankRealtimeOpening extends BaseOpening { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this opening time class + * + * @param $bankInstance An instance of a money bank + * @return $openeningInstance An instance of this class + */ + public static final function createMoneyBankRealtimeOpening (BaseBank $bankInstance) { + // Get a new instance + $openingInstance = new MoneyBankRealtimeOpening(); + + // Set the bank instance here + $openingInstance->setBankInstance($bankInstance); + + // Return the prepared instance + return $openingInstance; + } + + /** + * Checks wether we are within the opening times + * + * @return $withinOpeningTimes Wether we are within opening times + */ + public function ifWithinOpeningTimes () { + $this->partialStub(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/opening/class_ b/application/shipsimu/main/opening/class_ new file mode 100644 index 0000000..b9f1ce7 --- /dev/null +++ b/application/shipsimu/main/opening/class_ @@ -0,0 +1,50 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Opening extends BaseOpening { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this opening time class + * + * @return $openeningInstance An instance of this class + */ + public final static function create???Opening () { + // Get a new instance + $openeningInstance = new ???Opening(); + + // Return the prepared instance + return $openeningInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/opening/class_BaseOpening.php b/application/shipsimu/main/opening/class_BaseOpening.php new file mode 100644 index 0000000..78f8983 --- /dev/null +++ b/application/shipsimu/main/opening/class_BaseOpening.php @@ -0,0 +1,60 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +abstract class BaseOpening extends BaseFrameworkSystem { + /** + * A bank instance + */ + private $bankInstance = null; + + /** + * Protected constructor + * + * @param $className The class' real name + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Setter for bank instance + * + * @param $bankInstance An instance of a bank + * @return void + */ + protected final function setBankInstance (BaseBank $bankInstance) { + $this->bankInstance = $bankInstance; + } + + /** + * Checks wether we are within the opening times + * + * @return $withinOpeningTimes Wether we are within opening times + */ + public abstract function ifWithinOpeningTimes (); +} + +// [EOF] +?> diff --git a/application/shipsimu/main/parts/.htaccess b/application/shipsimu/main/parts/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/parts/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/parts/class_BaseShipPart.php b/application/shipsimu/main/parts/class_BaseShipPart.php new file mode 100644 index 0000000..aca83a9 --- /dev/null +++ b/application/shipsimu/main/parts/class_BaseShipPart.php @@ -0,0 +1,51 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseShipPart extends BaseSimulator { + // Price of this ship part + private $price = 0.00; + + // Konstruktor + protected function __construct($className) { + // Call parent constructor + parent::__construct($className); + } + + // Setter for price + public final function setPrice ($price) { + $this->price = (float) $price; + } + + // Getter for price + public final function getPrice () { + return $this->price; + } + + // Remove price + public final function removePrice () { + unset($this->price); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/parts/maschineroom/.htaccess b/application/shipsimu/main/parts/maschineroom/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/parts/maschineroom/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/parts/maschineroom/class_MaschineRoom.php b/application/shipsimu/main/parts/maschineroom/class_MaschineRoom.php new file mode 100644 index 0000000..bcd7b30 --- /dev/null +++ b/application/shipsimu/main/parts/maschineroom/class_MaschineRoom.php @@ -0,0 +1,47 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MaschineRoom extends BaseShipPart { + // Constructor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Maschinenraum erstellen + public static final function createMaschineRoom () { + // Get new instance + $roomInstance = new MaschineRoom(); + + // Umrechnungsfaktoren setzen + $roomInstance->setResizeFactorElement('width' , 1.3); + $roomInstance->setResizeFactorElement('height', 1.8); + $roomInstance->setResizeFactorElement('length', 1.3); + + // Instanz zurueckgeben + return $roomInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/personell/.htaccess b/application/shipsimu/main/personell/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/personell/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/personell/class_SimulatorPersonell.php b/application/shipsimu/main/personell/class_SimulatorPersonell.php new file mode 100644 index 0000000..8ff01e7 --- /dev/null +++ b/application/shipsimu/main/personell/class_SimulatorPersonell.php @@ -0,0 +1,327 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class SimulatorPersonell extends BasePersonell { + // Personell list + private $personellList = null; + + // A cache for lists + private $cacheList = null; + + // A string for cached conditions + private $cacheCond = null; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Magic wake-up method called when unserialize() is called. This is + * neccessary because in this case a personell does not need to know the + * min/max ages range and system classes. This would anyway use more RAM + * what is not required. + * + * @return void + */ + public function __wakeup () { + // Tidy up a little + $this->removePersonellList(); + $this->removeMinMaxAge(); + $this->removeCache(); + } + + /** + * Generate a specified amount of personell and return the prepared instance + * + * @param $amountPersonell Number of personell we shall + * generate + * @return $personellInstance An instance of this object with a + * list of personells + */ + public static final function createSimulatorPersonell ($amountPersonell) { + // Make sure only integer can pass + $amountPersonell = (int) $amountPersonell; + + // Get a new instance + $personellInstance = new SimulatorPersonell(); + + // Debug message + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->debugOutput(sprintf("[%s:%d] Es werden %d Personal bereitgestellt.", + __CLASS__, + __LINE__, + $amountPersonell + )); + + // Initialize the personell list + $personellInstance->createPersonellList(); + + // Create requested amount of personell + for ($idx = 0; $idx < $amountPersonell; $idx++) { + $personellInstance->addRandomPersonell(); + } + + // Debug message + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->debugOutput(sprintf("[%s:%d] %d Personal bereitgestellt.", + __CLASS__, + __LINE__, + $amountPersonell + )); + + // Tidy up a little + $personellInstance->removeGender(); + $personellInstance->removeNames(); + $personellInstance->removeBirthday(); + $personellInstance->removeSalary(); + $personellInstance->removeEmployed(); + $personellInstance->removeMarried(); + //$personellInstance->removeCache(); + + // Instanz zurueckgeben + return $personellInstance; + } + + /** + * Create a SimulatorPersonell object by loading the specified personell + * list from an existing database backend + * + * @param $idNumber The ID number (only right part) of the list + * @return $personellInstance An instance of this class + * @throws InvalidIDFormatException If the given id number + * $idNumber is invalid + * @throws MissingSimulatorIdException If an ID number was not found + * @deprecated + */ + public static final function createSimulatorPersonellByID ($idNumber) { + // Get instance + $personellInstance = new SimulatorPersonell(false); + $personellInstance->makeDeprecated(); + } + + // Create personell list + public function createPersonellList () { + // Is the list already created? + if ($this->personelllList instanceof FrameworkArrayObject) { + // Throw an exception + throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID); + } // END - if + + // Initialize the array + $this->personellList = new FrameworkArrayObject("FakedPersonellList"); + } + + // Remove the personell list + private final function removePersonellList () { + unset($this->personellList); + } + + // Add new personell object to our list + public function addRandomPersonell () { + // Gender list... + $genders = array("M", "F"); + + // Create new personell members + $personellInstance = new SimulatorPersonell(); + + // Set a randomized gender + $personellInstance->setGender($genders[mt_rand(0, 1)]); + + // Set a randomized birthday (maximum age required, see const MAX_AGE) + $personellInstance->createBirthday(); + + // Married? Same values means: married + if (mt_rand(0, 5) == mt_rand(0, 5)) $personellInstance->setMarried(true); + + // Tidy up a little + $personellInstance->removePersonellList(); + $personellInstance->removeMinMaxAge(); + $personellInstance->removeCache(); + + // Add new member to the list + $this->personellList->append($personellInstance); + } + + /** + * Get a specifyable list of our people, null or empty string will be ignored! + * + * @return $cacheList A list of cached personells + */ + function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = "") { + // Serialize the conditions for checking if we can take the cache + $serialized = serialize(array($isEmployed, $isMarried, $hasGender)); + + // The same (last) conditions? + if (($serialized == $this->cacheCond) && (!is_null($this->cacheCond))) { + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Gecachte Liste wird verwendet.", + __CLASS__, + __LINE__ + )); + + // Return cached list + return $this->cacheList; + } + + // Output debug message + if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Personalliste wird nach Kriterien durchsucht...", + __CLASS__, + __LINE__ + )); + + // Remember the conditions + $this->setCacheCond($serialized); + + // Create cached list + $this->setAllCacheList(new FrameworkArrayObject('FakedCacheList')); + + // Search all unemployed personells + for ($idx = $this->personellList->getIterator(); $idx->valid(); $idx->next()) { + // Element holen + $el = $idx->current(); + + // Check currenylt all single conditions (combined conditions are not yet supported) + if ((!is_null($isEmployed)) && ($el->isEmployed() == $isEmployed)) { + // Add this one (employed status asked) + $this->cacheList->append($el); + } elseif ((!is_null($isMarried)) && ($el->isMarried() == $isMarried)) { + // Add this one (marrital status asked) + $this->cacheList->append($el); + } elseif ((!empty($hasGender)) && ($el->getGender() == $hasGender)) { + // Add this one (specified gender) + $this->cacheList->append($el); + } + } + + // Return the completed list + return $this->cacheList; + } + + /** + * Get amount of unemployed personell + * + * @return $count Amount of unemployed personell + */ + public final function getAllUnemployed () { + // Get a temporary list + $list = $this->getSpecialPersonellList(false); + + // Anzahl zurueckliefern + return $list->count(); + } + + /** + * Remove cache things + * + * @return void + */ + private function removeCache () { + // Remove cache data + unset($this->cacheList); + unset($this->cacheCond); + } + + /** + * Setter for cache list + * + * @param $cacheList The new cache list to set or null for initialization/reset + * @return void + */ + private final function setAllCacheList (FrameworkArrayObject $cacheList = null) { + $this->cacheList = $cacheList; + } + + /** + * Setter for cache conditions + * + * @param $cacheCond The new cache conditions to set + * @return void + */ + private final function setCacheCond ($cacheCond) { + $this->cacheCond = (string) $cacheCond; + } + + /** + * Reset cache list + * + * @return void + */ + public function resetCache () { + $this->setAllCacheList(null); + $this->setCacheCond(""); + } + + /** + * Getter for surname. If no surname is set then default surnames are set + * for male and female personells. + * + * @return $surname The personell' surname + */ + public final function getSurname () { + $surname = parent::getSurname(); + + // Make sure every one has a surname... + if (empty($surname)) { + if ($this->isMale()) { + // Typical male name + $surname = "John"; + } else { + // Typical female name + $surname = "Jennifer"; + } + + // Set typical family name + parent::setFamily("Smith"); + } // END - if + + // Return surname + return $surname; + } + + /** + * Getter for personell list + * + * @return $personellList The list of all personells + */ + public final function getPersonellList () { + return $this->personellList; + } + + /** + * Loads the mostly pre-cached personell list + * + * @param $idNumber The ID number we shall use for looking up + * the right data. + * @return void + * @deprecated + */ + public function loadPersonellList ($idNumber) { + $this->makeDeprecated(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/personell/company/.htaccess b/application/shipsimu/main/personell/company/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/personell/company/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/personell/company/class_CompanyEmployee.php b/application/shipsimu/main/personell/company/class_CompanyEmployee.php new file mode 100644 index 0000000..472692e --- /dev/null +++ b/application/shipsimu/main/personell/company/class_CompanyEmployee.php @@ -0,0 +1,85 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class CompanyEmployee extends SimulatorPersonell { + // Employeee list + private $employeeList = null; + + // Constructor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Generate a specified amount of personell + public static final function createCompanyEmployee ($surname, $family, $gender, $year, $month, $day, $married, $salary) { + // Get instance + $personellInstance = new CompanyEmployee(); + + // Debug message + if (((defined('DEBUG_COMPANY_EMPLOYEE')) && (defined('DEBUG_PERSONELL'))) || (defined('DEBUG_ALL'))) { + $personellInstance->debugOutput(sprintf("[%s:%d] Der/Die Angestellte %s %s wird angelegt.", + __CLASS__, + __LINE__, + $surname, + $family + )); + } + + // Ist the given birthday valid? + if ($personellInstance->isDateValid($year, $month, $day) === false) { + // Something is wrong ... + throw new BirthdayInvalidException(array($year, $month, $day), self::EXCEPTION_BIRTH_DATE_IS_INVALID); + } // END - if + + // Set birthday + $personellInstance->setBirthday($year, $month, $day); + + // Set as employed/marrital status + $personellInstance->setEmployed(true); + $personellInstance->setMarried($married); + + // Set surname/family/gender + $personellInstance->setSurname($surname); + $personellInstance->setFamily($family); + $personellInstance->setGender($gender); + + // Set salary + $personellInstance->increaseSalary($salary); + + // Tidy up a little + $personellInstance->removeEmployeeList(); + $personellInstance->removeMinMaxAge(); + + // Return prepared instance + return $personellInstance; + } + + // Remove the employee list + private function removeEmployeeList () { + unset($this->employeeList); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/registration/.htaccess b/application/shipsimu/main/registration/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/registration/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/registration/class_ShipSimuRegistration.php b/application/shipsimu/main/registration/class_ShipSimuRegistration.php new file mode 100644 index 0000000..674d189 --- /dev/null +++ b/application/shipsimu/main/registration/class_ShipSimuRegistration.php @@ -0,0 +1,207 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuRegistration extends BaseRegistration implements UserRegister { + /** + * Hashed password + */ + private $hashedPassword = ''; + + /** + * Elements for criteria + */ + private $criteriaElements = array( + 'username', + 'pass_hash', + 'email' => 'email1', + 'surname', + 'family', + 'street', + 'zip', + 'city', + 'icq', + 'jabber', + 'yahoo', + 'aol', + 'msn', + 'birth_day', + 'birth_month', + 'birth_year' + ); + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Create a new instance + * + * @return $registrationInstance An instance of this registration class + */ + public static final function createShipSimuRegistration () { + // Get a new instance + $registrationInstance = new ShipSimuRegistration(); + + // Initialize the filter chains + $registrationInstance->initFilterChains(); + + // And return it + return $registrationInstance; + } + + /** + * Encrypt given request key or throw an exception if key was not found in + * request + * + * @param $requestKey Key in request class + * @return void + */ + public function encryptPassword ($requestKey) { + // Check if password is found in request + if ($this->getRequestInstance()->isRequestElementSet($requestKey)) { + // So encrypt the password and store it for later usage in + // the request: + + // 1.: Get the plain password + $plainPassword = $this->getRequestInstance()->getRequestElement($requestKey); + + // 2. Get a crypto helper and hash the password + $this->hashedPassword = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($plainPassword); + + // 3. Store the hash back in request + $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); + } + } + + /** + * Perform things like informing assigned affilates about new registration + * before registration + * + * @return void + * @todo Maybe add more things to perform + */ + public function doPreRegistration () { + // First run all pre filters + $this->executePreFilters(); + } + + /** + * Registers the new user account by insterting the request data into the + * database and paying some start credits or throw exceptions if this fails + * + * @return void + * @todo Maybe add more things to perform + */ + public function registerNewUser () { + // Get a user database wrapper + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class'); + + // Use this instance to insert the whole registration instance + $wrapperInstance->insertRegistrationObject($this); + } + + /** + * Perform things like notifying partner websites after registration is done + * + * @return void + * @todo Maybe add more things to perform + */ + public function doPostRegistration () { + // First run all post filters + $this->executePostFilters(); + } + + /** + * Do the action which is required after all registration steps are done. + * This can be a simple redirect to another webpage or displaying a message + * to the user. Or this can be a login step into the newly created account. + * + * @return void + */ + public function doPostAction () { + // Get an action instance from our factory + $actionInstance = ObjectFactory::createObjectByConfiguredName('post_registration_class'); + + // Execute the action + $actionInstance->execute($this->getRequestInstance(), $this->getResponseInstance()); + } + + /** + * Adds registration elements to a given dataset instance + * + * @param $criteriaInstance An instance of a storeable criteria + * @return void + */ + public function addElementsToDataSet (StoreableCriteria $criteriaInstance) { + // Default is unconfirmed! + $configEntry = 'user_status_unconfirmed'; + + // Is the confirmation process entirely disabled? + if ($this->getConfigInstance()->getConfigEntry('confirm_email_enabled') === 'N') { + // No confirmation of email needed + $configEntry = 'user_status_confirmed'; + } // END - if + + // Add a lot elements to the dataset criteria + foreach ($this->criteriaElements as $alias => $element) { + // Do we have an alias? + if (is_string($alias)) { + // Yes, so use it + $criteriaInstance->addCriteria($alias, $this->getRequestInstance()->getRequestElement($element)); + + // Debug message + //* DEBUG: */ $this->debugOutput('ALIAS: alias='.$alias.',element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); + } else { + // No, default entry + $criteriaInstance->addCriteria($element, $this->getRequestInstance()->getRequestElement($element)); + + // Debug message + //* DEBUG: */ $this->debugOutput('DEFAULT: element='.$element.'='.$this->getRequestInstance()->getRequestElement($element)); + } + + // Is this a guest account? + if ((($element == 'username') || ($alias == 'username')) && ($this->getRequestInstance()->getRequestElement($element) == $this->getConfigInstance()->getConfigEntry('guest_login_user'))) { + // Yes, then set the config entry to guest status + $configEntry = 'user_status_guest'; + } // END - if + } // END - foreach + + // Mark the username as unique key + $criteriaInstance->setUniqueKey(UserDatabaseWrapper::DB_COLUMN_USERNAME); + + // Add account status as configured + $criteriaInstance->addConfiguredCriteria(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $configEntry); + + // Include registration timestamp + $criteriaInstance->addCriteria('registered', date('Y-m-d H:i:s', time())); + } +} + +// +?> diff --git a/application/shipsimu/main/resolver/.htaccess b/application/shipsimu/main/resolver/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/resolver/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/resolver/web/.htaccess b/application/shipsimu/main/resolver/web/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/resolver/web/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php b/application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php new file mode 100644 index 0000000..e5fcfb4 --- /dev/null +++ b/application/shipsimu/main/resolver/web/class_WebCompanyCommandResolver.php @@ -0,0 +1,190 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebCompanyCommandResolver extends BaseCommandResolver implements CommandResolver { + /** + * Last successfull resolved command + */ + private $lastCommandInstance = null; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set prefix to "Web" + $this->setCommandPrefix('Web'); + } + + /** + * Creates an instance of a Web command resolver with a given default command + * + * @param $commandName The default command we shall execute + * @param $appInstance An instance of a manageable application helper class + * @return $resolverInstance The prepared command resolver instance + * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidInterfaceException Thrown if command does not implement interface Commandable + */ + public static final function createWebCompanyCommandResolver ($commandName, ManageableApplication $appInstance) { + // Create the new instance + $resolverInstance = new WebCompanyCommandResolver(); + + // Get request instance + $requestInstance = $appInstance->getRequestInstance(); + + // Is the variable $commandName set and the command is valid? + if (empty($commandName)) { + // Then thrown an exception here + throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) { + // Invalid command found (missing interface?) + throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING); + } + + // Set the application instance + $resolverInstance->setApplicationInstance($appInstance); + + // Return the prepared instance + return $resolverInstance; + } + + /** + * Returns an command instance for a given request class or null if + * it was not found + * + * @param $requestInstance An instance of a request class + * @return $commandInstance An instance of the resolved command + * @throws InvalidCommandException Thrown if $commandName is + * invalid + * @throws InvalidCommandInstanceException Thrown if $commandInstance + * is an invalid instance + */ + public function resolveCommandByRequest (Requestable $requestInstance) { + // Init instance + $commandInstance = null; + + // This goes fine so let's resolv the command + $commandName = str_replace('-', '_', $requestInstance->getRequestElement('app')) . '_' . $requestInstance->getRequestElement('page'); + + // Is there a "failed" request? + if ($requestInstance->isRequestElementSet('failed')) { + // Then include with within the command name + $commandName = $commandName . '_' . $requestInstance->getRequestElement('failed'); + } // END - if + + // Is the command empty? Then fall back to default command + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Check if command is valid + if ($this->isCommandValid($commandName) === false) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Get the command + $commandInstance = $this->loadCommand($commandName); + + // And validate it + if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { + // This command has an invalid instance! + throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Set last command + $this->lastCommandInstance = $commandInstance; + + // Return the resolved command instance + return $commandInstance; + } + + /** + * Resolves the command by its direct name and returns an instance of its class + * + * @param $commandName The direct command name we shall resolve + * @return $commandInstance An instance of the command class + * @throws InvalidCommandException Thrown if $commandName is invalid + */ + public function resolveCommand ($commandName) { + // Initiate the instance variable + $commandInstance = null; + + // Is the command empty? Then fall back to default command + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Check if command is valid + if ($this->isCommandValid($commandName) === false) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Get the command + $commandInstance = $this->loadCommand($commandName); + + // Return the instance + return $commandInstance; + } + + /** + * "Loads" a given command and instances it if not yet cached + * + * @param $commandName A command name we shall look for + * @return $commandInstance A loaded command instance + * @throws InvalidCommandException Thrown if even the default + * command class is missing (bad!) + */ + private function loadCommand ($commandName) { + // Cache default command + $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Init command instance + $commandInstance = null; + + // Get 'app' from the application + $app = Registry::getRegistry()->getInstance('application')->getRequestInstance()->getRequestElement('app'); + + // Create command class name + $this->setClassName(sprintf("%s%sCommand", + $this->getCommandPrefix(), + $this->convertToClassName($commandName) + )); + + // Is this class loaded? + if (!class_exists($this->getClassName())) { + // Class not found, so throw an exception + throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Initiate the command + $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); + + // Return the result + return $commandInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php b/application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php new file mode 100644 index 0000000..9456c08 --- /dev/null +++ b/application/shipsimu/main/resolver/web/class_WebGovernmentFailedCommandResolver.php @@ -0,0 +1,187 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebGovernmentFailedCommandResolver extends BaseCommandResolver implements CommandResolver { + /** + * Last successfull resolved command + */ + private $lastCommandInstance = null; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set prefix to "Web" + $this->setCommandPrefix('Web'); + } + + /** + * Creates an instance of a Web command resolver with a given default command + * + * @param $commandName The default command we shall execute + * @param $appInstance An instance of a manageable application helper class + * @return $resolverInstance The prepared command resolver instance + * @throws EmptyVariableException Thrown if default command is not set + * @throws InvalidInterfaceException Thrown if command does not implement interface Commandable + */ + public static final function createWebGovernmentFailedCommandResolver ($commandName, ManageableApplication $appInstance) { + // Create the new instance + $resolverInstance = new WebGovernmentFailedCommandResolver(); + + // Get request instance + $requestInstance = $appInstance->getRequestInstance(); + + // Is the variable $commandName set and the command is valid? + if (empty($commandName)) { + // Then thrown an exception here + throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); + } elseif (!$resolverInstance->resolveCommandByRequest($requestInstance) instanceof Commandable) { + // Invalid command found (missing interface?) + throw new InvalidInterfaceException(array($userInstance, 'ManageableMember'), self::EXCEPTION_REQUIRED_INTERFACE_MISSING); + } + + // Set the application instance + $resolverInstance->setApplicationInstance($appInstance); + + // Return the prepared instance + return $resolverInstance; + } + + /** + * Returns an command instance for a given request class or null if + * it was not found + * + * @param $requestInstance An instance of a request class + * @return $commandInstance An instance of the resolved command + * @throws InvalidCommandException Thrown if $commandName is + * invalid + * @throws InvalidCommandInstanceException Thrown if $commandInstance + * is an invalid instance + */ + public function resolveCommandByRequest (Requestable $requestInstance) { + // Init instance + $commandInstance = null; + + // This goes fine so let's resolv the command + $commandName = $requestInstance->getRequestElement('page'); + + // Is there a "failed" request? + if ($requestInstance->isRequestElementSet('failed')) { + // Then include with within the command name + $commandName = sprintf("%s_%s", $commandName, $requestInstance->getRequestElement('failed')); + } // END - if + + // Is the command empty? Then fall back to default command + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Check if command is valid + if ($this->isCommandValid($commandName) === false) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Get the command + $commandInstance = $this->loadCommand($commandName); + + // And validate it + if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) { + // This command has an invalid instance! + throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Set last command + $this->lastCommandInstance = $commandInstance; + + // Return the resolved command instance + return $commandInstance; + } + + /** + * Resolves the command by its direct name and returns an instance of its class + * + * @param $commandName The direct command name we shall resolve + * @return $commandInstance An instance of the command class + * @throws InvalidCommandException Thrown if $commandName is invalid + */ + public function resolveCommand ($commandName) { + // Initiate the instance variable + $commandInstance = null; + + // Is the command empty? Then fall back to default command + if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Check if command is valid + if ($this->isCommandValid($commandName) === false) { + // This command is invalid! + throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); + } + + // Get the command + $commandInstance = $this->loadCommand($commandName); + + // Return the instance + return $commandInstance; + } + + /** + * "Loads" a given command and instances it if not yet cached + * + * @param $commandName A command name we shall look for + * @return $commandInstance A loaded command instance + * @throws InvalidCommandException Thrown if even the default + * command class is missing (bad!) + */ + private function loadCommand ($commandName) { + // Cache default command + $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command'); + + // Init command instance + $commandInstance = null; + + // Create command class name + $this->setClassName(sprintf("%s%sCommand", + $this->getCommandPrefix(), + $this->convertToClassName($commandName) + )); + + // Is this class loaded? + if (!class_exists($this->getClassName())) { + // Class not found, so throw an exception + throw new InvalidCommandException(array($this, $defaultCommand), self::EXCEPTION_INVALID_COMMAND); + } // END - if + + // Initiate the command + $commandInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this)); + + // Return the result + return $commandInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/ships/.htaccess b/application/shipsimu/main/ships/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/ships/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/ships/class_BaseShip.php b/application/shipsimu/main/ships/class_BaseShip.php new file mode 100644 index 0000000..ae22ca3 --- /dev/null +++ b/application/shipsimu/main/ships/class_BaseShip.php @@ -0,0 +1,167 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseShip extends BaseSimulator { + // Name des Shipes + private $shipName = "Unbekanntes Schiff"; + + // Anzahl Anker + private $numAnchor = 0; + + // Tiefgang in Meter + private $draught = 0; + + // Besatzung-Objekte + private $crewList = null; + + // Aufbauten-Objekte + private $structures = null; + + // Namenloses Ship generieren + protected function __construct($className) { + // Call parent constructor + parent::__construct($className); + + // Prepare array object for all structures + $this->createStructuresArray(); + + // Clean-up a little + $this->removePartInstance(); + } + + // Array-Objekt anlegen + private function createStructuresArray () { + $this->structures = new FrameworkArrayObject("FakedShipStructures"); + } + + // Schiffsteil generieren (kann alles sein) + // buildInstance = Das was in das Schiffsteil evtl. eingebaut werden soll (null = kein besonderes Teil einbauen!) + // partClass = Das zu konstruierende Schiffsteil + public function createShipPart (ConstructableShipPart $buildInstance, $partClass) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s erhält ein neues Schiffsteil (%s).", + __CLASS__, + __LINE__, + $this->getShipName(), + $partClass + )); + + // Ist die gewuenschte Klasse vorhanden? + if (!class_exists($partClass)) { + // Nicht vorhanden, dann Ausnahme werfen! + throw new NoClassException($partClass, self::EXCEPTION_CLASS_NOT_FOUND); + } // END - if + + // Get an instance back from our object factory + $partInstance = ObjectFactory::createObjectByName($partClass); + + // Das Einbauen versuchen... + try { + $partInstance->addShipPartToShip($this, $buildInstance); + } catch (MotorShipMismatchException $e) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keinen Motor erhalten! Grund: %s", + __CLASS__, + __LINE__, + $this->getShipName(), + $e->getMessage() + )); + return false; + } catch (RoomShipMismatchException $e) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keinen Maschinenraum erhalten! Grund: %s", + __CLASS__, + __LINE__, + $this->getShipName(), + $e->getMessage() + )); + return false; + + } catch (StructureShipMismatchException $e) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keine Aufbauten erhalten! Grund: %s", + __CLASS__, + __LINE__, + $this->getShipName(), + $e->getMessage() + )); + return false; + } catch (CabinShipMismatchException $e) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat keine Kabine erhalten! Grund: %s", + __CLASS__, + __LINE__, + $this->getShipName(), + $e->getMessage() + )); + return false; + } catch (DeckShipMismatchException $e) { + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff %s hat kein Deck erhalten! Grund: %s", + __CLASS__, + __LINE__, + $this->getShipName(), + $e->getMessage() + )); + return false; + } + + // Instanz im Aufbauten-Array vermerken + $this->structures->append($partInstance); + + // Alles klar! + return true; + } + + // Getter-Methode fuer Strukturen-Array + public final function getStructuresArray () { + return $this->structures; + } + + // STUB: Getter-Methode Anzahl Betten + public function calcTotalBeds () { + $this->partialStub("Please implement this stub in your ship!"); + } + + // Setter-Methode fuer Schiffsnamen + public final function setShipName ($shipName) { + $this->shipName = (string) $shipName; + } + + // Getter-Methode fuer Schiffsnamen + public final function getShipName () { + return $this->shipName; + } + + // Setter-Methode fuer Tiefgang + public final function setDraught ($draught) { + $this->draught = (int) $draught; + } + + // Getter-Methode fuer Tiefgang + public final function getDraught() { + return $this->draught; + } + + // Setter-Methode fuer Anzahl Anker + public final function setNumAnchor ($numAnchor) { + $this->numAnchor = (int) $numAnchor; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/ships/passenger/.htaccess b/application/shipsimu/main/ships/passenger/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/ships/passenger/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/ships/passenger/class_PassengerShip.php b/application/shipsimu/main/ships/passenger/class_PassengerShip.php new file mode 100644 index 0000000..70fa5ed --- /dev/null +++ b/application/shipsimu/main/ships/passenger/class_PassengerShip.php @@ -0,0 +1,87 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class PassengerShip extends BaseShip implements ConstructableShip { + // Konstruktor + protected function __construct () { + // Eltern-Kontruktor aufrufen + parent::__construct(__CLASS__); + } + + // Passagier-Schiff erstellen + public static final function createPassengerShip ($shipName) { + // Get new instance + $passInstance = new PassengerShip(); + + // Set ship name + $passInstance->setShipName($shipName); + + // Instanz zurueckgeben + return $passInstance; + } + + // Anzahl Betten ermitteln + public final function calcTotalBeds () { + // Struktur-Array holen + $struct = $this->getStructuresArray(); + + if (is_null($struct)) { + // Empty structures list! + throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY); + } // END - if + + // Anzahl Betten auf 0 setzen + $numBeds = 0; + + // Alle Strukturen nach Kabinen durchsuchen + for ($idx = $struct->getIterator(); $idx->valid(); $idx->next()) { + // Element holen + $el = $idx->current(); + + // Ist es eine Kabine? + if ($el->isCabin()) { + // Anzahl Betten ermitteln + $total = $el->calcTotalBedsByCabin(); + $numBeds += $total; + + // Debug-Meldung ausgeben? + if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) { + // Get new instance + $cabType = "Kabine ohne Namen"; + $cab = $el->getPartInstance(); + if (!is_null($cab)) { + // Kabinenbeschreibung holen + $cabType = $cab->getObjectDescription(); + } // END - if + } // END - if + } // END - if + } // END - for + + // Anzahl zurueckliefern + return $numBeds; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/.htaccess b/application/shipsimu/main/structures/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/class_BaseStructure.php b/application/shipsimu/main/structures/class_BaseStructure.php new file mode 100644 index 0000000..59318cb --- /dev/null +++ b/application/shipsimu/main/structures/class_BaseStructure.php @@ -0,0 +1,51 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseStructure extends BaseSimulator { + // Price of this structure + private $price = 0.00; + + // Konstruktor (hier keine Exceptions aendern!) + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Setter for price + public final function setPrice ($price) { + $this->price = (float) $price; + } + + // Getter for price + public final function getPrice () { + return $this->price; + } + + // Remove price + public final function removePrice () { + unset($this->price); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/.htaccess b/application/shipsimu/main/structures/extended/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/cabines/.htaccess b/application/shipsimu/main/structures/extended/cabines/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/cabines/class_BaseCabin.php b/application/shipsimu/main/structures/extended/cabines/class_BaseCabin.php new file mode 100644 index 0000000..b513944 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/class_BaseCabin.php @@ -0,0 +1,38 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseCabin extends BaseCabinStructure { + // Konstruktor + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Is this a cabin? + public final function isCabin () { + return ($this->isClass("BaseCabin")); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/cabines/ship/.htaccess b/application/shipsimu/main/structures/extended/cabines/ship/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/ship/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/shipsimu/main/structures/extended/cabines/ship/class_EconomyCabin.php new file mode 100644 index 0000000..beceae8 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/ship/class_EconomyCabin.php @@ -0,0 +1,58 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Economy-Kabine erstellen + public static final function createEconomyCabin ($numLuxury, $numRooms, $numBeds, $dim) { + // Get new instance + $ecoInstance = new EconomyCabin(); + + // Abmasse extrahieren + $ecoInstance->extractDimensions($dim); + + // Den Rest auch setzen + $ecoInstance->setNumCabin($numLuxury); + $ecoInstance->setNumRooms($numRooms); + $ecoInstance->setNumBeds($numBeds); + + // Nicht noetig! + $ecoInstance->removePartInstance(); + + // Instanz zurueckgeben + return $ecoInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/shipsimu/main/structures/extended/cabines/ship/class_LowCabin.php new file mode 100644 index 0000000..23b877c --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/ship/class_LowCabin.php @@ -0,0 +1,58 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // 2-Sterne-Klasse erstellen + public static final function createLowCabin ($numLuxury, $numRooms, $numBeds, $dim) { + // Get new instance + $lowInstance = new LowCabin(); + + // Abmasse extrahieren + $lowInstance->extractDimensions($dim); + + // Den Rest auch setzen + $lowInstance->setNumCabin($numLuxury); + $lowInstance->setNumRooms($numRooms); + $lowInstance->setNumBeds($numBeds); + + // Nicht noetig! + $lowInstance->removePartInstance(); + + // Instanz zurueckgeben + return $lowInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/shipsimu/main/structures/extended/cabines/ship/class_LuxuryCabin.php new file mode 100644 index 0000000..78cb9c4 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/ship/class_LuxuryCabin.php @@ -0,0 +1,58 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Eine Luxuskabine erstellen + public static final function createLuxuryCabin ($numLuxury, $numRooms, $numBeds, $dim) { + // Get new instance + $luxuryInstance = new LuxuryCabin(); + + // Abmasse extrahieren + $luxuryInstance->extractDimensions($dim); + + // Den Rest auch setzen + $luxuryInstance->setNumCabin($numLuxury); + $luxuryInstance->setNumRooms($numRooms); + $luxuryInstance->setNumBeds($numBeds); + + // Nicht noetig! + $luxuryInstance->removePartInstance(); + + // Instanz zurueckgeben + return $luxuryInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/shipsimu/main/structures/extended/cabines/ship/class_PremierCabin.php new file mode 100644 index 0000000..522e301 --- /dev/null +++ b/application/shipsimu/main/structures/extended/cabines/ship/class_PremierCabin.php @@ -0,0 +1,58 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Premier-Kabine erstellen + public static final function createPremierCabin ($numLuxury, $numRooms, $numBeds, $dim) { + // Get new instance + $premierInstance = new PremierCabin(); + + // Abmasse extrahieren + $premierInstance->extractDimensions($dim); + + // Den Rest auch setzen + $premierInstance->setNumCabin($numLuxury); + $premierInstance->setNumRooms($numRooms); + $premierInstance->setNumBeds($numBeds); + + // Nicht noetig! + $premierInstance->removePartInstance(); + + // Instanz zurueckgeben + return $premierInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/class_ b/application/shipsimu/main/structures/extended/class_ new file mode 100644 index 0000000..9644fd5 --- /dev/null +++ b/application/shipsimu/main/structures/extended/class_ @@ -0,0 +1,7 @@ + + /** + * Limits this object with an ObjectLimits instance + */ + public function limitObject (ObjectLimits $limitInstance) { + die("limitObject() reached! Stub!"); + } diff --git a/application/shipsimu/main/structures/extended/class_BaseCabinStructure.php b/application/shipsimu/main/structures/extended/class_BaseCabinStructure.php new file mode 100644 index 0000000..77a81ae --- /dev/null +++ b/application/shipsimu/main/structures/extended/class_BaseCabinStructure.php @@ -0,0 +1,135 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseCabinStructure extends BaseStructure { + // --- Besondere Eigenschaften dazufuegen: --- + // Anzahl der Kabinen im Schiff + private $numCabin = 0; + + // Anzahl Raeume pro Kabine (kann auch nur 1 sein) + private $numRooms = 0; + + // Anzahl Betten, verallgemeinert + private $numBeds = 0; + + // Konstruktor + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Kabine hinzufuegen + public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) { + // Eltern-Methode aufrufen + parent::addShipPartToShip ($shipInstance, $cabinInstance); + + // Restlichen Daten ebenfalls + $this->setNumCabin($cabinInstance->numCabin); + $this->setNumRooms($cabinInstance->numRooms); + $this->setNumBeds($cabinInstance->numBeds); + + // Unnoetige Attribute entfernen + $cabinInstance->removeNumCabin(); + $cabinInstance->removeNumRooms(); + $cabinInstance->removeNumBeds(); + + // Instanz setzen + $this->setDeckInstance($cabinInstance); + } + + // Wrapper fuer setDeckInstance->setPartInstance + public final function setDeckInstance ($deck) { + parent::setPartInstance($deck); + } + + // Getter-Methode fuer Anzahl Betten + public final function getNumBeds () { + return $this->numBeds; + } + + // Getter-Methode fuer Anzahl Kabinen + public final function getNumCabin () { + return $this->numCabin; + } + + // Setter-Methode fuer Anzahl Betten + public final function setNumBeds ($numBeds) { + $this->numBeds = $numBeds; + } + + // Setter-Methode fuer Anzahl Raeume + public final function setNumRooms ($numRooms) { + $this->numRooms = $numRooms; + } + + // Setter-Methode fuer Anzahl Kabinen + public final function setNumCabin ($numCabin) { + $this->numCabin = $numCabin; + } + + // Loesch-Methode fuer Anzahl Betten + public final function removeNumBeds() { + unset($this->numBeds); + } + + // Loesch-Methode fuer Anzahl Kabinen + public final function removeNumCabin() { + unset($this->numCabin); + } + + // Loesch-Methode fuer Anzahl Raeume + public final function removeNumRooms() { + unset($this->numRooms); + } + + // Bettenanzahl pro Kabine berechnen + public function calcTotalBedsByCabin () { + // Dann Bettenanzahl holen und aufaddieren + $beds = $this->getNumBeds(); + $num = $this->getNumCabin(); + $cabinBeds = $beds * $num; + if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) { + // Get new instance + $cabType = "Kabine ohne Namen"; + $cab = $this->getPartInstance(); + if (!is_null($cab)) { + // Kabinenbeschreibung holen + $cabType = $cab->__toString(); + } + + // Debug-Meldung ausgeben + $this->debugOutput(sprintf("[%s:%d] Es exisitieren %d Kabinen vom Typ %s zu je %d Betten. Das sind %d Betten.", + __CLASS__, + __LINE__, + $num, + $cabType, + $beds, + $cabinBeds + )); + } + return $cabinBeds; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/class_BaseDeckStructure.php b/application/shipsimu/main/structures/extended/class_BaseDeckStructure.php new file mode 100644 index 0000000..0f44a55 --- /dev/null +++ b/application/shipsimu/main/structures/extended/class_BaseDeckStructure.php @@ -0,0 +1,61 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseDeckStructure extends BaseStructure { + // Anzahl Decks + private $numDecks = 0; + + // Konstruktor + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + // Deckstruktur dem Schiff hinzufuegen + public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) { + // Eltern-Methode aufrufen + parent::addShipPartToShip($shipInstance, $deckInstance); + + // Andere Daten uebertragen und von der Quelle loeschen + $this->setNumDecks($deckInstance->getNumDecks()); + $deckInstance->removeNumDecks(); + } + + // Deckanzahl entfernen + public final function removeNumDecks() { + unset($this->numDecks); + } + + // Setter-Methode fuer Anzahl Decks + public final function setNumDecks($numDecks) { + $this->numDecks = (int) $numDecks; + } + + // Getter-Methode fuer Anzahl Decks + public final function getNumDecks() { + return $this->numDecks; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/class_BaseUpperStructure.php b/application/shipsimu/main/structures/extended/class_BaseUpperStructure.php new file mode 100644 index 0000000..dd6934c --- /dev/null +++ b/application/shipsimu/main/structures/extended/class_BaseUpperStructure.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseUpperStructure extends BaseStructure { + /** + * Constructor for all super structures on a ship + * + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/decks/.htaccess b/application/shipsimu/main/structures/extended/decks/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/decks/cargo/.htaccess b/application/shipsimu/main/structures/extended/decks/cargo/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/cargo/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/shipsimu/main/structures/extended/decks/cargo/class_CarDeck.php new file mode 100644 index 0000000..d87dd09 --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/cargo/class_CarDeck.php @@ -0,0 +1,56 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // Autodeck erstellen + public static final function createCarDeck ($numDecks, $dim) { + // Get new instance + $carInstance = new CarDeck(); + + // Abmasse extrahieren + $carInstance->extractDimensions($dim); + + // Andere Daten uebetragen + $carInstance->setNumDecks($numDecks); + + // Nicht noetige Instanz + $carInstance->removePartInstance(); + + // Instanz zurueckgeben + return $carInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/shipsimu/main/structures/extended/decks/cargo/class_TrainDeck.php new file mode 100644 index 0000000..07410ea --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/cargo/class_TrainDeck.php @@ -0,0 +1,56 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // LKW-Deck erstellen + public static final function createTrainDeck ($numDecks, $dim) { + // Get new instance + $trainInstance = new TrainDeck(); + + // Abmasse extrahieren + $trainInstance->extractDimensions($dim); + + // Andere Daten uebetragen + $trainInstance->setNumDecks($numDecks); + + // Nicht noetige Instanz + $trainInstance->removePartInstance(); + + // Instanz zurueckliefern + return $trainInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/shipsimu/main/structures/extended/decks/cargo/class_TruckDeck.php new file mode 100644 index 0000000..6a87d85 --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/cargo/class_TruckDeck.php @@ -0,0 +1,57 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart { + // Konstruktor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + // LKW-Deck erstellen + public static final function createTruckDeck ($numDecks, $dim) { + // Get new instance + $truckInstance = new TruckDeck(); + + // Abmasse extrahieren + $truckInstance->extractDimensions($dim); + + // Andere Daten uebetragen + $truckInstance->setNumDecks($numDecks); + + // Nicht noetige Instanz + $truckInstance->removePartInstance(); + + // Instanz zurueckliefern + return $truckInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/decks/class_BaseDeck.php b/application/shipsimu/main/structures/extended/decks/class_BaseDeck.php new file mode 100644 index 0000000..7b92d68 --- /dev/null +++ b/application/shipsimu/main/structures/extended/decks/class_BaseDeck.php @@ -0,0 +1,37 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseDeck extends BaseDeckStructure { + /** + * Constructor for cargo decks in general + * + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/structures/extended/lower/.htaccess b/application/shipsimu/main/structures/extended/lower/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/lower/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/upper/.htaccess b/application/shipsimu/main/structures/extended/upper/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/structures/extended/upper/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/structures/extended/upper/class_Bridge.php b/application/shipsimu/main/structures/extended/upper/class_Bridge.php new file mode 100644 index 0000000..1c3b674 --- /dev/null +++ b/application/shipsimu/main/structures/extended/upper/class_Bridge.php @@ -0,0 +1,55 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableShipPart { + // Constructor + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removePartInstance(); + } + + // Eine Kommandobruecke erstellen + public static final function createBridge ($width, $height, $length) { + // Get new instance + $bridgeInstance = new Bridge(); + + // Abmasse setzen + $bridgeInstance->setWidth($width); + $bridgeInstance->setHeight($height); + $bridgeInstance->setLength($length); + + // Instanz zurueckgeben + return $bridgeInstance; + } + + // Overwritten method for tradeable items + public function isTradeable () { + return true; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/user/.htaccess b/application/shipsimu/main/user/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/user/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/user/class_ShipSimuBaseUser.php b/application/shipsimu/main/user/class_ShipSimuBaseUser.php new file mode 100644 index 0000000..75de2c7 --- /dev/null +++ b/application/shipsimu/main/user/class_ShipSimuBaseUser.php @@ -0,0 +1,261 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Initializes the bank instance + * + * @return $bankInstance A bank instance wether just created or from registry + */ + protected function initBankInstance () { + // Init instance + $bankInstance = null; + + try { + // Get a money bank instance from registry + $bankInstance = Registry::getRegistry()->getInstance('money_bank'); + } catch (NullPointerException $e) { + // Instance not found in registry + // @TODO We should log this exception later + } + + // Is it there? + if (is_null($bankInstance)) { + // Then create a new one + $bankInstance = ObjectFactory::createObjectByConfiguredName('bank_class', array($this)); + + // Store it in registry + Registry::getRegistry()->addInstance('money_bank', $bankInstance); + } // END - if + + // Return the instance + return $bankInstance; + } + + /** + * Initializes the government instance + * + * @return $governmentInstance A government instance + */ + protected function initGovernmentInstance () { + // Init instance + $governmentInstance = null; + + try { + // First get a government instance from registry + $governmentInstance = Registry::getRegistry()->getInstance('government'); + } catch (NullPointerException $e) { + // Instance not found in registry + // @TODO We should log this exception later + } + + // Is it there? + if (is_null($governmentInstance)) { + // Then create a new one + $governmentInstance = ObjectFactory::createObjectByConfiguredName('government_class', array($this)); + + // Store it in registry + Registry::getRegistry()->addInstance('government', $governmentInstance); + } // END - if + + // Return the prepared instance + return $governmentInstance; + } + + /** + * Checks wether the user has reached maximum allowed companies to found + * + * @return $reached Wether the user has reached maximum allowed companies to found + */ + public function ifUserCreatedMaximumAllowedCompanies () { + // Get max allowed companies to found + $maxFound = $this->getConfigInstance()->getConfigEntry('max_allowed_companies_found'); + + // Now get a search criteria and set the user's name as criteria + $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName()); + $searchInstance->setLimit($maxFound); + + // Get a company wrapper + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class'); + + // Do the count-select by criteria + $totalRows = $wrapperInstance->doSelectCountByCriteria($searchInstance); + + // Does the user have reached maximum? + $reached = ($totalRows >= $maxFound); + + // Return the result + return $reached; + } + + /** + * Checks wether the user has the required amount of points left for the specified action + * + * @param $action The action or configuration entry plus prefix the user wants to perform + * @return $hasRequired Wether the user has the required points + */ + public function ifUserHasRequiredPoints ($action) { + // Default is that everyone is poor... ;-) + $hasRequired = false; + + // Init instance + $pointsInstance = null; + + try { + // Get a points instance from registry + $pointsInstance = Registry::getRegistry()->getInstance('points'); + } catch (NullPointerException $e) { + // Instance not found in registry + // @TODO We should log this exception later + } + + // Is there an instance? + if (is_null($pointsInstance)) { + // Then create one + $pointsInstance = ObjectFactory::createObjectByConfiguredName('user_points_class', array($this)); + + // And store it in registry + Registry::getRegistry()->addInstance('points', $pointsInstance); + } // END - if + + // Just forward this request to the user points class + $hasRequired = $pointsInstance->ifUserHasRequiredPoints($action); + + // Return the result + return $hasRequired; + } + + /** + * Determines if government can still pay a "virtual training course" in general + * + * @return $ifGovHelps Wether if government helps the user with a virtual training course + */ + public function ifGovernmentPaysTraining () { + // By default they want to help. + $ifGovHelps = true; + + // Initialize government instance + $governmentInstance = $this->initGovernmentInstance(); + + // Then ask the government if they want to pay a "startup help" to the user + $ifGovHelps = ($governmentInstance->ifGovernmentAlreadyPayedTraining()); + + // Return result here + return $ifGovHelps; + } + + /** + * Determines if government can still pay a "startup help" to the user + * + * @return $ifGovHelps Wether if government helps the user with some startup money + */ + public function ifGovernmentPaysStartupHelp () { + // By default they want to help. + $ifGovHelps = true; + + // Initialize government instance + $governmentInstance = $this->initGovernmentInstance(); + + // Then ask the government if they want to pay a "startup help" to the user + $ifGovHelps = ($governmentInstance->ifGovernmentPayedMaxmimumStartupHelp()); + + // Return result here + return $ifGovHelps; + } + + /** + * Checks wether the user can take points from the money bank + * + * @return $bankLends Wether the money bank is able to lend money + * @todo Need to implement MoneyBank::ifBankLendsMoreMoney() + */ + public function ifUserAllowedTakeCreditsFromMoneyBank () { + // Per default the money bank cannot pay + $bankLends = false; + + // Initialize bank instance + $bankInstance->initBankInstance(); + + // Does the money bank lend more money? + $bankLends = ($bankInstance->ifBankLendsMoreMoney()); + + // Return result + return $bankLends; + } + + /** + * Checks wether the user has maximum credits with the money bank. This + * should be done seperately from checking if the user is allowed to take + * credits from the bank. + * + * @return $hasMaxCredits Wether the user has maximum credits with the bank + * @todo Need to check the bank if they can lend more money + */ + public function ifUserHasMaximumCreditsWithMoneyBank () { + // For default he can still get money + $hasMaxCredits = false; + + // Initialize the bank instance + $bankInstance = $this->initBankInstance(); + + // Now check if the user has maximum credits + $hasMaxCredits = ($bankInstance->ifUserHasMaxCredits()); + + // Return the result + return $hasMaxCredits; + } + + /** + * Checks wether the money bank has opened + * + * @return $hasOpened Wether the money bank has opened + */ + public function ifMoneyBankHasOpened () { + // Default is not opened + $hasOpened = false; + + // Initialize the bank instance + $bankInstance = $this->initBankInstance(); + + // Has this bank opened? + $hasOpened = ($bankInstance->ifMoneyBankHasOpened()); + + // Return result + return $hasOpened; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/user/extended/.htaccess b/application/shipsimu/main/user/extended/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/user/extended/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/user/extended/class_ShipSimuGuest.php b/application/shipsimu/main/user/extended/class_ShipSimuGuest.php new file mode 100644 index 0000000..a66de18 --- /dev/null +++ b/application/shipsimu/main/user/extended/class_ShipSimuGuest.php @@ -0,0 +1,108 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuGuest extends ShipSimuBaseUser implements ManageableGuest { + // Exceptions + const EXCEPTION_USERNAME_NOT_FOUND = 0x170; + const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x171; + const EXCEPTION_USER_PASS_MISMATCH = 0x172; + + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className = __CLASS__) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Creates an instance of this user class by a provided username. This + * factory method will check if username is already taken and if not + * so it will throw an exception. + * + * @param $userName Username we need a class instance for + * @return $userInstance An instance of this user class + * @throws UsernameMissingException If the username does not exist + */ + public static final function createGuestByUsername ($userName) { + // Get a new instance + $userInstance = new ShipSimuGuest(); + + // Set the username + $userInstance->setUserName($userName); + + // Check if username exists + if ($userInstance->ifUsernameExists() === false) { + // Throw an exception here + throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND); + } // END - if + + // Return the instance + return $userInstance; + } + + /** + * Creates an instance of this user class by a provided email address. This + * factory method will not check if email address is there. + * + * @param $email Email address of the user + * @return $userInstance An instance of this user class + */ + public static final function createGuestByEmail ($email) { + // Get a new instance + $userInstance = new ShipSimuGuest(); + + // Set the username + $userInstance->setEmail($email); + + // Return the instance + return $userInstance; + } + + /** + * Updates the last activity timestamp and last performed action in the + * database result. You should call flushPendingUpdates() to flush these updates + * to the database layer. + * + * @param $requestInstance A requestable class instance + * @return void + */ + public function updateLastActivity (Requestable $requestInstance) { + // No activity will be logged for guest accounts + } + + /** + * Flushs all pending updates to the database layer + * + * @return void + */ + public function flushPendingUpdates () { + // No updates will be flushed to database! + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/user/extended/class_ShipSimuMember.php b/application/shipsimu/main/user/extended/class_ShipSimuMember.php new file mode 100644 index 0000000..a37ef16 --- /dev/null +++ b/application/shipsimu/main/user/extended/class_ShipSimuMember.php @@ -0,0 +1,220 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, BookableAccount { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className = __CLASS__) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Destructor for e.g. flushing pending updates to the database + * + * @return void + */ + public function __destruct () { + // Flush any updated entries to the database + $this->flushPendingUpdates(); + + // Call parent destructor + parent::__destruct(); + } + + /** + * Creates an instance of this user class by a provided username. This + * factory method will check if username is already taken and if not + * so it will throw an exception. + * + * @param $userName Username we need a class instance for + * @return $userInstance An instance of this user class + * @throws UsernameMissingException If the username does not exist + */ + public static final function createMemberByUsername ($userName) { + // Get a new instance + $userInstance = new ShipSimuMember(); + + // Set the username + $userInstance->setUserName($userName); + + // Check if username exists + if ($userInstance->ifUsernameExists() === false) { + // Throw an exception here + throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND); + } // END - if + + // Return the instance + return $userInstance; + } + + /** + * Creates an instance of this user class by a provided email address. This + * factory method will not check if email address is there. + * + * @param $email Email address of the user + * @return $userInstance An instance of this user class + */ + public static final function createMemberByEmail ($email) { + // Get a new instance + $userInstance = new ShipSimuMember(); + + // Set the username + $userInstance->setEmail($email); + + // Return the instance + return $userInstance; + } + + /** + * Creates a user by a given request instance + * + * @param $requestInstance An instance of a Requestable class + * @return $userInstance An instance of this user class + * @todo Add more ways of creating user instances + */ + public static final function createMemberByRequest (Requestable $requestInstance) { + // Determine if by email or username + if (!is_null($requestInstance->getRequestElement('username'))) { + // Username supplied + $userInstance = self::createMemberByUserName($requestInstance->getRequestElement('username')); + } elseif (!is_null($requestInstance->getRequestElement('email'))) { + // Email supplied + $userInstance = self::createMemberByEmail($requestInstance->getRequestElement('email')); + } else { + // Unsupported mode + $userInstance = new ShipSimuMember(); + $userInstance->partialStub("We need to add more ways of creating user classes here."); + $userInstance->debugBackTrace(); + exit(); + } + + // Return the prepared instance + return $userInstance; + } + + /** + * Updates the last activity timestamp and last performed action in the + * database result. You should call flushPendingUpdates() to flush these updates + * to the database layer. + * + * @param $requestInstance A requestable class instance + * @return void + */ + public function updateLastActivity (Requestable $requestInstance) { + // Set last action + $lastAction = $requestInstance->getRequestElement('action'); + + // If there is no action use the default on + if (is_null($lastAction)) { + $lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action'); + } // END - if + + // Get a critieria instance + $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + + // Add search criteria + $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName()); + $searchInstance->setLimit(1); + + // Now get another criteria + $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class'); + + // And add our both entries + $updateInstance->addCriteria('last_activity', date('Y-m-d H:i:s', time())); + $updateInstance->addCriteria('last_action', $lastAction); + + // Add the search criteria for searching for the right entry + $updateInstance->setSearchInstance($searchInstance); + + // Set wrapper class name + $updateInstance->setWrapperConfigEntry('user_db_wrapper_class'); + + // Remember the update in database result + $this->getResultInstance()->add2UpdateQueue($updateInstance); + } + + /** + * Books the given 'amount' in the request instance on the users 'points + * account' + * + * @param $requestInstance An instance of a Requestable class + * @return void + */ + public function bookAmountDirectly (Requestable $requestInstance) { + // Init points instance + $pointsInstance = null; + + try { + // Get the points class from registry + $pointsInstance = Registry::getRegistry()->getInstance('points'); + } catch (NullPointerException $e) { + // Instance not found in registry + // @TODO We should log this later + } + + // Is the points instance null? + if (is_null($pointsInstance)) { + // Then get a new one + $pointsInstance = ObjectFactory::createObjectByConfiguredName('user_points_class', array($this)); + + // And store it in registry + Registry::getRegistry()->addInstance('points', $pointsInstance); + } // END - if + + // Get the amount + $amount = $requestInstance->getRequestElement('amount'); + + // Call the method for booking points + $pointsInstance->bookPointsDirectly($amount); + } + + /** + * Flushs all pending updates to the database layer + * + * @return void + */ + public function flushPendingUpdates () { + // Is the object valid? + if (!$this->getResultInstance() instanceof SearchableResult) { + // Abort here + return; + } // END - if + + // Do we have data to update? + if ($this->getResultInstance()->ifDataNeedsFlush()) { + // Get a database wrapper + $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class'); + + // Yes, then send the whole result to the database layer + $wrapperInstance->doUpdateByResult($this->getResultInstance()); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/wrapper/.htaccess b/application/shipsimu/main/wrapper/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/main/wrapper/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/wrapper/class_CompanyDatabaseWrapper.php b/application/shipsimu/main/wrapper/class_CompanyDatabaseWrapper.php new file mode 100644 index 0000000..1552e67 --- /dev/null +++ b/application/shipsimu/main/wrapper/class_CompanyDatabaseWrapper.php @@ -0,0 +1,129 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class CompanyDatabaseWrapper extends BaseDatabaseWrapper { + /** + * Company instance + */ + private $companyInstance = null; + + // Constants for database tables + const DB_TABLE_COMPANY_DATA = 'company'; + const DB_TABLE_COMPANY_USER = 'company_user'; + + // Constants for database columns + const DB_COLUMN_PARTICIPANT_ID = 'participant_id'; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this wrapper class + * + * @param $companyInstance An instance of a generic company class or null if no specific + * @return $wrapperInstance An instance of this wrapper class + * @todo Find an interface which is suitable for all companies + */ + public static final function createCompanyDatabaseWrapper (ShippingCompany $companyInstance = null) { + // Create a new instance + $wrapperInstance = new CompanyDatabaseWrapper(); + + // Set (primary!) table name + $wrapperInstance->setTableName(self::DB_TABLE_COMPANY_DATA); + + // Set the company instance if not null + if (!is_null($companyInstance)) { + $wrapperInstance->setCompanyInstance($companyInstance); + } // END - if + + // Return the instance + return $wrapperInstance; + } + + /** + * Checks wether the given user participates in a company + * + * @param $userInstance An instance of a user class + * @return $participates Wether the user participates at lease in one company + */ + public function ifUserParticipatesInCompany (ManageableAccount $userInstance) { + // By default no user owns any company... ;) + $participates = false; + + // Get a search criteria class + $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); + + // Add the user primary key as a search criteria + $searchInstance->addCriteria(self::DB_COLUMN_PARTICIPANT_ID, $userInstance->getPrimaryKey()); + $searchInstance->setLimit(1); + + // Set company->user table + $this->setTableName(self::DB_TABLE_COMPANY_USER); + + // Get the result back + $resultInstance = $this->doSelectByCriteria($searchInstance); + + // Is there a result? + if ($resultInstance->next()) { + // Then cache it + $this->setResultInstance($resultInstance); + + // Entry found for further analysis/processing + $participates = true; + } // END - if + + // Return the result + return $participates; + } + + /** + * Setter for company instance + * + * @param $companyInstance An instance of a generic company + * @return void + * @todo Find an interface suitable for all types of companies + */ + protected final function setCompanyInstance (ShippingCompany $companyInstance) { + $this->companyInstance = $companyInstance; + } + + /** + * Getter for company instance + * + * @return $companyInstance An instance of a generic company + * @todo Find an interface suitable for all types of companies + */ + public final function getCompanyInstance () { + return $this->companyInstance; + } +} + +// [EOF] +?> diff --git a/application/shipsimu/main/wrapper/class_UserGovernmentDatabaseWrapper.php b/application/shipsimu/main/wrapper/class_UserGovernmentDatabaseWrapper.php new file mode 100644 index 0000000..6392d6b --- /dev/null +++ b/application/shipsimu/main/wrapper/class_UserGovernmentDatabaseWrapper.php @@ -0,0 +1,70 @@ +user data + * + * @author Roland Haeder + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class UserGovernmentDatabaseWrapper extends BaseDatabaseWrapper { + // Constants for database tables + const DB_TABLE_USER_GOVERNMENT = 'gov_user'; + + // Database columns + const DB_COLUMN_GOV_USERID = 'gov_uid'; + const DB_COLUMN_GOV_ACTIVITY = 'gov_activity_status'; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this wrapper class + * + * @return $wrapperInstance An instance of this wrapper class + */ + public static final function createUserGovernmentDatabaseWrapper () { + // Create a new instance + $wrapperInstance = new UserGovernmentDatabaseWrapper(); + + // Set (primary!) table name + $wrapperInstance->setTableName(self::DB_TABLE_USER_GOVERNMENT); + + // Return the instance + return $wrapperInstance; + } + + /** + * Registers the given startup help request with the government + * + * @param $requestInstance A Requestable instance + * @return void + */ + public function registerStartupHelpByRequest (Requestable $requestInstance) { + $requestInstance->debugInstance(); + } +} + +// [EOF] +?> diff --git a/application/shipsimu/starter.php b/application/shipsimu/starter.php new file mode 100644 index 0000000..7ba3538 --- /dev/null +++ b/application/shipsimu/starter.php @@ -0,0 +1,53 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Is there an application helper instance? We need the method main() for +// maining the application +$app = call_user_func_array(array(FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), 'getSelfInstance'), array()); + +// Some sanity checks +if ((empty($app)) || (is_null($app))) { + // Something went wrong! + ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because the helper class %s is not loaded.", + $application, + FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class') + )); +} elseif (!is_object($app)) { + // No object! + ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because 'app' is not an object.", + $application + )); +} elseif (!method_exists($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method'))) { + // Method not found! + ApplicationEntryPoint::app_die(sprintf("[Main:] The application %s could not be launched because the method %s is missing.", + $application, + FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method') + )); +} + +// Call user function +call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), array()); + +// [EOF] +?> diff --git a/application/shipsimu/templates/.htaccess b/application/shipsimu/templates/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/de/.htaccess b/application/shipsimu/templates/de/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/de/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/de/.xml b/application/shipsimu/templates/de/.xml new file mode 100644 index 0000000..d7d7d08 --- /dev/null +++ b/application/shipsimu/templates/de/.xml @@ -0,0 +1,24 @@ + + diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_company.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_company.ctp new file mode 100644 index 0000000..b9df5fc --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_company.ctp @@ -0,0 +1,97 @@ +prefetchValueInstance('user'); + +// Add link group for company founder +$linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine Reederei gründen, um dich selbstständig zu machen?"); + +// Maximum of allowed companies reached? +if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) { + // No more companies allowed to found + $linkInstance->addLinkNote('company_maximum', "Du hast zu viele Firmen gegründet. Bitte denke über eine Fusion (Zusammenlegung) nach."); +} elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('found_new_company')) { + // Enough money to found company + $linkInstance->addActionLinkById('company_found', 'found_company'); +} + +// Add link group for government +$linkInstance->addLinkGroup('government', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom Staat ab wenn du nicht flüssig bist!"); + +if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) { + // Enough money to write applications to other companies + $linkInstance->addActionLinkById('company_list', 'list_company'); +} elseif ($linkInstance->getValueInstance()->ifGovernmentPaysTraining()) { + // Government is able to pay a training in general + $linkInstance->addActionLinkById('government_training', 'list_training_by_government'); + + // Can the government pay startup help? + if ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) { + // Add link note + $linkInstance->addLinkNote('government_startup_help', "Starthilfe beantragen:"); + + // Display link to government for startup help + $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government'); + } // END - if +} elseif ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) { + // Display link to government for startup help + $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government'); +} else { + // Even government cannot help the gamer here + $linkInstance->addLinkNote('government_depleted', "Leider kann dir der Staat nicht mehr weiterhelfen, dich zu bewerben, da du zu oft Starthilfen erhalten hast oder ein Training absolviert hast. Hier muss aber noch weiter am Spiel gearbeitet werden. :-)"); +} + +// Checks wether the money bank has opened +if ($linkInstance->getValueInstance()->ifMoneyBankHasOpened()) { + // Add link group for money bank + $linkInstance->addLinkGroup('moneybank', "Leihe dir zu günstigen Zinsen Geld aus, wenn du mehr brauchst!"); + + // Add link to moneybank + if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { + // Display link to money bank page + $linkInstance->addActionLinkById('moneybank', 'virtual_money_bank'); + } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { + // Maximum credits reached which a money bank can lent + $linkInstance->addLinkNote('moneybank_depleted', "Die Spielebank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); + $linkInstance->addActionLinkById('moneybank_payback_credits', 'payback_credits_to_money_bank'); + } else { + // Unexpected state of the bank + $linkInstance->addLinkNote('moneybank_error', "Es wurde ein Fehler in der Spielebank erkannt. Bitte melde dies dem Support."); + } +} else { + // Money bank is closed! + $linkInstance->addLinkGroup('moneybank', "Die Spielebank hat geschlossen."); + $linkInstance->addLinkNote('moneybank_closed', "Die Spielebank hat derzeit geschlossen. Bitte später nochmal versuchen."); +} + +// Add link group for refill page +$linkInstance->addLinkGroup('refill_page', "Hole dir Geld von uns zu fairen Preisen!"); + +if ($linkInstance->ifRefillPageActive()) { + // Display link to refill page + $linkInstance->addActionLinkById('refill', 'refill_virtual_money'); +} else { + // Refill page not active + $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert."); +} + +// Flush content to the template +$linkInstance->flushContent(); + +// [EOC] +?> +
+
+ Auflistung der Reedereien, an denenen du dich beteiligst: +
+ +
+ {?company_list?} +
+ + +
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_government_startup_help.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_government_startup_help.ctp new file mode 100644 index 0000000..e300a01 --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_government_startup_help.ctp @@ -0,0 +1,62 @@ +prefetchValueInstance('user'); + +// Add main form group +$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen! (Die Profildaten sollte jedoch echt sein.)"); + +// Add group for personal data +$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Beantragung nötig sind:"); + +// Display email, surname and family name +$helperInstance->addFormNote('surname', "Vorname: ".$helperInstance->getValueField('surname').""); +$helperInstance->addFormNote('family', "Nachname: ".$helperInstance->getValueField('family').""); +$helperInstance->addFormNote('email', "Email-Adresse: ".$helperInstance->getValueField('email').""); +$helperInstance->addFormNote('birthday', "Geburtstag: ".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year').""); + +// Add link placeholder for profile page +$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile?}"); + +// Ask again for current account password +$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein."); +$helperInstance->addFieldText('password', "Derzeitiges Passwort:"); +$helperInstance->addInputPasswordField('password'); + +// CAPTCHA enabled? +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung von Starthilfe ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du die Starthilfe beantragen kannst."); + $helperInstance->addCaptcha(); +} // END - if + +// Final notices +$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); +$helperInstance->addInputResetButton("Alles nochmal eingeben"); +$helperInstance->addInputSubmitButton("Starthilfe beantragen"); +$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); + +// Flush the finished form +$helperInstance->flushContent(); + +// Get link helper for profile link +$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'shipsimu_profile')); + +// Add action +$linkInstance->addActionLinkById('profile', 'profile'); + +// Flush the finished form +$linkInstance->flushContent(); + +// [EOC] +?> +
+
+ Virtuelle Beantragung von Starthilfe +
+ +
+ {?shipsimu_government_startup?} +
+
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_government_training.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_government_training.ctp new file mode 100644 index 0000000..7c921ff --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_government_training.ctp @@ -0,0 +1,62 @@ +prefetchValueInstance('user'); + +// Add main form group +$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!"); + +// Add group for personal data +$helperInstance->addFormGroup('persona_data', "Deine persönliche Daten, die für die Kursusteilnahme nötig sind:"); + +// Ask again for current account password +$helperInstance->addFormGroup('password', "Bitte gebe zur Bestätigung dein derzeitiges Passwort ein."); +$helperInstance->addFieldText('password', "Derzeitiges Passwort:"); +$helperInstance->addInputPasswordField('password'); + +// Display email, surname and family name +$helperInstance->addFormNote('surname', "Vorname: ".$helperInstance->getValueField('surname').""); +$helperInstance->addFormNote('family', "Nachname: ".$helperInstance->getValueField('family').""); +$helperInstance->addFormNote('email', "Email-Adresse: ".$helperInstance->getValueField('email').""); +$helperInstance->addFormNote('birthday', "Geburtstag: ".(int)$helperInstance->getValueField('birth_day').".".(int)$helperInstance->getValueField('birth_month').".".(int)$helperInstance->getValueField('birth_year').""); + +// Add link placeholder for profile page +$helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_profile?}"); + +// CAPTCHA enabled? +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_user', "Die virtuelle Beantragung eines Trainingkursus ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, um den Trainingskursus zu beantragen."); + $helperInstance->addCaptcha(); +} // END - if + +// Final notices +$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); +$helperInstance->addInputResetButton("Alles nochmal eingeben"); +$helperInstance->addInputSubmitButton("Trainingskurs beantragen"); +$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); + +// Flush the finished form +$helperInstance->flushContent(); + +// Get link helper for profile link +$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'shipsimu_profile')); + +// Add action +$linkInstance->addActionLinkById('profile', 'profile'); + +// Flush the finished form +$linkInstance->flushContent(); + +// [EOC] +?> +
+
+ Virtuelle Beantragung eines Training-Kursus +
+ +
+ {?shipsimu_government_training?} +
+
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_logout.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_logout.ctp new file mode 100644 index 0000000..5443af2 --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_logout.ctp @@ -0,0 +1,30 @@ +addLinkWithTextById('logout_now'); + +// Flush the content +$helperInstance->flushContent(); + +// Get helper instance +$helperInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'return_login')); + +// Set link text +$helperInstance->addLinkWithTextById('return_login'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+
+ Willst du dich wirklich aus dem Spiel ausloggen? +
+ +
+ {?logout_now?} | {?return_login?} +
+
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_profile.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_profile.ctp new file mode 100644 index 0000000..8037a4e --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_profile.ctp @@ -0,0 +1,145 @@ +prefetchValueInstance('user'); + +// Password can only be changed when the old one is entered and new one twice! +$helperInstance->addFormGroup('pass', "Neues Passwort einrichten:"); +$helperInstance->addFormSubGroup('pass', "Bitte gebe zum Ändern deines Passwortes zweimal das gewünschte neue Passwort ein."); +$helperInstance->addFieldText('pass1', "Neues Passwort:"); +$helperInstance->addInputPasswordField('pass1'); +$helperInstance->addFieldText('pass2', "Neues Passwort, Wiederholung:"); +$helperInstance->addInputPasswordField('pass2'); + +// Display current email +$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: ".$helperInstance->getValueField('email').""); + +// Only for changing email address +if ($helperInstance->ifEmailChangeAllowed()) { + $helperInstance->addFormGroup('email', "Änderung deiner Email-Addresse:"); + $helperInstance->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese ändern möchtest!"); + $helperInstance->addFieldText('email1', "Email-Adresse:"); + $helperInstance->addInputTextField('email1'); + $helperInstance->addFieldText('email2', "Wiederholung Email-Adresse:"); + $helperInstance->addInputTextField('email2'); + + if ($helperInstance->ifEmailMustBeUnique()) { + $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); + } // END - if + + if ($helperInstance->ifEmailChangeRequireConfirmation()) { + $helperInstance->addFormNote('confirm', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an."); + } // END - if +} // END - if + +// Add form group for user profile +$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern."); + +// Persoenliche Daten mit in der Anmeldung abfragen? +if ($helperInstance->ifRegisterIncludesPersonaData()) { + $helperInstance->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); + $helperInstance->addFieldText('surname', "Dein Vorname:"); + $helperInstance->addInputTextFieldWithDefault('surname'); + $helperInstance->addFieldText('family', "Dein Nachname:"); + $helperInstance->addInputTextFieldWithDefault('family'); + $helperInstance->addFieldText('street', "Strasse und Hausnummer:"); + $helperInstance->addInputTextFieldWithDefault('street'); + $helperInstance->addFieldText('city', "Wohnort:"); + $helperInstance->addInputTextFieldWithDefault('city'); + + // Include birthday? + if ($helperInstance->ifProfileIncludesBirthDay()) { + $helperInstance->addFormSubGroup('birthday', "Verrate uns doch dein Geburtsdatum, als Dankeschön erhälst du interessante Prämien - ausschliesslich per Email - zum Geburtstag zugesandt! Gültiges Format: TT.MM.JJJJ"); + $helperInstance->addInputTextField('birth_day'); + $helperInstance->addFieldText('birth_day', "."); + $helperInstance->addInputTextField('birth_month'); + $helperInstance->addFieldText('birth_day', "."); + $helperInstance->addInputTextField('birth_year'); + } // END - if +} // END - if + +// Add sub group for zip code +$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); +$helperInstance->addFieldText('zip', "Postleitzahl:"); +$helperInstance->addInputTextFieldWithDefault('zip'); + +// Add sub group for chat protocols +$helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); + +// Add ICQ chat? +if ($helperInstance->ifChatEnabled('icq')) { + $helperInstance->addFieldText('icq', "ICQ-Nummer:"); + $helperInstance->addInputTextFieldWithDefault('icq'); +} // END - if + +// Add Jabber chat? +if ($helperInstance->ifChatEnabled('jabber')) { + $helperInstance->addFieldText('jabber', "Jabber:"); + $helperInstance->addInputTextFieldWithDefault('jabber'); +} // END - if + +// Add Yahoo! chat? +if ($helperInstance->ifChatEnabled('yahoo')) { + $helperInstance->addFieldText('yahoo', "Yahoo!:"); + $helperInstance->addInputTextFieldWithDefault('yahoo'); +} // END - if + +// Add AOL chat? +if ($helperInstance->ifChatEnabled('aol')) { + $helperInstance->addFieldText('aol', "AOL-Screenname:"); + $helperInstance->addInputTextFieldWithDefault('aol'); +} // END - if + +// Add MSN chat? +if ($helperInstance->ifChatEnabled('msn')) { + $helperInstance->addFieldText('msn', "MSN:"); + $helperInstance->addInputTextFieldWithDefault('msn'); +} // END - if + +if (!$helperInstance->ifRegisterRequiresEmailVerification()) { + $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per Email sind im Loginbereich verfeinerbar, welche du genau haben willst."); +} // END - if + +// Rules already accepted? +if ($helperInstance->ifRulesHaveChanged()) { + $helperInstance->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); + $helperInstance->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); + $helperInstance->addInputCheckboxField('rules', false); +} else { + $helperInstance->addFormNote('rules_accepted', "Du hast die aktuellen Spielregeln akzeptiert. Vielen Dank!"); + $helperInstance->addInputHiddenField('rules', "1"); +} + +// CAPTCHA enabled? +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_user', "Das Ändern von Profildaten ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit deine Änderungen gespeichert werden können."); + $helperInstance->addCaptcha(); +} // END - if + +// Ask again for current account password +$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein."); +$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:"); +$helperInstance->addInputPasswordField('pass_old'); + +// Final notices +$helperInstance->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); +$helperInstance->addInputResetButton("Alles nochmal eingeben"); +$helperInstance->addInputSubmitButton("Accountdaten aktualisieren"); +$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); + +// Flush finished form +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Deine Profildaten bearbeiten +
+ +
+ {?shipsimu_profile?} +
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_refill.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_refill.ctp new file mode 100644 index 0000000..fdc7c4e --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_refill.ctp @@ -0,0 +1,60 @@ +prefetchValueInstance('payments'); + +// Add form group +$helperInstance->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an."); + +// Add sub group +$helperInstance->addInputSelectField('type', "--- Bitte auswählen ---"); + +// In-game currencies (if more than default add them here!) +$helperInstance->addSelectSubOption('currencies', "--- Währungen ---"); +$helperInstance->addSelectOption('currency', "{?currency?}"); + +// Raw resources +$helperInstance->addSelectSubOption('raw_resources', "--- Rohstoffe ---"); +$helperInstance->addSelectOption('raw_wood', "Holz"); +$helperInstance->addSelectOption('raw_iron', "Metall"); +$helperInstance->addSelectOption('raw_stones', "Steine"); + +// This is needed to close the select tag +$helperInstance->addInputSelectField('type', ""); + +// Field for amount +$helperInstance->addFormSubGroup('amount', "Gebe hier in ganzen Zahlen die Menge an, die du nachbestellen willst."); +$helperInstance->addInputTextField('amount', 1000); + +// Add payments +$helperInstance->getValueInstance()->addResultsToHelper($helperInstance); + +// Ask again for current account password +$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Nachbestellung dein derzeitiges Passwort ein."); +$helperInstance->addFieldText('pass_old', "Derzeitiges Passwort:"); +$helperInstance->addInputPasswordField('pass_old'); + +// CAPTCHA enbaled? +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:"); + $helperInstance->addCaptcha(); +} // END - if + +// Submit button +$helperInstance->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!"); +$helperInstance->addInputResetButton("Eingaben löschen"); +$helperInstance->addInputSubmitButton("Nachbestellung verbindlich aufgeben"); +$helperInstance->flushContent(); + +// [EOC] +?> +
+
+ Jetzt dein {?currency?}-Konto aufladen! +
+
+ {?shipsimu_refill?} +
+
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_status_problem.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_status_problem.ctp new file mode 100644 index 0000000..df4a8de --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_status_problem.ctp @@ -0,0 +1,79 @@ +prefetchValueInstance('user'); + +// Add submit button or notice +if ($helperInstance->ifUserAccountUnconfirmed()) { + // Add submit button + $helperInstance->addInputHiddenFieldWithDefault('email'); + $helperInstance->addInputSubmitButton("Bestätigungslink erneut aussenden"); +} elseif ($helperInstance->ifUserAccountLocked()) { + // Account is locked + $helperInstance->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre: + ".$helperInstance->getValueField('lock_reason')." + Bitte melde dich beim Support, damit dieser dir weiterhelfen kann." + ); +} elseif ($helperInstance->ifUserAccountGuest()) { + // Account is guest account + $helperInstance->addFormNote('status_guest', "Gästeaccounts sind in der Funktionalität + leicht eingeschränkt. Bitte melde dich an, damit du ein + vollwertiges Account bekommst." + ); +} + +// Flush content and automatically close the form +$helperInstance->flushContent(); + +// Build the form for confirmation +$helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, 'confirm_code')); + +// Pre-fetch field data with a given registry key +$helperInstance->prefetchValueInstance('user'); + +if ($helperInstance->ifUserAccountUnconfirmed()) { + // Add code box + $helperInstance->addFormGroup('code', "Bitte gebe hier den Bestätigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen."); + $helperInstance->addFieldText('code', "Bestätigungscode aus der Mail:"); + $helperInstance->addInputTextField('code'); + + // Add submit button + $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!"); + $helperInstance->addInputResetButton("Nochmal eingeben"); + $helperInstance->addInputSubmitButton("Bestätigungscode absenden"); +} else { + // Add message + $helperInstance->addFormNote('status_not_unconfirmed', "Möglicherweise hast du einen Bestätigungslink angeklickt, obwohl dein Account bereits freigegeben oder gesperrt ist."); +} + +// Flush content and automatically close the form +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Problem mit deinem Account gefunden: +
+ +
+ Du bist möglicherweise für deine ausgewählte Aktion nicht + berechtigt oder du hast noch deine Email-Adresse nicht bestätigt. Du + kannst dir nun den Bestätigungslink erneut aussenden lassen, oder den + Bestätigungscode unten eingeben. + + + +
+ Weitere Möglichkeiten: +
+ +
+ {?confirm_code?} +
+
diff --git a/application/shipsimu/templates/de/code/action_ship_simu_login_welcome.ctp b/application/shipsimu/templates/de/code/action_ship_simu_login_welcome.ctp new file mode 100644 index 0000000..413a72a --- /dev/null +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_welcome.ctp @@ -0,0 +1,3 @@ +
+ {?shipsimu_login_news?} +
diff --git a/application/shipsimu/templates/de/code/block_company_data.ctp b/application/shipsimu/templates/de/code/block_company_data.ctp new file mode 100644 index 0000000..9752acf --- /dev/null +++ b/application/shipsimu/templates/de/code/block_company_data.ctp @@ -0,0 +1,18 @@ +addActionLinkById('company', 'company'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Firmenstatus: {?company_status?} +
+ diff --git a/application/shipsimu/templates/de/code/block_persona_data.ctp b/application/shipsimu/templates/de/code/block_persona_data.ctp new file mode 100644 index 0000000..bff6bfa --- /dev/null +++ b/application/shipsimu/templates/de/code/block_persona_data.ctp @@ -0,0 +1,27 @@ +prefetchValueInstance('user'); + +// Flush the content out +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Spielername: {?block_username?} +
+
+ Spielerstatus: {?block_user_status?} +
+
+ {?currency?}: {?block_points?} +
+
+ {?profile?} +
+
+ Angemeldet seit: {?block_registered?} +
diff --git a/application/shipsimu/templates/de/code/captch_graphic_code.ctp b/application/shipsimu/templates/de/code/captch_graphic_code.ctp new file mode 100644 index 0000000..121fb00 --- /dev/null +++ b/application/shipsimu/templates/de/code/captch_graphic_code.ctp @@ -0,0 +1,23 @@ +addFieldText('captcha_code', "Bitte wiederhole den Code:"); +$captchaHelper->addInputTextField('c_code'); + +// Add hidden field with validation hash +$captchaHelper->addInputHiddenField('hash', $this->readVariable('captcha_hash')); + +// Flush content +$captchaHelper->flushContent(); + +// [EOC] +?> +
+ CAPTCHA-Bild +
+
+ {?captcha_code?} +
diff --git a/application/shipsimu/templates/de/code/confirm_link.ctp b/application/shipsimu/templates/de/code/confirm_link.ctp new file mode 100644 index 0000000..25f6e67 --- /dev/null +++ b/application/shipsimu/templates/de/code/confirm_link.ctp @@ -0,0 +1,25 @@ +addLinkWithTextById('direct_login'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Bestätigung Deiner Email-Adresse: +
+ +
+ Hallo {?username?}! Du hast heute deine + Email-Addresse bestätigt, wodurch alle Spielefunktionen entsperrt + worden sind. Viel Spass beim Spielen! +
+ + diff --git a/application/shipsimu/templates/de/code/emergency_exit.ctp b/application/shipsimu/templates/de/code/emergency_exit.ctp new file mode 100644 index 0000000..e974daf --- /dev/null +++ b/application/shipsimu/templates/de/code/emergency_exit.ctp @@ -0,0 +1,29 @@ +{?header:title="Problem in application framework detected!"?} + +
+ $content[message] +
+ +
+
+ File inclusion backtrace: +
+
+ $content[backtrace] +
+
+ +
+
+ Statistics +
+
+ Total objects: $content[total_objects] +
+
+ Loaded class files: $content[total_includes] + (Including exception and interfaces.) +
+
+ +{?footer_msg:footer_msg="Please contact the support and supply the full above message, if you think you are not qualified to fix this problem."?} diff --git a/application/shipsimu/templates/de/code/footer.ctp b/application/shipsimu/templates/de/code/footer.ctp new file mode 100644 index 0000000..aa82e68 --- /dev/null +++ b/application/shipsimu/templates/de/code/footer.ctp @@ -0,0 +1,4 @@ +
+ + + diff --git a/application/shipsimu/templates/de/code/footer_msg.ctp b/application/shipsimu/templates/de/code/footer_msg.ctp new file mode 100644 index 0000000..fb1de36 --- /dev/null +++ b/application/shipsimu/templates/de/code/footer_msg.ctp @@ -0,0 +1,8 @@ + + + + + + diff --git a/application/shipsimu/templates/de/code/government_failed_main.ctp b/application/shipsimu/templates/de/code/government_failed_main.ctp new file mode 100644 index 0000000..b073132 --- /dev/null +++ b/application/shipsimu/templates/de/code/government_failed_main.ctp @@ -0,0 +1,106 @@ +prefetchValueInstance('user'); + +// Assign fields with template variables +$blockInstance->assignField('username'); +$blockInstance->assignFieldWithFilter('user_status', "user_status_translator"); + +// Shall we include registration date? +if ($blockInstance->ifIncludeRegistrationStamp()) { + // Then assign it as well! + $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp'); +} // END - if + +// Flush the content out to a template variable +$blockInstance->flushContent(); + +////////////////////////////////////// +// Assign the shipping company data // +////////////////////////////////////// + +// Get a new instance for personal data +$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data')); + +// Set the data source instance +$blockInstance->prefetchValueInstance('company', 'user'); + +// Assign the company name +if ($blockInstance->getValueInstance()->ifUserIsFounder()) { + // User is the founder of the company + $blockInstance->assignMessageField('company_status', "user_is_company_founder"); + $blockInstance->assignLinkFieldWithAction('company' , "company_overview"); + $blockInstance->assignMessageField('company', "link_text_company_overview"); + $blockInstance->assignMessageField('company_title', "link_title_company_overview"); +} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { + // User owns the company + $blockInstance->assignMessageField('company_status', "user_is_company_owner"); + $blockInstance->assignLinkFieldWithAction('company' , "company_overview"); + $blockInstance->assignMessageField('company', "link_text_company_overview"); + $blockInstance->assignMessageField('company_title', "link_title_company_overview"); +} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) { + // User is employed in company + $blockInstance->assignMessageField('company_status', "user_is_employed_in_company"); + $blockInstance->assignLinkFieldWithAction('company' , "employee_overview"); + $blockInstance->assignMessageField('company', "link_text_employee_overview"); + $blockInstance->assignMessageField('company_title', "link_title_employee_overview"); +} else { + // No company participation! + $blockInstance->assignMessageField('company_status', "user_not_assigned_company"); + $blockInstance->assignLinkFieldWithAction('company' , "company"); + $blockInstance->assignMessageField('company', "link_text_company"); + $blockInstance->assignMessageField('company_title', "link_title_company"); +} + +// Flush the content out to a template variable +$blockInstance->flushContent(); + +// Get helper instance +$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout')); + +// Add action +$linkInstance->addActionLinkById('logout', 'logout'); + +// Flush the content +$linkInstance->flushContent(); + +// [EOC] +?> +
+ Willkommen zum Staat in {?app_full_name?}! +
+ +
+ {?government_failed_content?} +
+ +
+
+ Account-Infos: +
+ +
+ {?persona_data?} +
+ +
+ {?logout?} +
+
+ +
+
+ Reederei-Infos: +
+ +
+ {?company_data?} +
+
diff --git a/application/shipsimu/templates/de/code/header.ctp b/application/shipsimu/templates/de/code/header.ctp new file mode 100644 index 0000000..ed67731 --- /dev/null +++ b/application/shipsimu/templates/de/code/header.ctp @@ -0,0 +1,21 @@ + + + + + {?app_full_name?} - {?title?} + + + + + + + + + + + + {?header_extras_hook?} + + + +
diff --git a/application/shipsimu/templates/de/code/header_extras_hook.ctp b/application/shipsimu/templates/de/code/header_extras_hook.ctp new file mode 100644 index 0000000..4375e22 --- /dev/null +++ b/application/shipsimu/templates/de/code/header_extras_hook.ctp @@ -0,0 +1 @@ + diff --git a/application/shipsimu/templates/de/code/home.ctp b/application/shipsimu/templates/de/code/home.ctp new file mode 100644 index 0000000..c530602 --- /dev/null +++ b/application/shipsimu/templates/de/code/home.ctp @@ -0,0 +1,7 @@ +
+ Willkommen zum {?app_full_name?} +
+ +
+ {?shipsimu_news?} +
diff --git a/application/shipsimu/templates/de/code/login_failed.ctp b/application/shipsimu/templates/de/code/login_failed.ctp new file mode 100644 index 0000000..166c48e --- /dev/null +++ b/application/shipsimu/templates/de/code/login_failed.ctp @@ -0,0 +1,46 @@ +addLinkWithTextById('login_retry'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Du bist nicht mehr im Spiel eingeloggt! +
+ +
+
+ Du bist nicht mehr in {?app_full_name?} eingeloggt. + Dies kann verschiedene Gründe haben: +
+ +
    +
  1. Dein Browser nimmt keine Cookies an.
  2. +
  3. Du hast den Loginbereich aus deinen Bookmarks/Favoriten aufgerufen + und die Cookies sind gelöscht.
  4. +
  5. Es besteht ein Problem mit dem Server, wofür du meistens nichts + kannst. Bitte kontaktiere den Support, falls dieses Problem + weiterhin besteht.
  6. +
+ + +
+ + diff --git a/application/shipsimu/templates/de/code/login_form.ctp b/application/shipsimu/templates/de/code/login_form.ctp new file mode 100644 index 0000000..ae60048 --- /dev/null +++ b/application/shipsimu/templates/de/code/login_form.ctp @@ -0,0 +1,99 @@ +ifLoginIsEnabled()) { + // Formular ist aktiv + $helperInstance->addFormGroup('login', "Gebe hier deine Logindaten ein:"); + + // Welches Loginverfahren wurde konfiguriert? + if ($helperInstance->ifLoginWithUsername()) { + // Login mit Username + $helperInstance->addFormSubGroup('username', "Bitte mit deinem Nickname einloggen."); + $helperInstance->addFieldText('username', "Dein Nickname:"); + $helperInstance->addInputTextField('username'); + } elseif ($helperInstance->ifLoginWithEmail()) { + // Login mit Email + $helperInstance->addFormSubGroup('email', "Bitte mit deiner Email-Adresse einloggen."); + $helperInstance->addFieldText('email', "Deine Email-Addresse:"); + $helperInstance->addInputTextField('email'); + } else { + // Login mit Email/Username + $helperInstance->addFormSubGroup('user_email', "Bitte mit deinem Nickname oder Email-Adresse einloggen."); + $helperInstance->addFieldText('user_email', "Dein Nickname/Email:"); + $helperInstance->addInputTextField('user_email'); + } + + $helperInstance->addFormSubGroup('pass', "Gebe dein Passwort von der Anmeldung ein."); + $helperInstance->addFieldText('pass', "Dein Passwort:"); + $helperInstance->addInputPasswordField('pass'); + + // CAPTCHA enabled? + if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_user', "Das Benutzer-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); + $helperInstance->addCaptcha(); + } // END - if + + // Submit buttons + $helperInstance->addFormGroup('buttons_user', "Alles richtig eingegeben?"); + $helperInstance->addInputResetButton("Formular leeren"); + $helperInstance->addInputSubmitButton("Zum Spiel einloggen"); +} else { + // Formular deaktiviert + $helperInstance->addFormNote('form_deactivated', "Einloggen in's Spiel ist derzeit administrativ deaktiviert worden. Bitte komme später noch mal wieder."); + $helperInstance->addFormNote('admin_notice', "Nachricht vom Admin: ".$this->getConfigInstance()->readConfig('login_disabled_reason').""); +} + +// Formular schliessen +$helperInstance->flushContent(); + +// Ist Gastlogin erlaubt? +if ($helperInstance->ifGuestLoginAllowed()) { + // Neue Helper-Instanz holen + $helperInstance = ObjectFactory::createObjectByConfiguredName('web_form_helper', array($this, 'shipsimu_guest_login')); + $helperInstance->addInputHiddenConfiguredField('user', 'guest_login'); + $helperInstance->addInputHiddenConfiguredField('passwd', 'guest_login'); + + // CAPTCHA enbaled? + if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_guest', "Unser Gast-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); + $helperInstance->addCaptcha(); + } // END - if + + // Submit button + $helperInstance->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschränkt. Mehr dazu unter "Gastlogin"."); + $helperInstance->addInputSubmitButton("Als Gast einloggen"); + $helperInstance->flushContent(); +} + +// Get helper instance +$helperInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'register')); + +// Set link text +$helperInstance->addLinkWithTextById('register_login'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Einloggen zu {?app_full_name?} +
+ +
+
+ {?shipsimu_user_login?} +
+ +
+ {?shipsimu_guest_login?} +
+
+ + diff --git a/application/shipsimu/templates/de/code/login_main.ctp b/application/shipsimu/templates/de/code/login_main.ctp new file mode 100644 index 0000000..56adbab --- /dev/null +++ b/application/shipsimu/templates/de/code/login_main.ctp @@ -0,0 +1,107 @@ +prefetchValueInstance('user', 'user_points'); + +// Assign fields with template variables +$blockInstance->assignField('username'); +$blockInstance->assignFieldWithFilter('user_status', 'user_status_translator'); +$blockInstance->assignFieldWithFilter('points', 'format_number'); + +// Shall we include registration date? +if ($blockInstance->ifIncludeRegistrationStamp()) { + // Then assign it as well! + $blockInstance->assignFieldWithFilter('registered', 'format_timestamp'); +} // END - if + +// Flush the content out to a template variable +$blockInstance->flushContent(); + +////////////////////////////////////// +// Assign the shipping company data // +////////////////////////////////////// + +// Get a new instance for personal data +$blockInstance = ObjectFactory::createObjectByConfiguredName('web_block_helper', array($this, 'company_data')); + +// Set the data source instance +$blockInstance->prefetchValueInstance('company', 'user'); + +// Assign the company name +if ($blockInstance->getValueInstance()->ifUserIsFounder()) { + // User is the founder of the company + $blockInstance->assignMessageField('company_status', 'user_is_company_founder'); + $blockInstance->assignLinkFieldWithAction('company' , 'company_overview'); + $blockInstance->assignMessageField('company', 'link_text_company_overview'); + $blockInstance->assignMessageField('company_title', 'link_title_company_overview'); +} elseif ($blockInstance->getValueInstance()->ifUserIsOwner()) { + // User owns the company + $blockInstance->assignMessageField('company_status', 'user_is_company_owner'); + $blockInstance->assignLinkFieldWithAction('company' , 'company_overview'); + $blockInstance->assignMessageField('company', 'link_text_company_overview'); + $blockInstance->assignMessageField('company_title', 'link_title_company_overview'); +} elseif ($blockInstance->getValueInstance()->ifUserIsEmployee()) { + // User is employed in company + $blockInstance->assignMessageField('company_status', 'user_is_employed_in_company'); + $blockInstance->assignLinkFieldWithAction('company' , 'employee_overview'); + $blockInstance->assignMessageField('company', 'link_text_employee_overview'); + $blockInstance->assignMessageField('company_title', 'link_title_employee_overview'); +} else { + // No company participation! + $blockInstance->assignMessageField('company_status', 'user_not_assigned_company'); + $blockInstance->assignLinkFieldWithAction('company' , 'company'); + $blockInstance->assignMessageField('company', 'link_text_company'); + $blockInstance->assignMessageField('company_title', 'link_title_company'); +} + +// Flush the content out to a template variable +$blockInstance->flushContent(); + +// Get helper instance +$linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', array($this, 'logout')); + +// Add action +$linkInstance->addActionLinkById('logout', 'logout'); + +// Flush the content +$linkInstance->flushContent(); + +// [EOC] +?> +
+ Willkommen im Loginbereich von {?app_full_name?}! +
+ +
+ {?login_content?} +
+ +
+
+ Account-Infos: +
+ +
+ {?persona_data?} +
+ +
+ {?logout?} +
+
+ +
+
+ Reederei-Infos: +
+ +
+ {?company_data?} +
+
diff --git a/application/shipsimu/templates/de/code/logout_done.ctp b/application/shipsimu/templates/de/code/logout_done.ctp new file mode 100644 index 0000000..9843f50 --- /dev/null +++ b/application/shipsimu/templates/de/code/logout_done.ctp @@ -0,0 +1,19 @@ +addLinkWithTextById('relogin'); + +// Flush the content +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Du bist jetzt aus dem Spiel ausgeloggt! +
+ +
+ Du kannst dich nun {?relogin?} oder weiter auf unseren Seiten bleiben. ;-) +
diff --git a/application/shipsimu/templates/de/code/mail_debug.ctp b/application/shipsimu/templates/de/code/mail_debug.ctp new file mode 100644 index 0000000..e62dd07 --- /dev/null +++ b/application/shipsimu/templates/de/code/mail_debug.ctp @@ -0,0 +1,25 @@ +
+ Mail-Debug-Ausgabe: +
+ +
+
+ Von: {?sender?} +
+
+ An: {?recipient?} +
+
+ Betreff: {?subject?} +
+
+ +
+
+ Nachricht: +
+ +
+ {?message?} +
+
diff --git a/application/shipsimu/templates/de/code/register_form.ctp b/application/shipsimu/templates/de/code/register_form.ctp new file mode 100644 index 0000000..90dca57 --- /dev/null +++ b/application/shipsimu/templates/de/code/register_form.ctp @@ -0,0 +1,134 @@ +addFormGroup('login', "Bitte gebe hier gewünschten Nickname und dein Zugangspasswort ein."); +$helperInstance->addFormSubGroup('username', "Dein Nickname wird erst nach Absenden des Formulares geprüft. Später bauen wir dann einen automatischen Test ein, der dir sofort zeigt, ob der Nickname bereits vergeben ist."); +$helperInstance->addFieldText('username', "Nickname im Spiel:"); +$helperInstance->addInputTextField('username'); +$helperInstance->addFormSubGroup('pass', "Dein Passwort sollte nicht zu leicht erratbar sein. Später bauen wir hier noch einen automatischen Test ein, der dir sofort die Passwortstärke anzeigt."); +$helperInstance->addFieldText('pass1', "Passwort:"); +$helperInstance->addInputPasswordField('pass1'); +$helperInstance->addFieldText('pass2', "Passwortwiederholung:"); +$helperInstance->addInputPasswordField('pass2'); + +// Does this registration require an email? +if ($helperInstance->ifRegisterRequiresEmailVerification()) { + $helperInstance->addFormGroup('email', "Bitte gebe deine Email zweimal (ein zweites Mal zur Bestätigung) ein, damit wir dir deinen Freischaltlink zusenden können."); + $helperInstance->addFieldText('email1', "Email-Adresse:"); + $helperInstance->addInputTextField('email1'); + $helperInstance->addFieldText('email2', "Wiederholung Email-Adresse:"); + $helperInstance->addInputTextField('email2'); + + // Must the email address be unique in this system? + if ($helperInstance->ifEmailMustBeUnique()) { + $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); + } // END - if +} // END - if + +// Shall we also ask some personal data to complete the profile? +if ($helperInstance->ifRegisterIncludesProfile()) { + $helperInstance->addFormGroup('profile', "Hier kannst du zusätzlich deine Profildaten vorweg eingeben, du kannst sie aber auch nach dem Login vervollständigen!"); + + if (!$helperInstance->ifRegisterRequiresEmailVerification()) { + $helperInstance->addFormSubGroup('email', "Die Angabe deiner Email-Adresse ist nur dann nötig, wenn du auch Email-Benachrichtigungen (*1) haben möchtest."); + $helperInstance->addFieldText('email1', "Email-Adresse:"); + $helperInstance->addInputTextField('email1'); + + // Must the email address be unique in this system? + if ($helperInstance->ifEmailMustBeUnique()) { + $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); + } // END - if + } // END - if + + // Persoenliche Daten mit in der Anmeldung abfragen? + if ($helperInstance->ifRegisterIncludesPersonaData()) { + $helperInstance->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); + $helperInstance->addFieldText('surname', "Dein Vorname:"); + $helperInstance->addInputTextField('surname'); + $helperInstance->addFieldText('family', "Dein Nachname:"); + $helperInstance->addInputTextField('family'); + $helperInstance->addFieldText('street', "Strasse und Hausnummer:"); + $helperInstance->addInputTextField('street'); + $helperInstance->addFieldText('city', "Wohnort:"); + $helperInstance->addInputTextField('city'); + + // Include birthday? + if ($helperInstance->ifProfileIncludesBirthDay()) { + $helperInstance->addFormSubGroup('birthday', "Verrate uns doch dein Geburtsdatum, als Dankeschön erhälst du interessante Prämien - ausschliesslich per Email - zum Geburtstag zugesandt! Gültiges Format: TT.MM.JJJJ"); + $helperInstance->addInputTextField('birth_day'); + $helperInstance->addFieldText('birth_day', "."); + $helperInstance->addInputTextField('birth_month'); + $helperInstance->addFieldText('birth_day', "."); + $helperInstance->addInputTextField('birth_year'); + } // END - if + } // END - if + + $helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); + $helperInstance->addFieldText('zip', "Postleitzahl:"); + $helperInstance->addInputTextField('zip'); + + $helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); + + if ($helperInstance->ifChatEnabled('icq')) { + $helperInstance->addFieldText('icq', "ICQ-Nummer:"); + $helperInstance->addInputTextField('icq'); + } // END - if + + if ($helperInstance->ifChatEnabled('jabber')) { + $helperInstance->addFieldText('jabber', "Jabber:"); + $helperInstance->addInputTextField('jabber'); + } // END - if + + if ($helperInstance->ifChatEnabled('yahoo')) { + $helperInstance->addFieldText('yahoo', "Yahoo!:"); + $helperInstance->addInputTextField('yahoo'); + } // END - if + + if ($helperInstance->ifChatEnabled('aol')) { + $helperInstance->addFieldText('aol', "AOL-Screenname:"); + $helperInstance->addInputTextField('aol'); + } // END - if + + if ($helperInstance->ifChatEnabled('msn')) { + $helperInstance->addFieldText('msn', "MSN:"); + $helperInstance->addInputTextField('msn'); + } // END - if + + if (!$helperInstance->ifRegisterRequiresEmailVerification()) { + $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst."); + } // END - Extra note + +} // END - ask profile data + +// Spielregeln abfragen +$helperInstance->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); +$helperInstance->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); +$helperInstance->addInputCheckboxField('rules', false); + +// Add CAPTCHA? +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha', "Bitte wiederhole den angezeigten Code damit die Anmeldung abgeschlossen werden kann."); + $helperInstance->addCaptcha(); +} // END - if + +// Final note and submit buttons +$helperInstance->addFormGroup('buttons', "Wenn du alle benötigten Felder korrekt ausgefüt hast, kannst du die Anmeldung abschliessen."); + +$helperInstance->addInputResetButton("Alles nochmal eingeben"); +$helperInstance->addInputSubmitButton("Anmeldung zum Spiel abschliessen"); +$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzen gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); +$helperInstance->flushContent(); + +// [EOC] +?> +
+ Anmeldung bei {?app_full_name?} +
+ +
+ {?shipsimu_register?} +
diff --git a/application/shipsimu/templates/de/code/shipsimu_main.ctp b/application/shipsimu/templates/de/code/shipsimu_main.ctp new file mode 100644 index 0000000..3dd1296 --- /dev/null +++ b/application/shipsimu/templates/de/code/shipsimu_main.ctp @@ -0,0 +1,27 @@ +{?header?} + +
+ {?shipsimu_header?} +
+ + + + + +
+ {?language_selector?} +
+ +
+ {?content?} +
+ + + +{?footer?} diff --git a/application/shipsimu/templates/de/code/status.ctp b/application/shipsimu/templates/de/code/status.ctp new file mode 100644 index 0000000..730a240 --- /dev/null +++ b/application/shipsimu/templates/de/code/status.ctp @@ -0,0 +1,7 @@ +
+ Es besteht ein Problem mit Ihrem Account +
+ +
+ {?status_problem?} +
diff --git a/application/shipsimu/templates/de/emails/.htaccess b/application/shipsimu/templates/de/emails/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/de/emails/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/de/emails/text_resend_link.tpl b/application/shipsimu/templates/de/emails/text_resend_link.tpl new file mode 100644 index 0000000..ab28bab --- /dev/null +++ b/application/shipsimu/templates/de/emails/text_resend_link.tpl @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/application/shipsimu/templates/de/html/.htaccess b/application/shipsimu/templates/de/html/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/de/html/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/de/html/nav_advert.tpl b/application/shipsimu/templates/de/html/nav_advert.tpl new file mode 100644 index 0000000..22da43b --- /dev/null +++ b/application/shipsimu/templates/de/html/nav_advert.tpl @@ -0,0 +1 @@ + diff --git a/application/shipsimu/templates/de/html/selector_ship-simu.tpl b/application/shipsimu/templates/de/html/selector_ship-simu.tpl new file mode 100644 index 0000000..b96640e --- /dev/null +++ b/application/shipsimu/templates/de/html/selector_ship-simu.tpl @@ -0,0 +1,17 @@ +
+
+ Gründen Sie eine virtuelle Reederei an den bedeutestens + Welthäfen! Oder treten Sie einer Reederei als Angestellter bei und + arbeiten Sie sich bis in die Chef-Etagge hoch! +
+ +
+ Oder fangen Sie als Matrose auf einem Passagierschiff (virtuell) an zu + arbeiten und werden Sie nach wenigen Kreuzfahrten bald Kapitän! +
+ +
+ Oder buchen Sie eine virtuelle Kreuzfahrt durch die bekannten Meeren in + {!POINTS!} in einer Luxus-Suite! +
+
diff --git a/application/shipsimu/templates/de/image/base_code.xml b/application/shipsimu/templates/de/image/base_code.xml new file mode 100644 index 0000000..5de71be --- /dev/null +++ b/application/shipsimu/templates/de/image/base_code.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/de/image/code_captcha.img b/application/shipsimu/templates/de/image/code_captcha.img new file mode 100644 index 0000000..223e4fb --- /dev/null +++ b/application/shipsimu/templates/de/image/code_captcha.img @@ -0,0 +1,78 @@ +setImageName('code_captcha'); +$helper->setBaseImage('base_code'); + +// Set image dimensions +$helper->setWidth(100); +$helper->setHeight(50); + +// Get random number +$rand = $helper->getRngInstance()->randomNumber(0, 6); + +// Background and foreground color +switch ($rand) { + case 1: + // First varriant + $helper->setBackgroundColorRedGreenBlue('rand', 0x90 , 0x00 ); + $helper->setForegroundColorRedGreenBlue(0x00 , 0xff , 'rand'); + break; + + case 2: + // Second varriant + $helper->setBackgroundColorRedGreenBlue(0x90 , 'rand', 0x00 ); + $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand'); + break; + + case 3: + // Third varriant + $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 ); + $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xff ); + break; + + case 4: + // Forth varriant + $helper->setBackgroundColorRedGreenBlue(0x00 , 0x90 , 'rand'); + $helper->setForegroundColorRedGreenBlue(0x00 , 'rand', 0xa0 ); + break; + + case 5: + // Fith varriant + $helper->setBackgroundColorRedGreenBlue('rand', 0x00 , 0x90 ); + $helper->setForegroundColorRedGreenBlue(0x00 , 0xe0 , 'rand'); + break; + + default: + // Last varriant + $helper->setBackgroundColorRedGreenBlue(0x00 , 'rand', 0x90 ); + $helper->setForegroundColorRedGreenBlue(0xff , 0x00 , 'rand'); + break; +} + +// Random X/Y factors... +$xRand = $helper->getRngInstance()->randomNumber(0, 45); +$yRand = $helper->getRngInstance()->randomNumber(0, 25); + +// Add code +$helper->addTextLine('code'); +$helper->setCoord((5 + $xRand), (5 + $yRand)); +$helper->setFontSize('rand'); +$helper->setImageString('{?decrypted_code?}'); + +// Only for debug! +/* +$helper->addTextLine('debug'); +$helper->setCoord(90, 35); +$helper->setFontSize(3); +$helper->setImageString($rand); +*/ + +// Flush content to the template engine +$helper->flushContent(); + +// Comment this out if image is done +//$this->debugInstance(); + +// [EOF] +?> diff --git a/application/shipsimu/templates/de/image/emergency_exit.img b/application/shipsimu/templates/de/image/emergency_exit.img new file mode 100644 index 0000000..bf67aa7 --- /dev/null +++ b/application/shipsimu/templates/de/image/emergency_exit.img @@ -0,0 +1,18 @@ +setImageName('emergency_exit'); +$helper->setBaseImage('base_exit'); + +// Set image dimensions +$helper->setWidth(100); +$helper->setHeight(50); + +// Flush content to the template engine +//$helper->flushContent(); + +// Comment this out if image is done +$this->debugInstance(); + +// [EOF] +?> diff --git a/application/shipsimu/templates/de/menu/.htaccess b/application/shipsimu/templates/de/menu/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/de/menu/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/de/menu/base_menu.xml b/application/shipsimu/templates/de/menu/base_menu.xml new file mode 100644 index 0000000..1c93350 --- /dev/null +++ b/application/shipsimu/templates/de/menu/base_menu.xml @@ -0,0 +1,52 @@ + + + + + + + + <title-id>{?menu_title_id?}</title-id> + <title-class>{!menu_title_class?}</title-class> + <title-text>{?menu_title?}</title-text> + + + + + {?entry_id?} + + {?anchor_id?} + {?anchor_text?} + {?anchor_title?} + {?anchor_href?} + + + + + {!footer_id?} + {?footer_design_class?} + {?menu_footer?} + + + + diff --git a/application/shipsimu/templates/de/menu/generic_menu_entries.xml b/application/shipsimu/templates/de/menu/generic_menu_entries.xml new file mode 100644 index 0000000..65c742e --- /dev/null +++ b/application/shipsimu/templates/de/menu/generic_menu_entries.xml @@ -0,0 +1,113 @@ + + + + + + + + <title-id><![CDATA[home_menu_title]]></title-id> + <title-class><![CDATA[menu_title]]></title-class> + <title-text><![CDATA[Home:]]></title-text> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <title-id><![CDATA[law_menu_title]]></title-id> + <title-class><![CDATA[menu_title]]></title-class> + <title-text><![CDATA[Rechtliches:]]></title-text> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/!MISSING b/application/shipsimu/templates/game/!MISSING new file mode 100644 index 0000000..57cf1de --- /dev/null +++ b/application/shipsimu/templates/game/!MISSING @@ -0,0 +1,2 @@ + + diff --git a/application/shipsimu/templates/game/.htaccess b/application/shipsimu/templates/game/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/building/.htaccess b/application/shipsimu/templates/game/building/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/building/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/building/advanced_research_lab.xml b/application/shipsimu/templates/game/building/advanced_research_lab.xml new file mode 100644 index 0000000..48d3e5e --- /dev/null +++ b/application/shipsimu/templates/game/building/advanced_research_lab.xml @@ -0,0 +1,54 @@ + + + + + + + + advanced_research_lab + research + + + + + + + + + + architecture + {?technology_type?} + 10 + + + + laboratory_equipment + {?technology_type?} + 8 + + + + diff --git a/application/shipsimu/templates/game/building/base_building.xml b/application/shipsimu/templates/game/building/base_building.xml new file mode 100644 index 0000000..0949690 --- /dev/null +++ b/application/shipsimu/templates/game/building/base_building.xml @@ -0,0 +1,169 @@ + + + + + + + + + {?width?} + + {?height?} + + {?length?} + + + + + + + + + + + + {?id?} + {?name?} + {?type?} + {?level?} + {?max_floors?} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {?construction_currency?} + + + + {?construct_id?} + + + + + + + {?resource_id?} + {?resource_amount?} + + + + + + + + + + + + + + + + + + + + + + {?cleaning_currency?} + + + + + + + {?repair_currency?} + + + + + + + {?mortgage_currency?} + + + + + + + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + + + + + + diff --git a/application/shipsimu/templates/game/building/research_lab.xml b/application/shipsimu/templates/game/building/research_lab.xml new file mode 100644 index 0000000..091ad0a --- /dev/null +++ b/application/shipsimu/templates/game/building/research_lab.xml @@ -0,0 +1,53 @@ + + + + + + + + research_lab + research + + + + + + + + + architecture + {?technology_type?} + 5 + + + + laboratory_equipment + {?technology_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/chemicals/.htaccess b/application/shipsimu/templates/game/chemicals/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/chemicals/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/company/.htaccess b/application/shipsimu/templates/game/company/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/company/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/container/.htaccess b/application/shipsimu/templates/game/container/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/container/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/container/base_container.xml b/application/shipsimu/templates/game/container/base_container.xml new file mode 100644 index 0000000..be79f56 --- /dev/null +++ b/application/shipsimu/templates/game/container/base_container.xml @@ -0,0 +1,75 @@ + + + + + + + {?id?} + + {?name?} + + {?type?} + + + {?width?} + {?length?} + {?height?} + + + + + + + + + + + + + + + + + + + {?content_id?} + {?content_type?} + {?content_amount?} + + + + + + + {?maintenance_id?} + {?maintenance_name?} + {?maintenance_type?} + + + diff --git a/application/shipsimu/templates/game/contract/.htaccess b/application/shipsimu/templates/game/contract/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/contract/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/contract/base_contract.xml b/application/shipsimu/templates/game/contract/base_contract.xml new file mode 100644 index 0000000..bb59563 --- /dev/null +++ b/application/shipsimu/templates/game/contract/base_contract.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/drink/.htaccess b/application/shipsimu/templates/game/drink/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/drink/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/drink/base_drink.xml b/application/shipsimu/templates/game/drink/base_drink.xml new file mode 100644 index 0000000..6ac3a06 --- /dev/null +++ b/application/shipsimu/templates/game/drink/base_drink.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/electronic/.htaccess b/application/shipsimu/templates/game/electronic/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/electronic/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/electronic/base_electronic.xml b/application/shipsimu/templates/game/electronic/base_electronic.xml new file mode 100644 index 0000000..06945a5 --- /dev/null +++ b/application/shipsimu/templates/game/electronic/base_electronic.xml @@ -0,0 +1,67 @@ + + + + + + + {?id?} + {?name?} + {?type?} + + + {?width?} + {?height?} + {?length?} + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_level?} + + + + + + + {?research_id?} + {?research_name?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/electronic/cellphone.xml b/application/shipsimu/templates/game/electronic/cellphone.xml new file mode 100644 index 0000000..2c7f2d8 --- /dev/null +++ b/application/shipsimu/templates/game/electronic/cellphone.xml @@ -0,0 +1,61 @@ + + + + + + + cellphone + communication + + + 30 + 35 + 30 + + + + + + + + cellular_network + 1 + + + + + + + electronics + 6 + + + + diff --git a/application/shipsimu/templates/game/electronic/hifi_system.xml b/application/shipsimu/templates/game/electronic/hifi_system.xml new file mode 100644 index 0000000..76a1a8e --- /dev/null +++ b/application/shipsimu/templates/game/electronic/hifi_system.xml @@ -0,0 +1,69 @@ + + + + + + hifi_system + entertainment + + + 70 + 70 + 80 + + + + + + + + + intergrated_currents + 6 + + + sound_equalizer + 3 + + + radio_receiving + 4 + + + + + + + electronics + 4 + + + + diff --git a/application/shipsimu/templates/game/electronic/radio_receiver.xml b/application/shipsimu/templates/game/electronic/radio_receiver.xml new file mode 100644 index 0000000..ce5eb0d --- /dev/null +++ b/application/shipsimu/templates/game/electronic/radio_receiver.xml @@ -0,0 +1,65 @@ + + + + + + radio_receiver + entertainment + + + 30 + 40 + 20 + + + + + + + + + intergrated_currents + 3 + + + radio_receiving + 1 + + + + + + + electronics + 3 + + + + diff --git a/application/shipsimu/templates/game/electronic/surround_system.xml b/application/shipsimu/templates/game/electronic/surround_system.xml new file mode 100644 index 0000000..31651a3 --- /dev/null +++ b/application/shipsimu/templates/game/electronic/surround_system.xml @@ -0,0 +1,62 @@ + + + + + + + surround_system + entertainment + + + 120 + 140 + 120 + + + + + + + + + sound_processor + 3 + + + sound_equalizer + 5 + + + radio_receiving + 6 + + + + diff --git a/application/shipsimu/templates/game/electronic/television.xml b/application/shipsimu/templates/game/electronic/television.xml new file mode 100644 index 0000000..44da2f1 --- /dev/null +++ b/application/shipsimu/templates/game/electronic/television.xml @@ -0,0 +1,58 @@ + + + + + + + television + entertainment + + + 100 + 110 + 90 + + + + + + + + + video_receiving + 1 + + + transistor + 1 + + + + diff --git a/application/shipsimu/templates/game/engine/.htaccess b/application/shipsimu/templates/game/engine/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/engine/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/engine/base_engine.xml b/application/shipsimu/templates/game/engine/base_engine.xml new file mode 100644 index 0000000..675d90f --- /dev/null +++ b/application/shipsimu/templates/game/engine/base_engine.xml @@ -0,0 +1,58 @@ + + + + + + {?id?} + {?name?} + {?type?} + {?horse_power?} + + + + {?fuel_id?} + {?fuel_name?} + {?fuel_type?} + + + + {?width?} + {?height?} + {?length?} + + + + + + + + {[?technology_id?} + {[?technology_name?} + {[?technology_level?} + + + + diff --git a/application/shipsimu/templates/game/farmer/.htaccess b/application/shipsimu/templates/game/farmer/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/farmer/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/farmer/base_farmer.xml b/application/shipsimu/templates/game/farmer/base_farmer.xml new file mode 100644 index 0000000..6542df2 --- /dev/null +++ b/application/shipsimu/templates/game/farmer/base_farmer.xml @@ -0,0 +1,61 @@ + + + + + + {?id?} + {?name?} + {?type?} + + + {?month?} + {?day?} + {?year?} + + + {?productivity?} + {?experience?} + + + + + + {?produce_id?} + {?produce_name?} + {?produce_type?} + + + + + {?technology_id?} + {?technology_name?} + {?technology_level?} + + + + + diff --git a/application/shipsimu/templates/game/fruit/.htaccess b/application/shipsimu/templates/game/fruit/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/fruit/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/fruit/base_fruit.xml b/application/shipsimu/templates/game/fruit/base_fruit.xml new file mode 100644 index 0000000..482faad --- /dev/null +++ b/application/shipsimu/templates/game/fruit/base_fruit.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/fuel/.htaccess b/application/shipsimu/templates/game/fuel/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/fuel/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/fuel/base_fuel.xml b/application/shipsimu/templates/game/fuel/base_fuel.xml new file mode 100644 index 0000000..0f023fb --- /dev/null +++ b/application/shipsimu/templates/game/fuel/base_fuel.xml @@ -0,0 +1,30 @@ + + + + + {?id?} + {?name?} + {?type?} + + diff --git a/application/shipsimu/templates/game/grain/.htaccess b/application/shipsimu/templates/game/grain/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/grain/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/grain/base_grain.xml b/application/shipsimu/templates/game/grain/base_grain.xml new file mode 100644 index 0000000..eac45e4 --- /dev/null +++ b/application/shipsimu/templates/game/grain/base_grain.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/lifestock/.htaccess b/application/shipsimu/templates/game/lifestock/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/lifestock/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/lifestock/base_lifestock.xml b/application/shipsimu/templates/game/lifestock/base_lifestock.xml new file mode 100644 index 0000000..267077b --- /dev/null +++ b/application/shipsimu/templates/game/lifestock/base_lifestock.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/merchant/.htaccess b/application/shipsimu/templates/game/merchant/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/merchant/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/merchant/base_merchant.xml b/application/shipsimu/templates/game/merchant/base_merchant.xml new file mode 100644 index 0000000..22d4c78 --- /dev/null +++ b/application/shipsimu/templates/game/merchant/base_merchant.xml @@ -0,0 +1,58 @@ + + + + + + {?id?} + {?name?} + {?type? + + + + + + + + + + + + + + + + + + {?goods_id?} + {?goods_name?} + {?goods_type?} + {?goods_amount?} + {?goods_added?} + {?goods_remoed?} + + + diff --git a/application/shipsimu/templates/game/mineral/.htaccess b/application/shipsimu/templates/game/mineral/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/mineral/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/mineral/base_mineral.xml b/application/shipsimu/templates/game/mineral/base_mineral.xml new file mode 100644 index 0000000..64847ff --- /dev/null +++ b/application/shipsimu/templates/game/mineral/base_mineral.xml @@ -0,0 +1,47 @@ + + + + + + {?id?} + {?type?} + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/produce/.htaccess b/application/shipsimu/templates/game/produce/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/produce/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/produce/base_produce.xml b/application/shipsimu/templates/game/produce/base_produce.xml new file mode 100644 index 0000000..29ca874 --- /dev/null +++ b/application/shipsimu/templates/game/produce/base_produce.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/research/.htaccess b/application/shipsimu/templates/game/research/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/research/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/research/base_research.xml b/application/shipsimu/templates/game/research/base_research.xml new file mode 100644 index 0000000..3c4d185 --- /dev/null +++ b/application/shipsimu/templates/game/research/base_research.xml @@ -0,0 +1,133 @@ + + + + + + {?id?} + {?name?} + {?type?} + {?max_level?} + + + + + + + + + + + + + + + + + + + + + + + + + {?level?} + + + + + + + + + + + + + + + + + {?level_technology_id?} + {?level_technology_name?} + {?level_technology_type?} + {?level_technology_level?} + + + + + {?level_research_id?} + {?level_research_name?} + {?level_research_type?} + {?level_research_level?} + + + + + {?level_building_id?} + {?level_building_name?} + {?level_building_type?} + {?level_building_level?} + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + {?research_id?} + {?research_name?} + {?research_type?} + {?research_level?} + + + + + {?building_id?} + {?building_name?} + {?building_type?} + {?building_level?} + + + + diff --git a/application/shipsimu/templates/game/research/electricity.xml b/application/shipsimu/templates/game/research/electricity.xml new file mode 100644 index 0000000..c6b3480 --- /dev/null +++ b/application/shipsimu/templates/game/research/electricity.xml @@ -0,0 +1,31 @@ + + + + + + electricity + electronics + 10 + + diff --git a/application/shipsimu/templates/game/research/electronics.xml b/application/shipsimu/templates/game/research/electronics.xml new file mode 100644 index 0000000..c2a1f6e --- /dev/null +++ b/application/shipsimu/templates/game/research/electronics.xml @@ -0,0 +1,47 @@ + + + + + + electronics + electronics + 20 + + + + + plastics + chemicals + 2 + + + + + electricity + {?research_type?} + 4 + + + + diff --git a/application/shipsimu/templates/game/research/mathematics.xml b/application/shipsimu/templates/game/research/mathematics.xml new file mode 100644 index 0000000..843c44e --- /dev/null +++ b/application/shipsimu/templates/game/research/mathematics.xml @@ -0,0 +1,31 @@ + + + + + + mathematics + base + 10 + + diff --git a/application/shipsimu/templates/game/research/radio_receiving.xml b/application/shipsimu/templates/game/research/radio_receiving.xml new file mode 100644 index 0000000..3428478 --- /dev/null +++ b/application/shipsimu/templates/game/research/radio_receiving.xml @@ -0,0 +1,42 @@ + + + + + + radio_receiving + electronics + 10 + + + + + + + signal_modulation + electronics + 1 + + + + diff --git a/application/shipsimu/templates/game/research/statics.xml b/application/shipsimu/templates/game/research/statics.xml new file mode 100644 index 0000000..302412e --- /dev/null +++ b/application/shipsimu/templates/game/research/statics.xml @@ -0,0 +1,54 @@ + + + + + + statics + construction + 20 + + + + + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + mathematics + {?research_type?} + 4 + + + + + {?building_name?} + {?building_type?} + {?building_level?} + + + + diff --git a/application/shipsimu/templates/game/resource/.htaccess b/application/shipsimu/templates/game/resource/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/resource/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/resource/base_resource.xml b/application/shipsimu/templates/game/resource/base_resource.xml new file mode 100644 index 0000000..8860210 --- /dev/null +++ b/application/shipsimu/templates/game/resource/base_resource.xml @@ -0,0 +1,52 @@ + + + + + + {?id?} + {?name?} + {?type?} + + + + + + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + diff --git a/application/shipsimu/templates/game/ship/.htaccess b/application/shipsimu/templates/game/ship/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/ship/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/ship/base_ship.xml b/application/shipsimu/templates/game/ship/base_ship.xml new file mode 100644 index 0000000..a33efe8 --- /dev/null +++ b/application/shipsimu/templates/game/ship/base_ship.xml @@ -0,0 +1,134 @@ + + + + + + {?id?} + + {?type?} + {?propeller?} + {?weight?} + {?displacement?} + + + + {?construction_id?} + + {?construction_contract_id?} + + {?construction_started?} + + {?construction_finished? + + + + + + + {?company_id?} + + + {?holder_started?} + {?holder_ended?} + + + + + + + + + + {?structure_id?} + {?structure_amount?} + {?structure_type?} + + + + + {?engine_id?{ + {?engine_type?} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + + + {?research_id?} + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/tank/.htaccess b/application/shipsimu/templates/game/tank/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/tank/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/tank/base_tank.xml b/application/shipsimu/templates/game/tank/base_tank.xml new file mode 100644 index 0000000..c943576 --- /dev/null +++ b/application/shipsimu/templates/game/tank/base_tank.xml @@ -0,0 +1,45 @@ + + + + + {?id?} + {?name?} + {?type?} + + + {?content_id?} + {?content_name?} + {?content_type?} + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/.htaccess b/application/shipsimu/templates/game/technology/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/technology/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/technology/architecture.xml b/application/shipsimu/templates/game/technology/architecture.xml new file mode 100644 index 0000000..6547cc5 --- /dev/null +++ b/application/shipsimu/templates/game/technology/architecture.xml @@ -0,0 +1,57 @@ + + + + + + architecture + construction + + + + + + + + drawings + {?technology_type?} + 5 + + + + + + + statics + {?research_type?} + 3 + + + mathematics + {?research_type?} + 6 + + + + diff --git a/application/shipsimu/templates/game/technology/base_technology.xml b/application/shipsimu/templates/game/technology/base_technology.xml new file mode 100644 index 0000000..846a215 --- /dev/null +++ b/application/shipsimu/templates/game/technology/base_technology.xml @@ -0,0 +1,104 @@ + + + + + + {?id?} + {?name?} + {?type?} + + + + + + + + + + + + + + + + {?list_level?} + {?level_gained?} + + + + + + + + + + + + + + + {?technology_level_id?} + {?technology_level_name?} + {?technology_level_level?} + + + + + + + {?research_level_id?} + {?research_level_name?} + {?research_level_level?} + + + + + + + + + + + + {?technology_id?} + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + + + {?research_id?} + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/cellular_network.xml b/application/shipsimu/templates/game/technology/cellular_network.xml new file mode 100644 index 0000000..77f4a82 --- /dev/null +++ b/application/shipsimu/templates/game/technology/cellular_network.xml @@ -0,0 +1,53 @@ + + + + + + cellular_network + communication + + + + + + + + + + + + + + + + + + electronics + {?research_type?} + 5 + + + + diff --git a/application/shipsimu/templates/game/technology/drawings.xml b/application/shipsimu/templates/game/technology/drawings.xml new file mode 100644 index 0000000..43dbf50 --- /dev/null +++ b/application/shipsimu/templates/game/technology/drawings.xml @@ -0,0 +1,30 @@ + + + + + + drawings + base + + diff --git a/application/shipsimu/templates/game/technology/glass_making.xml b/application/shipsimu/templates/game/technology/glass_making.xml new file mode 100644 index 0000000..7679857 --- /dev/null +++ b/application/shipsimu/templates/game/technology/glass_making.xml @@ -0,0 +1,82 @@ + + + + + + glass_making + production + + + + + + {?list_level?} + + + + + + + {?technology_level_name?} + {?technology_level_type?} + {?technology_level_level?} + + + + + + + {?research_level_name?} + {?research_level_type?} + {?research_level_level?} + + + + + + + + + + + + {?technology_name?} + {?technology_type?} + {?technology_level?} + + + + + + + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/household_devices.xml b/application/shipsimu/templates/game/technology/household_devices.xml new file mode 100644 index 0000000..e19e14f --- /dev/null +++ b/application/shipsimu/templates/game/technology/household_devices.xml @@ -0,0 +1,51 @@ + + + + + + household_devices + electronics + + + + + + + plastics + chemicals + 3 + + + + + + + electronics + {?research_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/technology/intergrated_currents.xml b/application/shipsimu/templates/game/technology/intergrated_currents.xml new file mode 100644 index 0000000..bdfebce --- /dev/null +++ b/application/shipsimu/templates/game/technology/intergrated_currents.xml @@ -0,0 +1,52 @@ + + + + + + intergrated_currents + eletronics + + + + + + + + transistor + electronics + 10 + + + + + + + silicium_mining + {?research_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/technology/laboratory_equipment.xml b/application/shipsimu/templates/game/technology/laboratory_equipment.xml new file mode 100644 index 0000000..1b40430 --- /dev/null +++ b/application/shipsimu/templates/game/technology/laboratory_equipment.xml @@ -0,0 +1,46 @@ + + + + + + laboratory_equipment + equipment + + + + + + plastics + chemicals + 3 + + + glass_making + {?technology_type?} + 5 + + + + diff --git a/application/shipsimu/templates/game/technology/naval_architecture.xml b/application/shipsimu/templates/game/technology/naval_architecture.xml new file mode 100644 index 0000000..5a00d72 --- /dev/null +++ b/application/shipsimu/templates/game/technology/naval_architecture.xml @@ -0,0 +1,60 @@ + + + + + + naval_architecture + ship_construction + + + + + + + architecture + {?technology_type?} + 3 + + + statics + {?technology_type?} + 5 + + + drawings + {?technology_type?} + 6 + + + + + + mathematics + {?research_type?} + 8 + + + + diff --git a/application/shipsimu/templates/game/technology/plastics.xml b/application/shipsimu/templates/game/technology/plastics.xml new file mode 100644 index 0000000..94f2720 --- /dev/null +++ b/application/shipsimu/templates/game/technology/plastics.xml @@ -0,0 +1,53 @@ + + + + + + plastics + production + + + + + + + + + {?technology_name?} + chemicals + {?technology_name?} + + + + + + + chemistry + chemicals + 3 + + + + diff --git a/application/shipsimu/templates/game/technology/signal_amplifying.xml b/application/shipsimu/templates/game/technology/signal_amplifying.xml new file mode 100644 index 0000000..5cc9e01 --- /dev/null +++ b/application/shipsimu/templates/game/technology/signal_amplifying.xml @@ -0,0 +1,52 @@ + + + + + + signal_amplifying + electronics + + + + + + + + transistor + electronics + 3 + + + + + + + modulation + {?research_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/technology/signal_modulation.xml b/application/shipsimu/templates/game/technology/signal_modulation.xml new file mode 100644 index 0000000..186a569 --- /dev/null +++ b/application/shipsimu/templates/game/technology/signal_modulation.xml @@ -0,0 +1,52 @@ + + + + + + signal_modulation + electronics + + + + + + + + transistor + electronics + 3 + + + + + + + modulation + {?research_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/technology/sound_equalizer.xml b/application/shipsimu/templates/game/technology/sound_equalizer.xml new file mode 100644 index 0000000..8d10f58 --- /dev/null +++ b/application/shipsimu/templates/game/technology/sound_equalizer.xml @@ -0,0 +1,53 @@ + + + + + + sound_equalizer + electronic + + + + + + + + transistor + electronics + 5 + + + + + + + + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/sound_processor.xml b/application/shipsimu/templates/game/technology/sound_processor.xml new file mode 100644 index 0000000..d223b4f --- /dev/null +++ b/application/shipsimu/templates/game/technology/sound_processor.xml @@ -0,0 +1,58 @@ + + + + + + sound_processor + electronic + + + + + + + + intergrated_current + electronics + 7 + + + surround_mixing + electronics + 1 + + + + + + + + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/surround_mixing.xml b/application/shipsimu/templates/game/technology/surround_mixing.xml new file mode 100644 index 0000000..9c674de --- /dev/null +++ b/application/shipsimu/templates/game/technology/surround_mixing.xml @@ -0,0 +1,53 @@ + + + + + + surround_mixing + electronic + + + + + + + + intergrated_current + electronics + 6 + + + + + + + + {?research_name?} + {?research_type?} + {?research_level?} + + + + diff --git a/application/shipsimu/templates/game/technology/transistor.xml b/application/shipsimu/templates/game/technology/transistor.xml new file mode 100644 index 0000000..f41d448 --- /dev/null +++ b/application/shipsimu/templates/game/technology/transistor.xml @@ -0,0 +1,58 @@ + + + + + + transistor + eletronics + + + + + + + + semiconductor + electronics + 1 + + + plastics + chemicals + 5 + + + + + + + + silicium_mining + {?research_type?} + 1 + + + + diff --git a/application/shipsimu/templates/game/technology/video_receiving.xml b/application/shipsimu/templates/game/technology/video_receiving.xml new file mode 100644 index 0000000..353d40a --- /dev/null +++ b/application/shipsimu/templates/game/technology/video_receiving.xml @@ -0,0 +1,53 @@ + + + + + + video_receiving + eletronics + + + + + + + + signal_amplifying + electronics + 1 + + + signal_modulation + electronics + 1 + + + transistor + electronics + 1 + + + + diff --git a/application/shipsimu/templates/game/types/.htaccess b/application/shipsimu/templates/game/types/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/types/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/types/building_types.xml b/application/shipsimu/templates/game/types/building_types.xml new file mode 100644 index 0000000..58da39a --- /dev/null +++ b/application/shipsimu/templates/game/types/building_types.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/application/shipsimu/templates/game/types/container_types.xml b/application/shipsimu/templates/game/types/container_types.xml new file mode 100644 index 0000000..46a0c35 --- /dev/null +++ b/application/shipsimu/templates/game/types/container_types.xml @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/application/shipsimu/templates/game/types/content_types.xml b/application/shipsimu/templates/game/types/content_types.xml new file mode 100644 index 0000000..f2853a6 --- /dev/null +++ b/application/shipsimu/templates/game/types/content_types.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/types/contract_types.xml b/application/shipsimu/templates/game/types/contract_types.xml new file mode 100644 index 0000000..1e1ce09 --- /dev/null +++ b/application/shipsimu/templates/game/types/contract_types.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/types/electronic_types.xml b/application/shipsimu/templates/game/types/electronic_types.xml new file mode 100644 index 0000000..a5248dd --- /dev/null +++ b/application/shipsimu/templates/game/types/electronic_types.xml @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/application/shipsimu/templates/game/types/engine_types.xml b/application/shipsimu/templates/game/types/engine_types.xml new file mode 100644 index 0000000..ea42838 --- /dev/null +++ b/application/shipsimu/templates/game/types/engine_types.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/application/shipsimu/templates/game/types/farmer_types.xml b/application/shipsimu/templates/game/types/farmer_types.xml new file mode 100644 index 0000000..a11f5cc --- /dev/null +++ b/application/shipsimu/templates/game/types/farmer_types.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/types/fuel_types.xml b/application/shipsimu/templates/game/types/fuel_types.xml new file mode 100644 index 0000000..00399a4 --- /dev/null +++ b/application/shipsimu/templates/game/types/fuel_types.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/application/shipsimu/templates/game/types/merchant_types.xml b/application/shipsimu/templates/game/types/merchant_types.xml new file mode 100644 index 0000000..878359f --- /dev/null +++ b/application/shipsimu/templates/game/types/merchant_types.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/types/owner_occupants.xml b/application/shipsimu/templates/game/types/owner_occupants.xml new file mode 100644 index 0000000..e72ceea --- /dev/null +++ b/application/shipsimu/templates/game/types/owner_occupants.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/types/product_types.xml b/application/shipsimu/templates/game/types/product_types.xml new file mode 100644 index 0000000..8c82ddc --- /dev/null +++ b/application/shipsimu/templates/game/types/product_types.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/types/research_types.xml b/application/shipsimu/templates/game/types/research_types.xml new file mode 100644 index 0000000..0fc7280 --- /dev/null +++ b/application/shipsimu/templates/game/types/research_types.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/application/shipsimu/templates/game/types/ship_types.xml b/application/shipsimu/templates/game/types/ship_types.xml new file mode 100644 index 0000000..2d47c7b --- /dev/null +++ b/application/shipsimu/templates/game/types/ship_types.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/types/signer_types.xml b/application/shipsimu/templates/game/types/signer_types.xml new file mode 100644 index 0000000..611853a --- /dev/null +++ b/application/shipsimu/templates/game/types/signer_types.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/application/shipsimu/templates/game/types/tank_types.xml b/application/shipsimu/templates/game/types/tank_types.xml new file mode 100644 index 0000000..2aa4d22 --- /dev/null +++ b/application/shipsimu/templates/game/types/tank_types.xml @@ -0,0 +1,26 @@ + + + + diff --git a/application/shipsimu/templates/game/types/technology_types.xml b/application/shipsimu/templates/game/types/technology_types.xml new file mode 100644 index 0000000..b139d89 --- /dev/null +++ b/application/shipsimu/templates/game/types/technology_types.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/shipsimu/templates/game/vegetable/.htaccess b/application/shipsimu/templates/game/vegetable/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/templates/game/vegetable/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/templates/game/vegetable/base_vegetable.xml b/application/shipsimu/templates/game/vegetable/base_vegetable.xml new file mode 100644 index 0000000..80925e5 --- /dev/null +++ b/application/shipsimu/templates/game/vegetable/base_vegetable.xml @@ -0,0 +1,26 @@ + + + + diff --git a/core b/core new file mode 160000 index 0000000..c776f0a --- /dev/null +++ b/core @@ -0,0 +1 @@ +Subproject commit c776f0aeecb50d67e57b30c61bc84d80192090c2 diff --git a/inc b/inc new file mode 120000 index 0000000..1f8dea2 --- /dev/null +++ b/inc @@ -0,0 +1 @@ +core/inc \ No newline at end of file