From bbf48d46cb9063a4d2b78c106747147712f5474e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 15 Nov 2008 18:42:03 +0000 Subject: [PATCH] - XHTML errors/warnings fixed in some pages - Auto-close/open HTML comments added for debugging - Form-stub for training payed by goverment added - Some rewrites (do we want "=== false" or "!== true" in boolean expressions?) --- .gitattributes | 4 + .../admin/main/login/class_AdminUserLogin.php | 2 +- application/ship-simu/config.php | 3 + .../class_WebShipSimuLoginCompanyAction.php | 5 +- ...ebShipSimuLoginGovermentTrainingAction.php | 82 +++++++++++ .../class_WebShipSimuLoginRefillAction.php | 3 + .../ship-simu/main/class_BasePersonell.php | 6 +- .../ship-simu/main/class_WorksContract.php | 2 +- .../main/companies/class_ShippingCompany.php | 22 +-- .../ship-simu/main/filter/goverment/.htaccess | 1 + ...ss_ShipSimuGovermentPaysTrainingFilter.php | 79 ++++++++++ .../class_RefillRequestValidatorFilter.php | 2 +- .../main/login/class_ShipSimuGuestLogin.php | 2 +- .../main/login/class_ShipSimuUserLogin.php | 2 +- .../company/class_CompanyEmployee.php | 4 +- .../user/extended/class_ShipSimuGuest.php | 4 +- .../user/extended/class_ShipSimuMember.php | 4 +- .../code/action_ship_simu_login_company.ctp | 33 ++--- ...ship_simu_login_goverment_startup_help.ctp | 9 +- ...ion_ship_simu_login_goverment_training.ctp | 23 +++ .../de/code/action_ship_simu_login_logout.ctp | 12 +- .../code/action_ship_simu_login_profile.ctp | 134 ++++++++--------- .../de/code/action_ship_simu_login_refill.ctp | 48 +++---- .../action_ship_simu_login_status_problem.ctp | 40 +++--- .../templates/de/code/confirm_link.ctp | 6 +- .../templates/de/code/login_failed.ctp | 6 +- .../templates/de/code/login_form.ctp | 78 +++++----- .../templates/de/code/logout_done.ctp | 6 +- .../templates/de/code/register_form.ctp | 136 +++++++++--------- .../main/class_BaseFrameworkSystem.php | 21 ++- .../login/class_WebLoginAreaController.php | 3 +- .../web/class_WebLoginController.php | 6 - .../validator/class_EmailValidatorFilter.php | 2 +- .../class_UserNameValidatorFilter.php | 2 +- .../class_UserGuestVerifierFilter.php | 4 +- .../verifier/class_UserNameVerifierFilter.php | 4 +- .../class_UserUnconfirmedVerifierFilter.php | 2 +- inc/classes/main/helper/class_BaseHelper.php | 55 ++++--- .../helper/web/forms/class_WebFormHelper.php | 28 ++-- .../helper/web/links/class_WebLinkHelper.php | 62 ++++---- .../action/web/class_WebActionResolver.php | 6 +- .../image/class_ImageCommandResolver.php | 6 +- .../command/web/class_WebCommandResolver.php | 6 +- .../class_BaseControllerResolver.php | 2 +- .../image/class_ImageControllerResolver.php | 2 +- .../web/class_WebControllerResolver.php | 2 +- .../main/response/class_BaseResponse.php | 2 +- inc/classes/main/user/guest/class_Guest.php | 4 +- inc/classes/main/user/member/class_Member.php | 4 +- 49 files changed, 606 insertions(+), 375 deletions(-) create mode 100644 application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php create mode 100644 application/ship-simu/main/filter/goverment/.htaccess create mode 100644 application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php create mode 100644 application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp diff --git a/.gitattributes b/.gitattributes index b9367f2..878445b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -165,6 +165,7 @@ application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -te application/ship-simu/main/actions/web/.htaccess -text application/ship-simu/main/actions/web/class_WebShipSimuLogin -text application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php -text +application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php -text application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php -text application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php -text application/ship-simu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php -text @@ -203,6 +204,8 @@ application/ship-simu/main/drives/motor/class_Motor.php -text application/ship-simu/main/factories/.htaccess -text application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text application/ship-simu/main/filter/.htaccess -text +application/ship-simu/main/filter/goverment/.htaccess -text +application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php -text application/ship-simu/main/filter/page/.htaccess -text application/ship-simu/main/filter/page/class_RefillPageFilter.php -text application/ship-simu/main/filter/validator/.htaccess -text @@ -264,6 +267,7 @@ application/ship-simu/templates/.htaccess -text application/ship-simu/templates/de/.htaccess -text application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp -text application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp -text application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp -text application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp -text application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp -text diff --git a/application/admin/main/login/class_AdminUserLogin.php b/application/admin/main/login/class_AdminUserLogin.php index a314269..3cf2678 100644 --- a/application/admin/main/login/class_AdminUserLogin.php +++ b/application/admin/main/login/class_AdminUserLogin.php @@ -89,7 +89,7 @@ class AdminUserLogin extends BaseFrameworkSystem implements LoginableUser { } // END - if // Is the password correct? - if (!$userInstance->ifPasswordHashMatches($requestInstance)) { + if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { // Mismatching password throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); } // END - if diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index b2f3f32..ce4b96f 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -172,6 +172,9 @@ $cfg->setConfigEntry('refill_request_currency_book_filter', "RefillRequestCurren // CFG: PAYMENT-DISCOVERY-FILTER $cfg->setConfigEntry('payment_discovery_filter', "PaymentDiscoveryFilter"); +// CFG: GOVERMENT-PAYS-TRAINING-FILTER +$cfg->setConfigEntry('goverment_pays_training_filter', "ShipSimuGovermentPaysTrainingFilter"); + // CFG: NEWS-HOME-LIMIT $cfg->setConfigEntry('news_home_limit', 10); diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php index e4c3ed9..05fb35c 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php @@ -67,10 +67,11 @@ class WebShipSimuLoginCompanyAction extends BaseAction implements Commandable, R * @param $controllerInstance A controller instance * @param $requestInstance An instance of a class with an Requestable interface * @return void - * @todo Add some filters here + * @todo Add some more filters here */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Unfinished method + // Check for user status by default + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php new file mode 100644 index 0000000..e41c61e --- /dev/null +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php @@ -0,0 +1,82 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @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 WebShipSimuLoginGovermentTrainingAction extends BaseAction 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 createWebShipSimuLoginGovermentTrainingAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebShipSimuLoginGovermentTrainingAction(); + + // 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) { + // Unfinished method + } + + /** + * 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 goverment can pay a training + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_training_filter')); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php index 8d02747..8c4c004 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php @@ -69,6 +69,9 @@ class WebShipSimuLoginRefillAction extends BaseAction implements Commandable, Re * @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')); diff --git a/application/ship-simu/main/class_BasePersonell.php b/application/ship-simu/main/class_BasePersonell.php index 1234767..f59e8cf 100644 --- a/application/ship-simu/main/class_BasePersonell.php +++ b/application/ship-simu/main/class_BasePersonell.php @@ -75,7 +75,7 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { $year = mt_rand(($currYear - $this->MIN_AGE), ($currYear - $this->MAX_AGE)); $month = 0; $day = 0; - while (!$this->isDateValid($year, $month, $day)) { + while ($this->isDateValid($year, $month, $day) === false) { $month = mt_rand(1, 12); switch ($month) { case 1: @@ -104,8 +104,8 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { $day = mt_rand(1, 28); } break; - } // switch - END - } // while - END + } // END - switch + } // END - while // Set the new birthday $this->setBirthday($year, $month, $day); diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 7f61096..f56c2fa 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -138,7 +138,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { if (!$partInstance instanceof ConstructableShipPart) { // Ship part not constructable! throw new ShipPartNotConstructableException(array($shipPart), self::EXCEPTION_NOT_CONSTRUCTABLE); - } elseif (!$this->getShipInstance()->createShipPart($partInstance, $parentPart)) { + } 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() diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index 362a801..1d6877b 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -325,7 +325,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner $iterator->seek($pos); // Is the current position valid? - if (!$iterator->valid()) { + if ($iterator->valid() === false) { // Should normally not happen... :( throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS); } // END - if @@ -389,10 +389,10 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Iterate through all employees for ($idx = $this->employeeList->getIterator(); $idx->valid(); $idx->next()) { // Is the shipyard iterator still okay? - if (!$shipyardIter->valid()) { + if ($shipyardIter->valid() === false) { // Rewind to first position $shipyardIter->seek(0); - } + } // END - if // Get Shipyard object $shipyard = $shipyardIter->current(); @@ -404,7 +404,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } elseif ($shipyard->isClass("Shipyard") === false) { // Nope, so throw exception throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); } @@ -492,14 +492,14 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } 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 @@ -551,7 +551,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } elseif ($shipyard->isClass("Shipyard") === false) { // Class is not a shipyard throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); } @@ -561,7 +561,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // 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.", @@ -600,10 +600,10 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // 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)) { + 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)) { @@ -652,7 +652,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($contractInstance)) { // Not an object! ;-( throw new NoObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$contractInstance->isClass('WorksContract')) { + } elseif ($contractInstance->isClass("WorksContract") === false) { // Is not a merchant throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING); } diff --git a/application/ship-simu/main/filter/goverment/.htaccess b/application/ship-simu/main/filter/goverment/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/ship-simu/main/filter/goverment/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php b/application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php new file mode 100644 index 0000000..febd4bd --- /dev/null +++ b/application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php @@ -0,0 +1,79 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @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 ShipSimuGovermentPaysTrainingFilter extends BaseFrameworkSystem implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createShipSimuGovermentPaysTrainingFilter () { + // Get a new instance + $filterInstance = new ShipSimuGovermentPaysTrainingFilter(); + + // 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) { + // Get the user instance from registry + $userInstance = Registry::getRegistry()->getInstance('user'); + + // Now simply check for it + if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovermentPaysTraining() === false)) { + // Request is invalid + $requestInstance->requestIsValid(false); + + // Add a message to the response + $responseInstance->addFatalMessage('goverment_pays_no_training'); + + // Abort here + return false; + } // END - if + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php index 76fe612..06643e0 100644 --- a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php +++ b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php @@ -59,7 +59,7 @@ class RefillRequestValidatorFilter extends BaseFrameworkSystem implements Filter */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Are all required request fields set? - if ((!$requestInstance->isRequestElementSet('type')) || (!$requestInstance->isRequestElementSet('amount'))) { + if (($requestInstance->isRequestElementSet('type') === false) || ($requestInstance->isRequestElementSet('amount') === false)) { // Something important is missing $requestInstance->requestIsValid(false); diff --git a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php b/application/ship-simu/main/login/class_ShipSimuGuestLogin.php index ba7ac31..7336865 100644 --- a/application/ship-simu/main/login/class_ShipSimuGuestLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuGuestLogin.php @@ -103,7 +103,7 @@ class ShipSimuGuestLogin extends BaseFrameworkSystem implements LoginableUser { } // END - if // Is the password correct? - if (!$userInstance->ifPasswordHashMatches($requestInstance)) { + if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { // Mismatching password throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); } // END - if diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php index e354040..541e188 100644 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuUserLogin.php @@ -89,7 +89,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { } // END - if // Is the password correct? - if (!$userInstance->ifPasswordHashMatches($requestInstance)) { + if ($userInstance->ifPasswordHashMatches($requestInstance) === false) { // Mismatching password throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH); } // END - if diff --git a/application/ship-simu/main/personell/company/class_CompanyEmployee.php b/application/ship-simu/main/personell/company/class_CompanyEmployee.php index 3aee089..fde89e0 100644 --- a/application/ship-simu/main/personell/company/class_CompanyEmployee.php +++ b/application/ship-simu/main/personell/company/class_CompanyEmployee.php @@ -47,10 +47,10 @@ class CompanyEmployee extends SimulatorPersonell { } // Ist the given birthday valid? - if (!$personellInstance->isDateValid($year, $month, $day)) { + 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/ship-simu/main/user/extended/class_ShipSimuGuest.php b/application/ship-simu/main/user/extended/class_ShipSimuGuest.php index 69d7763..1f7ec55 100644 --- a/application/ship-simu/main/user/extended/class_ShipSimuGuest.php +++ b/application/ship-simu/main/user/extended/class_ShipSimuGuest.php @@ -55,10 +55,10 @@ class ShipSimuGuest extends ShipSimuBaseUser implements ManageableGuest { $userInstance->setUserName($userName); // Check if the username exists - if (!$userInstance->ifUsernameExists()) { + 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/ship-simu/main/user/extended/class_ShipSimuMember.php b/application/ship-simu/main/user/extended/class_ShipSimuMember.php index ed2673a..46fb2ed 100644 --- a/application/ship-simu/main/user/extended/class_ShipSimuMember.php +++ b/application/ship-simu/main/user/extended/class_ShipSimuMember.php @@ -63,10 +63,10 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember { $userInstance->setUserName($userName); // Check if the username exists - if (!$userInstance->ifUsernameExists()) { + 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/ship-simu/templates/de/code/action_ship_simu_login_company.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp index 2722364..00ec77a 100644 --- 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 @@ -11,23 +11,10 @@ $linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine virtue // Maximum of allowed companies reached? if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) { // No more companies allowed to found - $linkInstance->addLinkNote("Du hast zu viele Firmen gegründet. Bitte denke über eine Fusion (Zusammenlegung) nach."); + $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->addActionLink('company_found', "Gründe eine virtuelle Firma und mache dich (virtuell) selbstständig."); -} else { - // No more money left for founding company so place link here to refill page/money bank - if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { - // Display link to money bank page - $linkInstance->addActionLink('moneybank', "Jetzt zur Bank gehen und mehr {?currency?} leihen."); - } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { - // Maximum credits reached which a money bank can lent - $linkInstance->addLinkNote("Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); - $linkInstance->addActionLink('moneybank&sub=payback_credits', "Jetzt deinen Kredit tilgen."); - } else { - // Money bank is closed! - $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte später nochmal versuchen."); - } } // Add link group for goverment @@ -39,27 +26,37 @@ if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applicatio } elseif ($linkInstance->getValueInstance()->ifGovermentPaysTraining()) { // Goverment is able to pay a training in general $linkInstance->addActionLink('goverment_training', "Jetzt zur virtuellen Kurswelt und ein Training auswählen."); + + // Can the goverment pay startup help? + if ($linkInstance->getValueInstance()->ifGovermentPaysStartupHelp()) { + // Add link note + $linkInstance->addLinkNote('goverment_startup_help', "Virtuelle Starthilfe beantragen:"); + + // Display link to goverment for startup help + $linkInstance->addActionLink('goverment_startup_help', "Direkt zum Antragsformular für deine Starthilfe."); + } // END - if } elseif ($linkInstance->getValueInstance()->ifGovermentPaysStartupHelp()) { // Display link to goverment for startup help $linkInstance->addActionLink('goverment_startup_help', "Direkt zum Antragsformular für deine Starthilfe."); } else { // Even goverment cannot help the gamer here - $linkInstance->addLinkNote("Leider kann dir der Staat nicht mehr weiterhelfen, dich zu bewerben, da du zu oft Starthilfen erhalten hast. Hier muss aber noch weiter am Spiel gearbeitet werden. :-)"); + $linkInstance->addLinkNote('goverment_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. :-)"); } // Add link group for money bank $linkInstance->addLinkGroup('moneybank', "Leihe dir zu günstigen Zinsen virtuelles Geld aus, wenn du mehr brauchst!"); +// Add link to moneybank if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) { // Display link to money bank page $linkInstance->addActionLink('moneybank', "Jetzt zur virtuellen Bank gehen."); } elseif ($linkInstance->getValueInstance()->ifUserHasMaximumCreditsWithMoneyBank()) { // Maximum credits reached which a money bank can lent - $linkInstance->addLinkNote("Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); + $linkInstance->addLinkNote('moneybank_depleted', "Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zurück."); $linkInstance->addActionLink('moneybank_payback_credits', "Jetzt deinen Kredit tilgen."); } else { // Money bank is closed! - $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte später nochmal versuchen."); + $linkInstance->addLinkNote('moneybank_closed', "Die Bank hat derzeit geschlossen. Bitte später nochmal versuchen."); } // Add link group for refill page @@ -70,7 +67,7 @@ if ($linkInstance->ifRefillPageActive()) { $linkInstance->addActionLink('refill', "Jetzt dein virtuelles Geld aufladen."); } else { // Refill page not active - $linkInstance->addLinkNote("Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert."); + $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht möglich oder gestört und wurde von uns deaktiviert."); } // Flush content to the template diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp index 3c15204..8a73e0c 100644 --- a/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp +++ b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp @@ -1,12 +1,15 @@ prefetchValueInstance('user'); // Add main form group -$helper->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!"); +$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!"); // Flush the finished form -$helper->flushContent(); +$helperInstance->flushContent(); ?>
diff --git a/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp new file mode 100644 index 0000000..3e60274 --- /dev/null +++ b/application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp @@ -0,0 +1,23 @@ +prefetchValueInstance('user'); + +// Add main form group +$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausfüllen!"); + +// Flush the finished form +$helperInstance->flushContent(); + +?> +
+
+ Virtuelle Beantragung eines Training-Kursus +
+ +
+ {?shipsimu_training_form?} +
+
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 index 8e43002..748db67 100644 --- 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 @@ -1,21 +1,21 @@ addLinkWithTextById('logout_now_link_text'); +$helperInstance->addLinkWithTextById('logout_now_link_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); // Get helper instance -$helper = WebLinkHelper::createWebLinkHelper($this, 'return_login_link', 'index.php?app={?app_short_name?}&page=login_area'); +$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'return_login_link', 'index.php?app={?app_short_name?}&page=login_area'); // Set link text -$helper->addLinkWithTextById('return_login_link_text'); +$helperInstance->addLinkWithTextById('return_login_link_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); // [EOF] ?> 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 index bb78982..866489d 100644 --- 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 @@ -2,119 +2,119 @@ // Get helper instance for web forms. This will add the opening form-tag to // the helper's render cache which is simply a small variable in the class // BaseHelper. -$helper = WebFormHelper::createWebFormHelper($this, "shipsimu_profile"); +$helperInstance = WebFormHelper::createWebFormHelper($this, "shipsimu_profile"); // Pre-fetch field data with a given registry key -$helper->prefetchValueInstance('user'); +$helperInstance->prefetchValueInstance('user'); // Password can only be changed when the old one is entered and new one twice! -$helper->addFormGroup('pass', "Neues Passwort einrichten:"); -$helper->addFormSubGroup('pass', "Bitte gebe zum Ändern deines Passwortes zweimal das gewünschte neue Passwort ein."); -$helper->addFieldText('pass1', "Neues Passwort:"); -$helper->addInputPasswordField('pass1'); -$helper->addFieldText('pass2', "Neues Passwort, Wiederholung:"); -$helper->addInputPasswordField('pass2'); +$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 -$helper->addFormNote('current_email', "Derzeitige Email-Adresse: ".$helper->getValueField('email').""); +$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: ".$helperInstance->getValueField('email').""); // Only for changing email address -if ($helper->ifEmailChangeAllowed()) { - $helper->addFormGroup('email', "Änderung deiner Email-Addresse:"); - $helper->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese ändern möchtest!"); - $helper->addFieldText('email1', "Email-Adresse:"); - $helper->addInputTextField('email1'); - $helper->addFieldText('email2', "Wiederholung Email-Adresse:"); - $helper->addInputTextField('email2'); - - if ($helper->ifEmailMustBeUnique()) { - $helper->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); +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 - Unique email addresses - if ($helper->ifEmailChangeRequireConfirmation()) { - $helper->addFormNote('confirm_link', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an."); + if ($helperInstance->ifEmailChangeRequireConfirmation()) { + $helperInstance->addFormNote('confirm_link', "Es wird ein Bestätigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann möglichst schnell an."); } // END - Change requires confirmation } // END - email change allowed // Add form group for user profile -$helper->addFormGroup('profile', "Hier kannst du deine Profildaten ändern."); +$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten ändern."); // Persoenliche Daten mit in der Anmeldung abfragen? -if ($helper->ifRegisterIncludesPersonaData()) { - $helper->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); - $helper->addFieldText('surname', "Dein Vorname:"); - $helper->addInputTextFieldWithDefault('surname'); - $helper->addFieldText('family', "Dein Nachname:"); - $helper->addInputTextFieldWithDefault('family'); - $helper->addFieldText('street', "Strasse und Hausnummer:"); - $helper->addInputTextFieldWithDefault('street'); - $helper->addFieldText('city', "Wohnort:"); - $helper->addInputTextFieldWithDefault('city'); +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'); } // END - Persona data // Add su group for zip code -$helper->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); -$helper->addFieldText('zip', "Postleitzahl:"); -$helper->addInputTextFieldWithDefault('zip'); +$helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); +$helperInstance->addFieldText('zip', "Postleitzahl:"); +$helperInstance->addInputTextFieldWithDefault('zip'); // Add sub group for chat protocols -$helper->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); +$helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); // Add ICQ chat? -if ($helper->ifChatEnabled('icq')) { - $helper->addFieldText('icq', "ICQ-Nummer:"); - $helper->addInputTextFieldWithDefault('icq'); +if ($helperInstance->ifChatEnabled('icq')) { + $helperInstance->addFieldText('icq', "ICQ-Nummer:"); + $helperInstance->addInputTextFieldWithDefault('icq'); } // END - if // Add Jabber chat? -if ($helper->ifChatEnabled('jabber')) { - $helper->addFieldText('jabber', "Jabber:"); - $helper->addInputTextFieldWithDefault('jabber'); +if ($helperInstance->ifChatEnabled('jabber')) { + $helperInstance->addFieldText('jabber', "Jabber:"); + $helperInstance->addInputTextFieldWithDefault('jabber'); } // END - if // Add Yahoo! chat? -if ($helper->ifChatEnabled('yahoo')) { - $helper->addFieldText('yahoo', "Yahoo!:"); - $helper->addInputTextFieldWithDefault('yahoo'); +if ($helperInstance->ifChatEnabled('yahoo')) { + $helperInstance->addFieldText('yahoo', "Yahoo!:"); + $helperInstance->addInputTextFieldWithDefault('yahoo'); } // END - if // Add AOL chat? -if ($helper->ifChatEnabled('aol')) { - $helper->addFieldText('aol', "AOL-Screenname:"); - $helper->addInputTextFieldWithDefault('aol'); +if ($helperInstance->ifChatEnabled('aol')) { + $helperInstance->addFieldText('aol', "AOL-Screenname:"); + $helperInstance->addInputTextFieldWithDefault('aol'); } // END - if // Add MSN chat? -if ($helper->ifChatEnabled('msn')) { - $helper->addFieldText('msn', "MSN:"); - $helper->addInputTextFieldWithDefault('msn'); +if ($helperInstance->ifChatEnabled('msn')) { + $helperInstance->addFieldText('msn', "MSN:"); + $helperInstance->addInputTextFieldWithDefault('msn'); } // END - if -if (!$helper->ifRegisterRequiresEmailVerification()) { - $helper->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst."); +if (!$helperInstance->ifRegisterRequiresEmailVerification()) { + $helperInstance->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst."); } // END - Extra note // Rules already accepted? -if ($helper->ifRulesHaveChanged()) { - $helper->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); - $helper->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); - $helper->addInputCheckboxField('rules', false); +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 { - $helper->addFormNote('rules_accepted', "Du hast die aktuellen Spielregeln akzeptiert. Vielen Dank!"); - $helper->addInputHiddenField('rules', "1"); + $helperInstance->addFormNote('rules_accepted', "Du hast die aktuellen Spielregeln akzeptiert. Vielen Dank!"); + $helperInstance->addInputHiddenField('rules', "1"); } // Ask again for current account password -$helper->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Änderungen dein derzeitiges Passwort ein."); -$helper->addFieldText('pass_old', "Derzeitiges Passwort:"); -$helper->addInputPasswordField('pass_old'); +$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'); // Abschliessender Hinweis und Abschluss des Formulars -$helper->addFormGroup('buttons', "Sind alle Daten nun korrekt eingegeben? Dann sende sie mit einem Klick einfach ab!"); -$helper->addInputResetButton("Alles nochmal eingeben"); -$helper->addInputSubmitButton("Accountdaten aktualisieren"); -$helper->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); -$helper->flushContent(); +$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 Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); +$helperInstance->flushContent(); ?>
Deine Profildaten bearbeiten 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 index 305c404..b7af0c3 100644 --- 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 @@ -1,52 +1,52 @@ prefetchValueInstance('payments'); +$helperInstance->prefetchValueInstance('payments'); // Add form group -$helper->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an."); +$helperInstance->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an."); // Add sub group -$helper->addInputSelectField('type', "--- Bitte auswählen ---"); +$helperInstance->addInputSelectField('type', "--- Bitte auswählen ---"); // In-game currencies (if more than default add them here!) -$helper->addSelectSubOption('currencies', "--- Währungen ---"); -$helper->addSelectOption('currency', "{?currency?}"); +$helperInstance->addSelectSubOption('currencies', "--- Währungen ---"); +$helperInstance->addSelectOption('currency', "{?currency?}"); // Raw materials -$helper->addSelectSubOption('raw_materials', "--- Rohstoffe ---"); -$helper->addSelectOption('raw_wood', "Holz"); -$helper->addSelectOption('raw_iron', "Metall"); -$helper->addSelectOption('raw_stones', "Steine"); +$helperInstance->addSelectSubOption('raw_materials', "--- Rohstoffe ---"); +$helperInstance->addSelectOption('raw_wood', "Holz"); +$helperInstance->addSelectOption('raw_iron', "Metall"); +$helperInstance->addSelectOption('raw_stones', "Steine"); // This is needed to close the select tag -$helper->addInputSelectField('type', ""); +$helperInstance->addInputSelectField('type', ""); // Field for amount -$helper->addFormSubGroup('amount', "Gebe hier in ganzen Zahlen die Menge an, die du nachbestellen willst."); -$helper->addInputTextField('amount', 1000); +$helperInstance->addFormSubGroup('amount', "Gebe hier in ganzen Zahlen die Menge an, die du nachbestellen willst."); +$helperInstance->addInputTextField('amount', 1000); // Add payments -$helper->getValueInstance()->addResultsToHelper($helper); +$helperInstance->getValueInstance()->addResultsToHelper($helperInstance); // Ask again for current account password -$helper->addFormGroup('pass_old', "Bitte gebe zur Bestätigung der Nachbestellung dein derzeitiges Passwort ein."); -$helper->addFieldText('pass_old', "Derzeitiges Passwort:"); -$helper->addInputPasswordField('pass_old'); +$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 ($helper->ifFormSecuredWithCaptcha()) { - $helper->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:"); - $helper->addCaptcha(); +if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:"); + $helperInstance->addCaptcha(); } // END - if // Submit button -$helper->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!"); -$helper->addInputResetButton("Eingaben löschen"); -$helper->addInputSubmitButton("Nachbestellung verbindlich aufgeben"); -$helper->flushContent(); +$helperInstance->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!"); +$helperInstance->addInputResetButton("Eingaben löschen"); +$helperInstance->addInputSubmitButton("Nachbestellung verbindlich aufgeben"); +$helperInstance->flushContent(); ?>
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 index 88a47b1..a87303c 100644 --- 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 @@ -2,49 +2,49 @@ // Get helper instance for web forms. This will add the opening form-tag to // the helper's render cache which is simply a small variable in the class // BaseHelper. -$helper = WebFormHelper::createWebFormHelper($this, "resend_link"); +$helperInstance = WebFormHelper::createWebFormHelper($this, "resend_link"); // Pre-fetch field data with a given registry key -$helper->prefetchValueInstance('user'); +$helperInstance->prefetchValueInstance('user'); // Add submit button or notice -if ($helper->ifUserAccountUnconfirmed()) { +if ($helperInstance->ifUserAccountUnconfirmed()) { // Add submit button - $helper->addInputHiddenFieldWithDefault('email'); - $helper->addInputSubmitButton("Bestätigungslink erneut aussenden"); -} elseif ($helper->ifUserAccountLocked()) { + $helperInstance->addInputHiddenFieldWithDefault('email'); + $helperInstance->addInputSubmitButton("Bestätigungslink erneut aussenden"); +} elseif ($helperInstance->ifUserAccountLocked()) { // Account is locked - $helper->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre: - ".$helper->getValueField('lock_reason')." + $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 ($helper->ifUserAccountGuest()) { +} elseif ($helperInstance->ifUserAccountGuest()) { // Account is guest account - $helper->addFormNote('status_guest', "Gästeaccounts sind in der Funktionalität + $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 -$helper->flushContent(); +$helperInstance->flushContent(); -if ($helper->ifUserAccountUnconfirmed()) { +if ($helperInstance->ifUserAccountUnconfirmed()) { // Build the form for confirmation - $helper = WebFormHelper::createWebFormHelper($this, "confirm_code"); + $helperInstance = WebFormHelper::createWebFormHelper($this, "confirm_code"); // Add code box - $helper->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."); - $helper->addFieldText('code', "Bestätigungscode aus der Mail:"); - $helper->addInputTextField('code'); + $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 - $helper->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!"); - $helper->addInputResetButton("Nochmal eingeben"); - $helper->addInputSubmitButton("Bestätigungscode absenden"); + $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!"); + $helperInstance->addInputResetButton("Nochmal eingeben"); + $helperInstance->addInputSubmitButton("Bestätigungscode absenden"); // Flush content and automatically close the form - $helper->flushContent(); + $helperInstance->flushContent(); } // END - if ?>
diff --git a/application/ship-simu/templates/de/code/confirm_link.ctp b/application/ship-simu/templates/de/code/confirm_link.ctp index a3f7895..cf2d03f 100644 --- a/application/ship-simu/templates/de/code/confirm_link.ctp +++ b/application/ship-simu/templates/de/code/confirm_link.ctp @@ -1,12 +1,12 @@ addLinkWithTextById('direct_login_link_text'); +$helperInstance->addLinkWithTextById('direct_login_link_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); // [EOF] ?> diff --git a/application/ship-simu/templates/de/code/login_failed.ctp b/application/ship-simu/templates/de/code/login_failed.ctp index 07455ab..39bca5a 100644 --- a/application/ship-simu/templates/de/code/login_failed.ctp +++ b/application/ship-simu/templates/de/code/login_failed.ctp @@ -1,12 +1,12 @@ addLinkWithTextById('login_retry_text'); +$helperInstance->addLinkWithTextById('login_retry_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); // [EOF] ?> diff --git a/application/ship-simu/templates/de/code/login_form.ctp b/application/ship-simu/templates/de/code/login_form.ctp index fed90b3..86f81d3 100644 --- a/application/ship-simu/templates/de/code/login_form.ctp +++ b/application/ship-simu/templates/de/code/login_form.ctp @@ -2,81 +2,81 @@ // Get helper instance for web forms. This will add the opening form-tag to // the helper's render cache which is simply a small variable in the class // BaseHelper. -$helper = WebFormHelper::createWebFormHelper($this, 'shipsimu_user_login'); +$helperInstance = WebFormHelper::createWebFormHelper($this, 'shipsimu_user_login'); // Formular deaktiviert? -if ($helper->ifLoginIsEnabled()) { +if ($helperInstance->ifLoginIsEnabled()) { // Formular ist aktiv - $helper->addFormGroup('login', "Gebe hier deine Logindaten ein:"); + $helperInstance->addFormGroup('login', "Gebe hier deine Logindaten ein:"); // Welches Loginverfahren wurde konfiguriert? - if ($helper->ifLoginWithUsername()) { + if ($helperInstance->ifLoginWithUsername()) { // Login mit Username - $helper->addFormSubGroup('username', "Bitte mit deinem Nickname einloggen."); - $helper->addFieldText('username', "Dein Nickname:"); - $helper->addInputTextField('username'); - } elseif ($helper->ifLoginWithEmail()) { + $helperInstance->addFormSubGroup('username', "Bitte mit deinem Nickname einloggen."); + $helperInstance->addFieldText('username', "Dein Nickname:"); + $helperInstance->addInputTextField('username'); + } elseif ($helperInstance->ifLoginWithEmail()) { // Login mit Email - $helper->addFormSubGroup('email', "Bitte mit deiner Email-Adresse einloggen."); - $helper->addFieldText('email', "Deine Email-Addresse:"); - $helper->addInputTextField('email'); + $helperInstance->addFormSubGroup('email', "Bitte mit deiner Email-Adresse einloggen."); + $helperInstance->addFieldText('email', "Deine Email-Addresse:"); + $helperInstance->addInputTextField('email'); } else { // Login mit Email/Username - $helper->addFormSubGroup('user_email', "Bitte mit deinem Nickname oder Email-Adresse einloggen."); - $helper->addFieldText('user_email', "Dein Nickname/Email:"); - $helper->addInputTextField('user_email'); + $helperInstance->addFormSubGroup('user_email', "Bitte mit deinem Nickname oder Email-Adresse einloggen."); + $helperInstance->addFieldText('user_email', "Dein Nickname/Email:"); + $helperInstance->addInputTextField('user_email'); } - $helper->addFormSubGroup('pass', "Gebe dein Passwort von der Anmeldung ein."); - $helper->addFieldText('pass', "Dein Passwort:"); - $helper->addInputPasswordField('pass'); + $helperInstance->addFormSubGroup('pass', "Gebe dein Passwort von der Anmeldung ein."); + $helperInstance->addFieldText('pass', "Dein Passwort:"); + $helperInstance->addInputPasswordField('pass'); // CAPTCHA enabled? - if ($helper->ifFormSecuredWithCaptcha()) { - $helper->addFormGroup('captcha_user', "Unser Benuzter-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); - $helper->addCaptcha(); + if ($helperInstance->ifFormSecuredWithCaptcha()) { + $helperInstance->addFormGroup('captcha_user', "Unser Benuzter-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); + $helperInstance->addCaptcha(); } // END - if // Submit buttons - $helper->addFormGroup('buttons_user', "Alles richtig eingegeben?"); - $helper->addInputResetButton("Formular leeren"); - $helper->addInputSubmitButton("Zum Spiel einloggen"); + $helperInstance->addFormGroup('buttons_user', "Alles richtig eingegeben?"); + $helperInstance->addInputResetButton("Formular leeren"); + $helperInstance->addInputSubmitButton("Zum Spiel einloggen"); } else { // Formular deaktiviert - $helper->addFormNote('form_deactivated', "Einloggen in's Spiel ist derzeit administrativ deaktiviert worden. Bitte komme später noch mal wieder."); - $helper->addFormNote('admin_notice', "Nachricht vom Admin: ".$this->getConfigInstance()->readConfig('login_disabled_reason').""); + $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 -$helper->flushContent(); +$helperInstance->flushContent(); // Ist Gastlogin erlaubt? -if ($helper->ifGuestLoginAllowed()) { +if ($helperInstance->ifGuestLoginAllowed()) { // Neue Helper-Instanz holen - $helper = WebFormHelper::createWebFormHelper($this, 'shipsimu_guest_login'); - $helper->addInputHiddenConfiguredField('user', 'guest_login'); - $helper->addInputHiddenConfiguredField('passwd', 'guest_login'); + $helperInstance = WebFormHelper::createWebFormHelper($this, 'shipsimu_guest_login'); + $helperInstance->addInputHiddenConfiguredField('user', 'guest_login'); + $helperInstance->addInputHiddenConfiguredField('passwd', 'guest_login'); // CAPTCHA enbaled? - if ($helper->ifFormSecuredWithCaptcha()) { - $helper->addFormGroup('captcha_guest', "Unser Gast-Login ist durch ein CAPTCHA geschützt. Bitte wiederhole den angezeigten Code, damit du dich einloggen kannst."); - $helper->addCaptcha(); + 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 - $helper->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschränkt. Mehr dazu unter "Gastlogin"."); - $helper->addInputSubmitButton("Als Gast einloggen"); - $helper->flushContent(); + $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 -$helper = WebLinkHelper::createWebLinkHelper($this, 'register_login_form_link', 'index.php?app={?app_short_name?}&page=register'); +$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'register_login_form_link', 'index.php?app={?app_short_name?}&page=register'); // Set link text -$helper->addLinkWithTextById('register_login_form_link_text'); +$helperInstance->addLinkWithTextById('register_login_form_link_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); ?>
diff --git a/application/ship-simu/templates/de/code/logout_done.ctp b/application/ship-simu/templates/de/code/logout_done.ctp index 4eba180..8e44f11 100644 --- a/application/ship-simu/templates/de/code/logout_done.ctp +++ b/application/ship-simu/templates/de/code/logout_done.ctp @@ -1,12 +1,12 @@ addLinkWithTextById('relogin_link_text'); +$helperInstance->addLinkWithTextById('relogin_link_text'); // Flush the content -$helper->flushContent(); +$helperInstance->flushContent(); // [EOF] ?> diff --git a/application/ship-simu/templates/de/code/register_form.ctp b/application/ship-simu/templates/de/code/register_form.ctp index 7760229..70dc67d 100644 --- a/application/ship-simu/templates/de/code/register_form.ctp +++ b/application/ship-simu/templates/de/code/register_form.ctp @@ -2,109 +2,109 @@ // Get helper instance for web forms. This will add the opening form-tag to // the helper's render cache which is simply a small variable in the class // BaseHelper. -$helper = WebFormHelper::createWebFormHelper($this, 'shipsimu_register'); +$helperInstance = WebFormHelper::createWebFormHelper($this, 'shipsimu_register'); // Always ask at least for nickname and password -$helper->addFormGroup('login', "Bitte gebe hier gewünschten Nickname und dein Zugangspasswort ein."); -$helper->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."); -$helper->addFieldText('username', "Nickname im Spiel:"); -$helper->addInputTextField('username'); -$helper->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."); -$helper->addFieldText('pass1', "Passwort:"); -$helper->addInputPasswordField('pass1'); -$helper->addFieldText('pass2', "Passwortwiederholung:"); -$helper->addInputPasswordField('pass2'); - -if ($helper->ifRegisterRequiresEmailVerification()) { - $helper->addFormGroup('email', "Bitte gebe deine Email zweimal (ein zweites Mal zur Bestätigung) ein, damit wir dir deinen Freischaltlink zusenden können."); - $helper->addFieldText('email1', "Email-Adresse:"); - $helper->addInputTextField('email1'); - $helper->addFieldText('email2', "Wiederholung Email-Adresse:"); - $helper->addInputTextField('email2'); - - if ($helper->ifEmailMustBeUnique()) { - $helper->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); +$helperInstance->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'); + +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'); + + if ($helperInstance->ifEmailMustBeUnique()) { + $helperInstance->addFormNote('email', "Die von dir eingegebene Email-Adresse darf nur einmal im Spiel verwendet worden sein."); } // END - Unique email addresses } // END - email verification -if ($helper->ifRegisterIncludesProfile()) { - $helper->addFormGroup('profile', "Hier kannst du zusätzlich deine Profildaten vorweg eingeben, du kannst sie aber auch nach dem Login vervollständigen!"); +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 (!$helper->ifRegisterRequiresEmailVerification()) { - $helper->addFormSubGroup('email', "Die Angabe deiner Email-Adresse ist nur dann nötig, wenn du auch Email-Benachrichtigungen (*1) haben möchtest."); - $helper->addFieldText('email1', "Email-Adresse:"); - $helper->addInputTextField('email1'); + 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'); } // END - No email verification // Persoenliche Daten mit in der Anmeldung abfragen? - if ($helper->ifRegisterIncludesPersonaData()) { - $helper->addFormSubGroup('persona', "Wenn du magst, dann vervollständige deine komplette Adresse mit deinem Namen."); - $helper->addFieldText('surname', "Dein Vorname:"); - $helper->addInputTextField('surname'); - $helper->addFieldText('family', "Dein Nachname:"); - $helper->addInputTextField('family'); - $helper->addFieldText('street', "Strasse und Hausnummer:"); - $helper->addInputTextField('street'); - $helper->addFieldText('city', "Wohnort:"); - $helper->addInputTextField('city'); + 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'); } // END - Persona data - $helper->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); - $helper->addFieldText('zip', "Postleitzahl:"); - $helper->addInputTextField('zip'); + $helperInstance->addFormSubGroup('zip', "Magst du uns auch deine Postleitzahl verraten?"); + $helperInstance->addFieldText('zip', "Postleitzahl:"); + $helperInstance->addInputTextField('zip'); - $helper->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); + $helperInstance->addFormSubGroup('chat', "Gebe hier deine Nicknames bzw. Nummern an:"); - if ($helper->ifChatEnabled('icq')) { - $helper->addFieldText('icq', "ICQ-Nummer:"); - $helper->addInputTextField('icq'); + if ($helperInstance->ifChatEnabled('icq')) { + $helperInstance->addFieldText('icq', "ICQ-Nummer:"); + $helperInstance->addInputTextField('icq'); } // END - if - if ($helper->ifChatEnabled('jabber')) { - $helper->addFieldText('jabber', "Jabber:"); - $helper->addInputTextField('jabber'); + if ($helperInstance->ifChatEnabled('jabber')) { + $helperInstance->addFieldText('jabber', "Jabber:"); + $helperInstance->addInputTextField('jabber'); } // END - if - if ($helper->ifChatEnabled('yahoo')) { - $helper->addFieldText('yahoo', "Yahoo!:"); - $helper->addInputTextField('yahoo'); + if ($helperInstance->ifChatEnabled('yahoo')) { + $helperInstance->addFieldText('yahoo', "Yahoo!:"); + $helperInstance->addInputTextField('yahoo'); } // END - if - if ($helper->ifChatEnabled('aol')) { - $helper->addFieldText('aol', "AOL-Screenname:"); - $helper->addInputTextField('aol'); + if ($helperInstance->ifChatEnabled('aol')) { + $helperInstance->addFieldText('aol', "AOL-Screenname:"); + $helperInstance->addInputTextField('aol'); } // END - if - if ($helper->ifChatEnabled('msn')) { - $helper->addFieldText('msn', "MSN:"); - $helper->addInputTextField('msn'); + if ($helperInstance->ifChatEnabled('msn')) { + $helperInstance->addFieldText('msn', "MSN:"); + $helperInstance->addInputTextField('msn'); } // END - if - if (!$helper->ifRegisterRequiresEmailVerification()) { - $helper->addFormExtraNote(1, "Die Benachrichtigungen per sind im Loginbereich verfeinerbar, welche du genau haben willst."); + 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 -$helper->addFormGroup('rules', "Bitte lese dir die Spieleregeln gut durch und kreuze dann "Ja, ich akzeptiere die aktuellen Spielregeln" an."); -$helper->addFieldText('rules', "Ja, ich akzeptiere die aktuellen Spielregeln:"); -$helper->addInputCheckboxField('rules', false); +$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 ($helper->ifFormSecuredWithCaptcha()) { - $helper->addFormGroup('captcha', "Bitte wiederhole den angezeigten Code damit die Anmeldung abgeschlossen werden kann."); - $helper->addCaptcha(); +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 -$helper->addFormGroup('buttons', "Wenn du alle benötigten Felder korrekt ausgefüt hast, kannst du die Anmeldung abschliessen."); +$helperInstance->addFormGroup('buttons', "Wenn du alle benötigten Felder korrekt ausgefüt hast, kannst du die Anmeldung abschliessen."); -$helper->addInputResetButton("Alles nochmal eingeben"); -$helper->addInputSubmitButton("Anmeldung zum Spiel abschliessen"); -$helper->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); -$helper->flushContent(); +$helperInstance->addInputResetButton("Alles nochmal eingeben"); +$helperInstance->addInputSubmitButton("Anmeldung zum Spiel abschliessen"); +$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den gültigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link "Datenschutz"."); +$helperInstance->flushContent(); ?>
Anmeldung bei {?app_full_name?} diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 31fecee..ee34a87 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -192,8 +192,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Set real class $this->setRealClass($className); - // Initialize the class if the registry is there + // Initialize the class if the class Registry is there if ((class_exists('Registry')) && (Registry::isInitialized() === false)) { + // Initialize the registry automatically $this->initInstance(); } // END - if } @@ -748,14 +749,24 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { /** * Debugs this instance by putting out it's full content * + * @param $message Optional message to show in debug output * @return void */ - public final function debugInstance () { + public final function debugInstance ($message = "") { // Restore the error handler to avoid trouble with missing array elements or undeclared variables restore_error_handler(); + // Init content + $content = ""; + + // Is a message set? + if (!empty($message)) { + // Construct message + $content = sprintf("
Message: %s
\n", $message); + } // END - if + // Generate the output - $content = sprintf("
%s
", + $content .= sprintf("
%s
", trim( htmlentities( print_r($this, true) @@ -836,7 +847,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { if (is_object($debugInstance)) { // Use debug output handler $debugInstance->output($message); - if (!$doPrint) die(); // Die here if not printed + if ($doPrint === false) die(); // Die here if not printed } else { // Put directly out if ($doPrint) { @@ -971,7 +982,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->getResultInstance()->rewind(); // Do we have an entry? - if (!$this->getResultInstance()->valid()) { + if ($this->getResultInstance()->valid() === false) { throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT); } // END - if diff --git a/inc/classes/main/controller/login/class_WebLoginAreaController.php b/inc/classes/main/controller/login/class_WebLoginAreaController.php index 4e82ce1..67b388a 100644 --- a/inc/classes/main/controller/login/class_WebLoginAreaController.php +++ b/inc/classes/main/controller/login/class_WebLoginAreaController.php @@ -37,6 +37,7 @@ class WebLoginAreaController extends BaseController implements Controller { * * @param $resolverInstance An instance of a command resolver class * @return $controllerInstance A prepared instance of this class + * @todo Add some morer filters to this controller */ public final static function createWebLoginAreaController (CommandResolver $resolverInstance) { // Create the instance @@ -57,8 +58,6 @@ class WebLoginAreaController extends BaseController implements Controller { // News proccess/display-preparation $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); - /* @todo: Add some filters to this controller */ - // Return the prepared instance return $controllerInstance; } diff --git a/inc/classes/main/controller/web/class_WebLoginController.php b/inc/classes/main/controller/web/class_WebLoginController.php index 83964d2..f4ce053 100644 --- a/inc/classes/main/controller/web/class_WebLoginController.php +++ b/inc/classes/main/controller/web/class_WebLoginController.php @@ -47,12 +47,6 @@ class WebLoginController extends BaseController implements Controller { // Set the command resolver $controllerInstance->setResolverInstance($resolverInstance); - // 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')); - - // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); - // Return the prepared instance return $controllerInstance; } diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index feb819e..264c4e1 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -154,7 +154,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { } // Does the email exist? - if (!$userInstance->ifEmailAddressExists()) { + if ($userInstance->ifEmailAddressExists() === false) { // This email has not being used yet $alreadyTaken = false; } diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 522e77a..39bfee2 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -125,7 +125,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { } // Does the username exist? - if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) { + if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) { // This username is still available $alreadyTaken = false; } // END - if diff --git a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php index 75e00bd..cf44e53 100644 --- a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php @@ -78,7 +78,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { // Abort here return false; - } elseif (!$this->ifUserGuestIsTaken($userName)) { + } elseif ($this->ifUserGuestIsTaken($userName) === false) { // Username is already taken $requestInstance->requestIsValid(false); @@ -128,7 +128,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { } // Does the username exist? - if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) { + if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) { // This username is still available $alreadyTaken = false; } diff --git a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php index 7d0bde9..cab4380 100644 --- a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php @@ -78,7 +78,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { // Abort here return false; - } elseif (!$this->ifUserNameIsTaken($userName)) { + } elseif ($this->ifUserNameIsTaken($userName) === false) { // Username is already taken $requestInstance->requestIsValid(false); @@ -125,7 +125,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { } // Does the username exist? - if ((is_null($userInstance)) || (!$userInstance->ifUsernameExists())) { + if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) { // This username is still available $alreadyTaken = false; } // END - if diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php index e36fa38..c87942b 100644 --- a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -60,7 +60,7 @@ class UserUnconfirmedVerifierFilter extends BaseFrameworkSystem implements Filte $userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance)); // Is the email address valid? - if (!$userInstance->ifEmailAddressExists()) { + if ($userInstance->ifEmailAddressExists() === false) { // Request is invalid! $requestInstance->requestIsValid(false); diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php index 94f4ed5..b4e893f 100644 --- a/inc/classes/main/helper/class_BaseHelper.php +++ b/inc/classes/main/helper/class_BaseHelper.php @@ -226,11 +226,12 @@ class BaseHelper extends BaseFrameworkSystem { * * @param $groupId Group id to open * @param $content Initial content to add to the group + * @param $tag HTML tag used to open this group * @return void * @throws HelperGroupAlreadyCreatedException If the group was already created before */ - protected function openGroupByIdContent ($groupId, $content) { - //* DEBUG: */ echo "OPEN:groupId={$groupId}
\n"; + protected function openGroupByIdContent ($groupId, $content, $tag) { + //* DEBUG: */ echo "OPEN:groupId={$groupId},content=
".htmlentities($content)."
\n"; // Is the group already there? if (isset($this->groups[$groupId])) { // Then throw an exception here @@ -243,7 +244,8 @@ class BaseHelper extends BaseFrameworkSystem { // Add the group to the stack $this->groups[$this->totalCounter] = $groupId; $this->groups[$groupId]['opened'] = true; - $this->groups[$groupId]['content'] = $content."\n"; + $this->groups[$groupId]['content'] = sprintf("%s\n", $groupId, strlen($content), $tag, $content); + $this->groups[$groupId]['tag'] = $tag; // Mark this group as previously opened $this->setPreviousGroupId($groupId); @@ -253,13 +255,19 @@ class BaseHelper extends BaseFrameworkSystem { * Closes the previously opened group by added given content to it or * throws an exception if no previous group was opened * - * @param $content Content for previously opened grouop + * @param $content Content for previously opened group, or empty to use tag of opener * @return void * @throws HelperNoPreviousOpenedGroupException If no previously opened group was found */ - public function closePreviousGroupByContent ($content) { + public function closePreviousGroupByContent ($content = "") { + // Check if any sub group was opened before + if ($this->ifSubGroupOpenedPreviously()) { + // Close it automatically + $this->closePreviousSubGroupByContent(); + } // END - if + // Check if any group was opened before - if (!$this->ifGroupOpenedPreviously()) { + if ($this->ifGroupOpenedPreviously() === false) { // Then throw an exception throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED); } // END - if @@ -267,8 +275,14 @@ class BaseHelper extends BaseFrameworkSystem { // Get previous group $groupId = $this->getPreviousGroupId(); + // Is the content empty? + if ((empty($content)) && (!empty($this->groups[$groupId]['tag']))) { + // Get it from opener + $content = sprintf("", $groupId, $this->groups[$groupId]['tag']); + } // END - if + // Add content to it and mark it as closed - $this->groups[$groupId]['content'] .= $content."\n"; + $this->groups[$groupId]['content'] .= sprintf("%s\n", $groupId, strlen($content), $this->groups[$groupId]['tag'], $content); $this->groups[$groupId]['opened'] = false; // Mark previous group as closed @@ -283,10 +297,11 @@ class BaseHelper extends BaseFrameworkSystem { * * @param $subGroupId Sub group id to open * @param $content Initial content to add to the sub group + * @param $tag HTML tag used to open this group * @return void * @throws HelperSubGroupAlreadyCreatedException If the sub group was already created before */ - protected function openSubGroupByIdContent ($subGroupId, $content) { + protected function openSubGroupByIdContent ($subGroupId, $content, $tag) { //* DEBUG: */ echo "OPEN:subGroupId={$subGroupId},content=".htmlentities($content)."
\n"; // Is the group already there? if (isset($this->subGroups[$subGroupId])) { @@ -300,7 +315,8 @@ class BaseHelper extends BaseFrameworkSystem { // Add the group to the stack $this->subGroups[$this->totalCounter] = $subGroupId; $this->subGroups[$subGroupId]['opened'] = true; - $this->subGroups[$subGroupId]['content'] = $content."\n"; + $this->subGroups[$subGroupId]['content'] = sprintf("%s\n", $subGroupId, strlen($content), $tag, $content); + $this->subGroups[$subGroupId]['tag'] = $tag; // Mark this group as previously opened $this->setPreviousSubGroupId($subGroupId); @@ -310,13 +326,13 @@ class BaseHelper extends BaseFrameworkSystem { * Closes the previously opened sub group by added given content to it or * throws an exception if no previous sub group was opened * - * @param $content Content for previously opened sub grouop + * @param $content Content for previously opened sub group, or leave empty to use div/span of openener * @return void * @throws HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found */ - public function closePreviousSubGroupByContent ($content) { + public function closePreviousSubGroupByContent ($content = "") { // Check if any sub group was opened before - if (!$this->ifSubGroupOpenedPreviously()) { + if ($this->ifSubGroupOpenedPreviously() === false) { // Then throw an exception throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED); } // END - if @@ -324,8 +340,14 @@ class BaseHelper extends BaseFrameworkSystem { // Get previous sub group $subGroupId = $this->getPreviousSubGroupId(); + // Is the content empty? + if ((empty($content)) && (!empty($this->subGroups[$subGroupId]['tag']))) { + // Get it from opener + $content = sprintf("", $subGroupId, $this->subGroups[$subGroupId]['tag']); + } // END - if + // Add content to it and mark it as closed - $this->subGroups[$subGroupId]['content'] .= $content."\n"; + $this->subGroups[$subGroupId]['content'] .= sprintf("%s\n", $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content); $this->subGroups[$subGroupId]['opened'] = false; // Mark previous sub group as closed @@ -356,19 +378,18 @@ class BaseHelper extends BaseFrameworkSystem { // Is this a group and is it closed? if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) { // Then add it's content - $groupContent = $this->groups[$this->groups[$idx]]['content']; + $groupContent = trim($this->groups[$this->groups[$idx]]['content']); //* DEBUG: */ echo "group={$this->groups[$idx]},content=
".htmlentities($groupContent)."

