From 4dcdc446d626eaa5fcc7ac705067d9656a82c18e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 25 Feb 2023 14:23:55 +0100 Subject: [PATCH] Continued: - updated a bit old ways (lesser monolithic) - udpated 'core' framework --- .../selector/class_ApplicationHelper.php | 6 ++--- .../selector/class_ApplicationSelector.php | 4 ++-- application/selector/exceptions.php | 2 +- .../classes/bank/money/class_MoneyBank.php | 6 ++--- .../web/class_WebShipsimuProfileCommand.php | 2 +- ...lass_WebGovernmentFailedStartupCommand.php | 2 +- ...ass_WebGovernmentFailedTrainingCommand.php | 2 +- .../companies/class_ShippingCompany.php | 24 +++++++++---------- ...hipSimuGovernmentPaysStartupHelpFilter.php | 2 +- ...s_ShipSimuGovernmentPaysTrainingFilter.php | 2 +- .../filter/page/class_RefillPageFilter.php | 2 +- .../class_RefillRequestValidatorFilter.php | 2 +- .../class_ShipSimuUserStatusGuestFilter.php | 2 +- .../government/class_SimplifiedGovernment.php | 4 ++-- .../login/class_ShipSimuGuestLogin.php | 4 ++-- .../classes/login/class_ShipSimuUserLogin.php | 4 ++-- .../helper/class_ShipSimuLoginHelper.php | 2 +- .../personell/class_SimulatorPersonell.php | 8 +++---- .../company/class_CompanyEmployee.php | 2 +- .../class_ShipSimuRegistration.php | 4 ++-- .../class_ShipSimuHtmlControllerResolver.php | 2 +- .../shipsimu/classes/ships/class_BaseShip.php | 4 ++-- .../ships/passenger/class_PassengerShip.php | 8 +++---- .../classes/user/class_ShipSimuBaseUser.php | 6 ++--- .../user/extended/class_ShipSimuGuest.php | 2 +- .../user/extended/class_ShipSimuMember.php | 10 ++++---- .../wrapper/class_CompanyDatabaseWrapper.php | 4 ++-- .../class_NoShipyardsConstructedException.php | 2 +- .../code/action_ship_simu_login_company.ctp | 2 +- ...hip_simu_login_government_startup_help.ctp | 2 +- ...on_ship_simu_login_government_training.ctp | 2 +- .../code/action_ship_simu_login_profile.ctp | 24 +++++++++---------- .../de/code/action_ship_simu_login_refill.ctp | 2 +- .../de/code/government_failed_main.ctp | 2 +- .../shipsimu/templates/de/code/login_form.ctp | 4 ++-- .../shipsimu/templates/de/code/login_main.ctp | 2 +- .../templates/de/code/register_form.ctp | 24 +++++++++---------- core | 2 +- 38 files changed, 95 insertions(+), 95 deletions(-) diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index c3b74da..dd4ee5c 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -78,7 +78,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Is the instance there? if (is_null(self::$selfInstance)) { self::$selfInstance = new ApplicationHelper(); - } // END - if + } // Return the instance return self::$selfInstance; @@ -167,7 +167,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Then use it $response = strtolower($requestInstance->getRequestElement('request')); $responseType = $response; - } // END - if + } // ... and a new response object $responseClass = sprintf('%sResponse', self::convertToClassName($response)); @@ -186,7 +186,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Set it in request $requestInstance->setRequestElement('command', $commandName); - } // END - if + } // Get a controller resolver $resolverClass = self::convertToClassName($this->getAppShortName() . '_' . $responseType . '_controller_resolver'); diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index 381dd56..1a7aa40 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -112,7 +112,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Add the current instance to the list $this->foundApps->append($app); - } // END - if ((is_file(... + } ((is_file(... } /** @@ -175,7 +175,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Load the application's data.php script and append the // application to the ArrayObject $this->loadApplicationData($appData, $appName); - } // END - if + } } // END - while // Close directory pointer diff --git a/application/selector/exceptions.php b/application/selector/exceptions.php index d653e5e..510f7d5 100644 --- a/application/selector/exceptions.php +++ b/application/selector/exceptions.php @@ -63,7 +63,7 @@ function __assertHandler ($file, $line, $code) { // Empty code? if (empty($code)) { $code = 'Unknown'; - } // END - if + } // Create message $message = sprintf('File: %s, Line: %s, Code: %s', diff --git a/application/shipsimu/classes/bank/money/class_MoneyBank.php b/application/shipsimu/classes/bank/money/class_MoneyBank.php index f35e756..67029da 100644 --- a/application/shipsimu/classes/bank/money/class_MoneyBank.php +++ b/application/shipsimu/classes/bank/money/class_MoneyBank.php @@ -55,7 +55,7 @@ class MoneyBank extends BaseBank implements Registerable { * @return $lendsMoreMoney Wether this bank lends more money to the user */ public function ifBankLendsMoreMoney () { - $this->partialStub(); + DebugMiddleware::getSelfInstance()->partialStub(); } /** @@ -64,7 +64,7 @@ class MoneyBank extends BaseBank implements Registerable { * @return $hasMaximumCredits Wether the user has maximum allowed credits */ public function ifUserHasMaxCredits () { - $this->partialStub(); + DebugMiddleware::getSelfInstance()->partialStub(); } /** @@ -83,7 +83,7 @@ class MoneyBank extends BaseBank implements Registerable { // 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; diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php index 37d2c5e..1a2134a 100644 --- a/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php +++ b/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php @@ -107,7 +107,7 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable { unset($this->allowedData); // Unfinished! - $this->partialStub("Unfinished work."); + DebugMiddleware::getSelfInstance()->partialStub('Unfinished work.'); $this->debugBackTrace(); } diff --git a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php index 52824c4..ccf4a3e 100644 --- a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php +++ b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php @@ -66,7 +66,7 @@ class WebGovernmentFailedStartupCommand extends BaseCommand implements Commandab 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(); diff --git a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php index 4a6bf01..db2afe8 100644 --- a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php +++ b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php @@ -66,7 +66,7 @@ class WebGovernmentFailedTrainingCommand extends BaseCommand implements Commanda 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(); diff --git a/application/shipsimu/classes/companies/class_ShippingCompany.php b/application/shipsimu/classes/companies/class_ShippingCompany.php index 7263f0b..9601126 100644 --- a/application/shipsimu/classes/companies/class_ShippingCompany.php +++ b/application/shipsimu/classes/companies/class_ShippingCompany.php @@ -92,7 +92,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // 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(); @@ -124,7 +124,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner if ($resultInstance instanceof SearchableResult) { // Set the result instance $this->setResultInstance($resultInstance); - } // END - if + } // Return result return $participates; @@ -146,8 +146,8 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Is it set? if ($resultInstance instanceof SearchableResult) { // Result found so analyse it - $this->partialStub("Check if user is company founder."); - } // END - if + DebugMiddleware::getSelfInstance()->partialStub('Check if user is company founder.'); + } // Return result return $isFounder; @@ -169,8 +169,8 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Is it set? if ($resultInstance instanceof SearchableResult) { // Result found so analyse it - $this->partialStub("Check if user is company owner."); - } // END - if + DebugMiddleware::getSelfInstance()->partialStub('heck if user is company owner.'); + } // Return result return $isOwner; @@ -192,7 +192,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner if ($resultInstance instanceof SearchableResult) { // Result found so he is employee $isEmployee = true; - } // END - if + } // Return result return $isEmployee; @@ -240,7 +240,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $dummy = explode(" ", $this->getCompanyName()); foreach ($dummy as $part) { $this->shortName .= substr($part, 0, 1); - } // END - if + } } // Reedereien Werften bauen lassen @@ -304,7 +304,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner 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 @@ -328,7 +328,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner 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(); @@ -392,7 +392,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner if ($shipyardIter->valid() === false) { // Rewind to first position $shipyardIter->seek(0); - } // END - if + } // Get Shipyard object $shipyard = $shipyardIter->current(); @@ -603,7 +603,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner 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)) { diff --git a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php index f02219d..98e1e23 100644 --- a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php +++ b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php @@ -70,6 +70,6 @@ class ShipSimuGovernmentPaysStartupHelpFilter extends BaseShipSimuFilter impleme // Stop processing here exit; - } // END - if + } } } diff --git a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php index f90d1b9..c6117fb 100644 --- a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php +++ b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php @@ -70,6 +70,6 @@ class ShipSimuGovernmentPaysTrainingFilter extends BaseShipSimuFilter implements // Stop processing here exit; - } // END - if + } } } diff --git a/application/shipsimu/classes/filter/page/class_RefillPageFilter.php b/application/shipsimu/classes/filter/page/class_RefillPageFilter.php index b114ca0..9badacd 100644 --- a/application/shipsimu/classes/filter/page/class_RefillPageFilter.php +++ b/application/shipsimu/classes/filter/page/class_RefillPageFilter.php @@ -67,6 +67,6 @@ class RefillPageFilter extends BaseShipSimuFilter implements Filterable { // Abort here throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if + } } } diff --git a/application/shipsimu/classes/filter/validator/class_RefillRequestValidatorFilter.php b/application/shipsimu/classes/filter/validator/class_RefillRequestValidatorFilter.php index 351c643..042fdc5 100644 --- a/application/shipsimu/classes/filter/validator/class_RefillRequestValidatorFilter.php +++ b/application/shipsimu/classes/filter/validator/class_RefillRequestValidatorFilter.php @@ -68,6 +68,6 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera // Abort here throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if + } } } diff --git a/application/shipsimu/classes/filter/validator/class_ShipSimuUserStatusGuestFilter.php b/application/shipsimu/classes/filter/validator/class_ShipSimuUserStatusGuestFilter.php index 06e0996..eb4315d 100644 --- a/application/shipsimu/classes/filter/validator/class_ShipSimuUserStatusGuestFilter.php +++ b/application/shipsimu/classes/filter/validator/class_ShipSimuUserStatusGuestFilter.php @@ -71,6 +71,6 @@ class ShipSimuUserStatusGuestFilter extends BaseShipSimuFilter implements Filter // Stop processing here exit; - } // END - if + } } } diff --git a/application/shipsimu/classes/government/class_SimplifiedGovernment.php b/application/shipsimu/classes/government/class_SimplifiedGovernment.php index 89d4a51..5e44b32 100644 --- a/application/shipsimu/classes/government/class_SimplifiedGovernment.php +++ b/application/shipsimu/classes/government/class_SimplifiedGovernment.php @@ -87,7 +87,7 @@ class SimplifiedGovernment extends BaseFrameworkSystem implements Registerable { // Entry was found so the government can no more pay a training $alreadyPayed = true; - } // END - if + } // Return the result return $alreadyPayed; @@ -126,7 +126,7 @@ class SimplifiedGovernment extends BaseFrameworkSystem implements Registerable { // Entry found, so lets have a look if this government wants to again... $maximumPayed = true; - } // END - if + } // Return the result return $maximumPayed; diff --git a/application/shipsimu/classes/login/class_ShipSimuGuestLogin.php b/application/shipsimu/classes/login/class_ShipSimuGuestLogin.php index 802749b..a30c272 100644 --- a/application/shipsimu/classes/login/class_ShipSimuGuestLogin.php +++ b/application/shipsimu/classes/login/class_ShipSimuGuestLogin.php @@ -72,7 +72,7 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser, R 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. @@ -120,6 +120,6 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser, R // Store the hash back in request $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); - } // END - if + } } } diff --git a/application/shipsimu/classes/login/class_ShipSimuUserLogin.php b/application/shipsimu/classes/login/class_ShipSimuUserLogin.php index 43e7c20..a70bbaf 100644 --- a/application/shipsimu/classes/login/class_ShipSimuUserLogin.php +++ b/application/shipsimu/classes/login/class_ShipSimuUserLogin.php @@ -75,7 +75,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser, Re if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { // Mismatching password throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); - } // END - if + } // ToDo place @@ -125,6 +125,6 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser, Re // Store the hash back in request $this->getRequestInstance()->setRequestElement('pass_hash', $this->hashedPassword); - } // END - if + } } } diff --git a/application/shipsimu/classes/login/helper/class_ShipSimuLoginHelper.php b/application/shipsimu/classes/login/helper/class_ShipSimuLoginHelper.php index 3a7c66d..26e10ed 100644 --- a/application/shipsimu/classes/login/helper/class_ShipSimuLoginHelper.php +++ b/application/shipsimu/classes/login/helper/class_ShipSimuLoginHelper.php @@ -67,7 +67,7 @@ class ShipSimuLoginHelper extends BaseLoginHelper implements HelpableLogin { 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(); diff --git a/application/shipsimu/classes/personell/class_SimulatorPersonell.php b/application/shipsimu/classes/personell/class_SimulatorPersonell.php index a0d0206..27b6202 100644 --- a/application/shipsimu/classes/personell/class_SimulatorPersonell.php +++ b/application/shipsimu/classes/personell/class_SimulatorPersonell.php @@ -129,10 +129,10 @@ class SimulatorPersonell extends BasePersonell { 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"); + $this->personellList = new FrameworkArrayObject('FakedPersonellList'); } // Remove the personell list @@ -171,7 +171,7 @@ class SimulatorPersonell extends BasePersonell { * * @return $cacheList A list of cached personells */ - function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = "") { + function getSpecialPersonellList ($isEmployed = null, $isMarried = null, $hasGender = '') { // Serialize the conditions for checking if we can take the cache $serialized = serialize(array($isEmployed, $isMarried, $hasGender)); @@ -295,7 +295,7 @@ class SimulatorPersonell extends BasePersonell { // Set typical family name parent::setFamily("Smith"); - } // END - if + } // Return surname return $surname; diff --git a/application/shipsimu/classes/personell/company/class_CompanyEmployee.php b/application/shipsimu/classes/personell/company/class_CompanyEmployee.php index a376c00..300c936 100644 --- a/application/shipsimu/classes/personell/company/class_CompanyEmployee.php +++ b/application/shipsimu/classes/personell/company/class_CompanyEmployee.php @@ -50,7 +50,7 @@ class CompanyEmployee extends SimulatorPersonell { 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); diff --git a/application/shipsimu/classes/registration/class_ShipSimuRegistration.php b/application/shipsimu/classes/registration/class_ShipSimuRegistration.php index 64c34d5..aa13a2b 100644 --- a/application/shipsimu/classes/registration/class_ShipSimuRegistration.php +++ b/application/shipsimu/classes/registration/class_ShipSimuRegistration.php @@ -166,7 +166,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister { 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) { @@ -189,7 +189,7 @@ class ShipSimuRegistration extends BaseRegistration implements UserRegister { 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 diff --git a/application/shipsimu/classes/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php b/application/shipsimu/classes/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php index 6e4d3b9..24a7a3b 100644 --- a/application/shipsimu/classes/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php +++ b/application/shipsimu/classes/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php @@ -90,7 +90,7 @@ class ShipSimuHtmlControllerResolver extends BaseControllerResolver implements C if ((!is_object($controllerInstance)) || (!$controllerInstance instanceof Controller)) { // This command has an invalid instance! throw new InvalidControllerInstanceException(array($this, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); - } // END - if + } // Set last controller $this->setResolvedInstance($controllerInstance); diff --git a/application/shipsimu/classes/ships/class_BaseShip.php b/application/shipsimu/classes/ships/class_BaseShip.php index 73ab63d..796d9dc 100644 --- a/application/shipsimu/classes/ships/class_BaseShip.php +++ b/application/shipsimu/classes/ships/class_BaseShip.php @@ -69,7 +69,7 @@ class BaseShip extends BaseSimulator { 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); @@ -134,7 +134,7 @@ class BaseShip extends BaseSimulator { // STUB: Getter-Methode Anzahl Betten public function calcTotalBeds () { - $this->partialStub("Please implement this stub in your ship!"); + DebugMiddleware::getSelfInstance()->partialStub('Please implement this stub in your ship!'); } // Setter-Methode fuer Schiffsnamen diff --git a/application/shipsimu/classes/ships/passenger/class_PassengerShip.php b/application/shipsimu/classes/ships/passenger/class_PassengerShip.php index a1e3d5b..da9b0b6 100644 --- a/application/shipsimu/classes/ships/passenger/class_PassengerShip.php +++ b/application/shipsimu/classes/ships/passenger/class_PassengerShip.php @@ -49,7 +49,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { 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; @@ -73,9 +73,9 @@ class PassengerShip extends BaseShip implements ConstructableShip { if (!is_null($cab)) { // Kabinenbeschreibung holen $cabType = $cab->getObjectDescription(); - } // END - if - } // END - if - } // END - if + } + } + } } // END - for // Anzahl zurueckliefern diff --git a/application/shipsimu/classes/user/class_ShipSimuBaseUser.php b/application/shipsimu/classes/user/class_ShipSimuBaseUser.php index 6795a87..d6764ee 100644 --- a/application/shipsimu/classes/user/class_ShipSimuBaseUser.php +++ b/application/shipsimu/classes/user/class_ShipSimuBaseUser.php @@ -57,7 +57,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { // Store it in registry Registry::getRegistry()->addInstance('money_bank', $bankInstance); - } // END - if + } // Return the instance return $bankInstance; @@ -87,7 +87,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { // Store it in registry Registry::getRegistry()->addInstance('government', $governmentInstance); - } // END - if + } // Return the prepared instance return $governmentInstance; @@ -148,7 +148,7 @@ class ShipSimuBaseUser extends BaseUser implements Registerable, Updateable { // 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); diff --git a/application/shipsimu/classes/user/extended/class_ShipSimuGuest.php b/application/shipsimu/classes/user/extended/class_ShipSimuGuest.php index ca2d531..dc09b0a 100644 --- a/application/shipsimu/classes/user/extended/class_ShipSimuGuest.php +++ b/application/shipsimu/classes/user/extended/class_ShipSimuGuest.php @@ -58,7 +58,7 @@ class ShipSimuGuest extends ShipSimuBaseUser implements ManageableGuest { 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; diff --git a/application/shipsimu/classes/user/extended/class_ShipSimuMember.php b/application/shipsimu/classes/user/extended/class_ShipSimuMember.php index 0f425fa..64a5afa 100644 --- a/application/shipsimu/classes/user/extended/class_ShipSimuMember.php +++ b/application/shipsimu/classes/user/extended/class_ShipSimuMember.php @@ -66,7 +66,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka 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; @@ -132,7 +132,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka // 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'); @@ -184,7 +184,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka // And store it in registry Registry::getRegistry()->addInstance('points', $pointsInstance); - } // END - if + } // Get the amount $amount = $requestInstance->getRequestElement('amount'); @@ -203,7 +203,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka if (!$this->getResultInstance() instanceof SearchableResult) { // Abort here return; - } // END - if + } // Do we have data to update? if ($this->getResultInstance()->ifDataNeedsFlush()) { @@ -212,6 +212,6 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember, Booka // Yes, then send the whole result to the database layer $wrapperInstance->doUpdateByResult($this->getResultInstance()); - } // END - if + } } } diff --git a/application/shipsimu/classes/wrapper/class_CompanyDatabaseWrapper.php b/application/shipsimu/classes/wrapper/class_CompanyDatabaseWrapper.php index 28257b1..a9f9065 100644 --- a/application/shipsimu/classes/wrapper/class_CompanyDatabaseWrapper.php +++ b/application/shipsimu/classes/wrapper/class_CompanyDatabaseWrapper.php @@ -61,7 +61,7 @@ class CompanyDatabaseWrapper extends BaseDatabaseWrapper { // Set the company instance if not null if (!is_null($companyInstance)) { $wrapperInstance->setCompanyInstance($companyInstance); - } // END - if + } // Return the instance return $wrapperInstance; @@ -97,7 +97,7 @@ class CompanyDatabaseWrapper extends BaseDatabaseWrapper { // Entry found for further analysis/processing $participates = true; - } // END - if + } // Return the result return $participates; diff --git a/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php b/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php index b767993..0449ea6 100644 --- a/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php +++ b/application/shipsimu/exceptions/class_NoShipyardsConstructedException.php @@ -30,7 +30,7 @@ class NoShipyardsConstructedException extends FrameworkException { $message = sprintf("[%s:] Keine Werften gefunden!", $class->__toString() ); - } // END - if + } // Call parent constructor parent::__construct($message, $code); 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 index ebe2fbd..c907595 100644 --- a/application/shipsimu/templates/de/code/action_ship_simu_login_company.ctp +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_company.ctp @@ -34,7 +34,7 @@ if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applicatio // 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'); 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 index 99c68f7..2f77d1a 100644 --- 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 @@ -29,7 +29,7 @@ $helperInstance->addInputPasswordField('password'); 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!"); 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 index 555c036..9c41efd 100644 --- 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 @@ -29,7 +29,7 @@ $helperInstance->addFormNote('profile', "Stimmen die Daten noch? {?shipsimu_prof 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!"); 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 index e4ec93c..083dd30 100644 --- a/application/shipsimu/templates/de/code/action_ship_simu_login_profile.ctp +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_profile.ctp @@ -29,12 +29,12 @@ if ($helperInstance->ifEmailChangeAllowed()) { 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."); @@ -59,8 +59,8 @@ if ($helperInstance->ifRegisterIncludesPersonaData()) { $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?"); @@ -74,35 +74,35 @@ $helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern 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()) { @@ -118,7 +118,7 @@ if ($helperInstance->ifRulesHaveChanged()) { 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."); 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 index 0481264..3dd4548 100644 --- a/application/shipsimu/templates/de/code/action_ship_simu_login_refill.ctp +++ b/application/shipsimu/templates/de/code/action_ship_simu_login_refill.ctp @@ -40,7 +40,7 @@ $helperInstance->addInputPasswordField('pass_old'); 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!"); diff --git a/application/shipsimu/templates/de/code/government_failed_main.ctp b/application/shipsimu/templates/de/code/government_failed_main.ctp index 6411bfb..078f035 100644 --- a/application/shipsimu/templates/de/code/government_failed_main.ctp +++ b/application/shipsimu/templates/de/code/government_failed_main.ctp @@ -17,7 +17,7 @@ $blockInstance->assignFieldWithFilter('user_status', "user_status_translator"); if ($blockInstance->ifIncludeRegistrationStamp()) { // Then assign it as well! $blockInstance->assignFieldWithFilter('registered', 'formatTimestamp'); -} // END - if +} // Flush the content out to a template variable $blockInstance->flushContent(); diff --git a/application/shipsimu/templates/de/code/login_form.ctp b/application/shipsimu/templates/de/code/login_form.ctp index b8a52e2..4f48dbd 100644 --- a/application/shipsimu/templates/de/code/login_form.ctp +++ b/application/shipsimu/templates/de/code/login_form.ctp @@ -36,7 +36,7 @@ if ($helperInstance->ifLoginIsEnabled()) { 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?"); @@ -62,7 +62,7 @@ if ($helperInstance->ifGuestLoginAllowed()) { 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"."); diff --git a/application/shipsimu/templates/de/code/login_main.ctp b/application/shipsimu/templates/de/code/login_main.ctp index 8c17459..efff9d9 100644 --- a/application/shipsimu/templates/de/code/login_main.ctp +++ b/application/shipsimu/templates/de/code/login_main.ctp @@ -18,7 +18,7 @@ $blockInstance->assignFieldWithFilter('points', 'format_number'); 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(); diff --git a/application/shipsimu/templates/de/code/register_form.ctp b/application/shipsimu/templates/de/code/register_form.ctp index 738b3b8..86812b8 100644 --- a/application/shipsimu/templates/de/code/register_form.ctp +++ b/application/shipsimu/templates/de/code/register_form.ctp @@ -26,8 +26,8 @@ if ($helperInstance->ifRegisterRequiresEmailVerification()) { // 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()) { @@ -41,8 +41,8 @@ if ($helperInstance->ifRegisterIncludesProfile()) { // 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()) { @@ -64,8 +64,8 @@ if ($helperInstance->ifRegisterIncludesProfile()) { $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:"); @@ -76,27 +76,27 @@ if ($helperInstance->ifRegisterIncludesProfile()) { 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."); @@ -113,7 +113,7 @@ $helperInstance->addInputCheckboxField('rules', false); 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."); diff --git a/core b/core index ba76f13..3e492b8 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit ba76f1380ebef3021b78d122cbabd6fe3173cd47 +Subproject commit 3e492b83a49b96805aff4f46882773f2bcf1fad9 -- 2.39.5