\n"; $content .= $groupContent; } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) { // Then add it's content $subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content']; //* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=
".htmlentities($subGroupContent)."

\n"; - $content .= $subGroupContent; + $content .= trim($subGroupContent); } else { // Something went wrong - $this->debugInstance(); + $this->debugInstance(__METHOD__."(): Something unexpected happened here."); } - } // END - for // Is footer content there? diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index a188251..acb419a 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -378,7 +378,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // END - if // At least the group name should be set - if ((empty($groupId)) && (!$this->ifGroupOpenedPreviously())) { + if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) { // Throw exception here throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } elseif (empty($groupId)) { @@ -387,7 +387,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // Same group to open? - if ((!$this->ifGroupOpenedPreviously()) && ($groupId == $this->getPreviousGroupId())) { + if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) { // Abort here silently return false; } // END - if @@ -396,7 +396,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $content = "
\n
"; // Is this group opened? - if (!$this->ifGroupOpenedPreviously()) { + if ($this->ifGroupOpenedPreviously() === false) { // Begin the div/span blocks $content = sprintf("
@@ -412,7 +412,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { ); // Switch the state - $this->openGroupByIdContent($groupId, $content); + $this->openGroupByIdContent($groupId, $content, "div"); } else { // Is a sub group opened? if ($this->ifSubGroupOpenedPreviously()) { @@ -447,13 +447,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { */ public function addFormSubGroup ($subGroupId = "", $subGroupText = "") { // Is a group opened? - if (!$this->ifGroupOpenedPreviously()) { + if ($this->ifGroupOpenedPreviously() === false) { // Throw exception here throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP); } // END - if // At least the sub group name should be set - if ((empty($subGroupId)) && (!$this->ifSubGroupOpenedPreviously())) { + if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) { // Throw exception here throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } elseif (empty($subGroupId)) { @@ -462,7 +462,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // Same sub group to open? - if ((!$this->ifSubGroupOpenedPreviously()) && ($subGroupId == $this->getPreviousSubGroupId())) { + if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) { // Abort here silently return false; } // END - if @@ -471,7 +471,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { $content = "
\n
"; // Is this group opened? - if (!$this->ifSubGroupOpenedPreviously()) { + if ($this->ifSubGroupOpenedPreviously() === false) { // Begin the span block $content = sprintf("
@@ -487,7 +487,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { ); // Switch the state and remeber the name - $this->openSubGroupByIdContent($subGroupId, $content); + $this->openSubGroupByIdContent($subGroupId, $content, "div"); } else { // Get previous sub group id $prevSubGroupId = $this->getPreviousSubGroupId(); @@ -587,7 +587,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { } // END - if // Shall we close or open the sub group? - if ((!$this->ifSubGroupOpenedPreviously()) && ($this->getPreviousSubGroupId() !== $selectId)) { + if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) { // Initialize first entry (which might be non-selectable if content is provided if (!empty($firstEntry)) { // Add selection around it @@ -605,10 +605,10 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { ); // Open the sub group - $this->openSubGroupByIdContent($selectId, $content); + $this->openSubGroupByIdContent($selectId, $content, "select"); } elseif ($this->getPreviousSubGroupId() != $selectId) { // Something went wrong! - $this->debugInstance(); + $this->debugInstance(__METHOD__."(): Previous sub group id {$this->getPreviousSubGroupId()} does not match current id {$selectId}."); } else { // Close the sub group $this->closePreviousSubGroupByContent(""); @@ -628,7 +628,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { */ public function addSelectSubOption ($subName, $subValue) { // Is there a sub group (shall be a selection box!) - if (!$this->ifSubGroupOpenedPreviously()) { + if ($this->ifSubGroupOpenedPreviously() === false) { // Then throw an exception here throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED); } // END - if @@ -656,7 +656,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { */ public function addSelectOption ($optionName, $optionValue) { // Is there a sub group (shall be a selection box!) - if (!$this->ifSubGroupOpenedPreviously()) { + if ($this->ifSubGroupOpenedPreviously() === false) { // Then throw an exception here throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED); } // END - if diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index 39b62ee..540cf80 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -64,7 +64,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { $helperInstance->setLinkBase($linkBase); // Add default group - $helperInstance->openGroupByIdContent('main', ""); + $helperInstance->openGroupByIdContent('main', "", ""); // Return the prepared instance return $helperInstance; @@ -158,49 +158,59 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * * @param $groupId Id string of the group * @param $groupText Text for this group to add + * @param $groupCode Code to open and close groups * @return void */ - public function addLinkGroup ($groupId, $groupText) { + public function addLinkGroup ($groupId, $groupText, $groupCode = "div") { // Is a group with that name open? - if ($this->ifGroupIsOpened($groupId)) { + if ($this->ifGroupOpenedPreviously()) { // Then close it here - $this->closePreviousGroupByContent("
"); - } else { - // Is a previous opened group still open? - if ($this->ifGroupOpenedPreviously()) { - // Then close it - $this->closePreviousGroupByContent("
"); - } // END - if - - // Generate the group content - $content = sprintf("
%s", - $this->getLinkName(), - $groupId, - $groupText - ); - - // Open the new group - $this->openGroupByIdContent($groupId, $content); - } + $this->closePreviousGroupByContent(""); + } // END - if + + // Generate the group content + $content = sprintf("<{$groupCode} id=\"group_%s_%s\">%s", + $this->getLinkName(), + $groupId, + $groupText + ); + + // Open the new group + $this->openGroupByIdContent($groupId, $content, $groupCode); } /** * Adds text (note) to the previously opened group or throws an exception * if no previous group was opened. * + * @param $groupId Group id to set * @param $groupNote Note to be added to a group + * @param $groupCode Code to open and close groups * @return void * @throws NoGroupOpenedException If no previous group was opened */ - public function addLinkNote ($groupNote) { + public function addLinkNote ($groupId, $groupNote, $groupCode = "div") { // Check if a previous group was opened - if (!$this->ifGroupOpenedPreviously()) { + if ($this->ifGroupOpenedPreviously() === false) { // No group was opened before! throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED); } // END - if - // Add the content to the previous group - $this->addContentToPreviousGroup($groupNote); + // Is a previous sub group open? + if ($this->ifSubGroupOpenedPreviously()) { + // Then close it + $this->closePreviousSubGroupByContent(""); + } // END - if + + // Generate the group content + $content = sprintf("<{$groupCode} id=\"subgroup_%s_%s\">%s", + $this->getLinkName(), + $groupId, + $groupNote + ); + + // Open the sub group + $this->openSubGroupByIdContent($groupId, $content, $groupCode); } /** @@ -213,7 +223,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ public function addActionLink ($linkAction, $linkText) { // Check if a previous group was opened - if (!$this->ifGroupOpenedPreviously()) { + if ($this->ifGroupOpenedPreviously() === false) { // No group was opened before! throw new NoGroupOpenedException(array($this, $linkAction."(".$linkText.")"), self::EXCEPTION_GROUP_NOT_OPENED); } // END - if diff --git a/inc/classes/main/resolver/action/web/class_WebActionResolver.php b/inc/classes/main/resolver/action/web/class_WebActionResolver.php index 83f5ddd..4d86ee0 100644 --- a/inc/classes/main/resolver/action/web/class_WebActionResolver.php +++ b/inc/classes/main/resolver/action/web/class_WebActionResolver.php @@ -57,7 +57,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { if (empty($actionName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->isActionValid($actionName)) { + } elseif ($resolverInstance->isActionValid($actionName) === false) { // Invalid action found throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION); } @@ -92,7 +92,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action'); // Check if the action is valid - if (!$this->isActionValid($actionName)) { + if ($this->isActionValid($actionName) === false) { // This action is invalid! throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION); } // END - if @@ -130,7 +130,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action'); // Check if the action is valid - if (!$this->isActionValid($actionName)) { + if ($this->isActionValid($actionName) === false) { // This action is invalid! throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION); } diff --git a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php index ed8492c..4a74091 100644 --- a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php +++ b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php @@ -57,7 +57,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve if (empty($commandName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->isCommandValid($commandName)) { + } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); } @@ -92,7 +92,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command'); // Check if the command is valid - if (!$this->isCommandValid($commandName)) { + if ($this->isCommandValid($commandName) === false) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } // END - if @@ -128,7 +128,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command'); // Check if the command is valid - if (!$this->isCommandValid($commandName)) { + if ($this->isCommandValid($commandName) === false) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } diff --git a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php index 165d2f7..ba80974 100644 --- a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php @@ -57,7 +57,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver if (empty($commandName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->isCommandValid($commandName)) { + } elseif ($resolverInstance->isCommandValid($commandName) === false) { // Invalid command found throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND); } @@ -92,7 +92,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command'); // Check if the command is valid - if (!$this->isCommandValid($commandName)) { + if ($this->isCommandValid($commandName) === false) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } // END - if @@ -128,7 +128,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command'); // Check if the command is valid - if (!$this->isCommandValid($commandName)) { + if ($this->isCommandValid($commandName) === false) { // This command is invalid! throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND); } diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index ec61d4e..21694a8 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -97,7 +97,7 @@ class BaseControllerResolver extends BaseResolver { )); // Try it hard to get an controller - while (!$isValid) { + while ($isValid === false) { // Is this class already loaded? if (class_exists($this->getClassName())) { // This class does exist. :-) diff --git a/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php b/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php index b2f4fcd..1000543 100644 --- a/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php +++ b/inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php @@ -62,7 +62,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll if (empty($controllerName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->isControllerValid($controllerName)) { + } elseif ($resolverInstance->isControllerValid($controllerName) === false) { // Invalid command found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php index da09dca..2293393 100644 --- a/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php +++ b/inc/classes/main/resolver/controller/web/class_WebControllerResolver.php @@ -62,7 +62,7 @@ class WebControllerResolver extends BaseControllerResolver implements Controller if (empty($controllerName)) { // Then thrown an exception here throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } elseif (!$resolverInstance->isControllerValid($controllerName)) { + } elseif ($resolverInstance->isControllerValid($controllerName) === false) { // Invalid command found throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER); } diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index 0c3a4c7..1bbf574 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -153,7 +153,7 @@ class BaseResponse extends BaseFrameworkSystem { * already sent */ public function flushBuffer ($force = false) { - if ((headers_sent()) && (!$force)) { + if ((headers_sent()) && ($force === false)) { // Headers are already sent! throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT); } elseif (!headers_sent()) { diff --git a/inc/classes/main/user/guest/class_Guest.php b/inc/classes/main/user/guest/class_Guest.php index 84405dc..3f45a4f 100644 --- a/inc/classes/main/user/guest/class_Guest.php +++ b/inc/classes/main/user/guest/class_Guest.php @@ -54,10 +54,10 @@ class Guest extends BaseUser implements ManageableGuest, Registerable { $userInstance->setUserName($userName); // Check if the username exists - if (!$userInstance->ifUsernameExists()) { + 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/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index 726e850..6c84ec9 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -62,10 +62,10 @@ class Member extends BaseUser implements ManageableMember, Registerable, Updatea $userInstance->setUserName($userName); // Check if the username exists - if (!$userInstance->ifUsernameExists()) { + 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; -- 2.30.2