- XHTML errors/warnings fixed in some pages
authorRoland Häder <roland@mxchange.org>
Sat, 15 Nov 2008 18:42:03 +0000 (18:42 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 15 Nov 2008 18:42:03 +0000 (18:42 +0000)
- 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?)

49 files changed:
.gitattributes
application/admin/main/login/class_AdminUserLogin.php
application/ship-simu/config.php
application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php
application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php [new file with mode: 0644]
application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php
application/ship-simu/main/class_BasePersonell.php
application/ship-simu/main/class_WorksContract.php
application/ship-simu/main/companies/class_ShippingCompany.php
application/ship-simu/main/filter/goverment/.htaccess [new file with mode: 0644]
application/ship-simu/main/filter/goverment/class_ShipSimuGovermentPaysTrainingFilter.php [new file with mode: 0644]
application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php
application/ship-simu/main/login/class_ShipSimuGuestLogin.php
application/ship-simu/main/login/class_ShipSimuUserLogin.php
application/ship-simu/main/personell/company/class_CompanyEmployee.php
application/ship-simu/main/user/extended/class_ShipSimuGuest.php
application/ship-simu/main/user/extended/class_ShipSimuMember.php
application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp
application/ship-simu/templates/de/code/action_ship_simu_login_goverment_startup_help.ctp
application/ship-simu/templates/de/code/action_ship_simu_login_goverment_training.ctp [new file with mode: 0644]
application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp
application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp
application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp
application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp
application/ship-simu/templates/de/code/confirm_link.ctp
application/ship-simu/templates/de/code/login_failed.ctp
application/ship-simu/templates/de/code/login_form.ctp
application/ship-simu/templates/de/code/logout_done.ctp
application/ship-simu/templates/de/code/register_form.ctp
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/controller/login/class_WebLoginAreaController.php
inc/classes/main/controller/web/class_WebLoginController.php
inc/classes/main/filter/validator/class_EmailValidatorFilter.php
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php
inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php
inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php
inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php
inc/classes/main/helper/class_BaseHelper.php
inc/classes/main/helper/web/forms/class_WebFormHelper.php
inc/classes/main/helper/web/links/class_WebLinkHelper.php
inc/classes/main/resolver/action/web/class_WebActionResolver.php
inc/classes/main/resolver/command/image/class_ImageCommandResolver.php
inc/classes/main/resolver/command/web/class_WebCommandResolver.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php
inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php
inc/classes/main/resolver/controller/web/class_WebControllerResolver.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/user/guest/class_Guest.php
inc/classes/main/user/member/class_Member.php

index b9367f2..878445b 100644 (file)
@@ -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
index a314269..3cf2678 100644 (file)
@@ -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
index b2f3f32..ce4b96f 100644 (file)
@@ -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);
 
index e4c3ed9..05fb35c 100644 (file)
@@ -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 (file)
index 0000000..e41c61e
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * An action for trainings payed by goverment
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
index 8d02747..8c4c004 100644 (file)
@@ -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'));
 
index 1234767..f59e8cf 100644 (file)
@@ -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);
index 7f61096..f56c2fa 100644 (file)
@@ -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 <strong>%s</strong> konnte wegen eines Fehlers nicht gebaut werden. Siehe obere Meldungen.",
                                        $this->getShipInstance()->getShipName()
index 362a801..1d6877b 100644 (file)
@@ -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 <strong>%s</strong> hat die Suche nach einer Werft beendet, die Schiffe vom Typ <strong>%s</strong> 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 (file)
index 0000000..3a42882
--- /dev/null
@@ -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 (file)
index 0000000..febd4bd
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+/**
+ * A filter for checking if goverment can pay a training for current user
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
index 76fe612..06643e0 100644 (file)
@@ -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);
 
index ba7ac31..7336865 100644 (file)
@@ -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
index e354040..541e188 100644 (file)
@@ -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
index 3aee089..fde89e0 100644 (file)
@@ -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);
index 69d7763..1f7ec55 100644 (file)
@@ -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;
index ed2673a..46fb2ed 100644 (file)
@@ -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;
index 2722364..00ec77a 100644 (file)
@@ -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&uuml;ndet. Bitte denke &uuml;ber eine Fusion (Zusammenlegung) nach.");
+       $linkInstance->addLinkNote('company_maximum', "Du hast zu viele Firmen gegr&uuml;ndet. Bitte denke &uuml;ber eine Fusion (Zusammenlegung) nach.");
 } elseif ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('found_new_company')) {
        // Enough money to found company
        $linkInstance->addActionLink('company_found', "Gr&uuml;nde eine virtuelle Firma und mache dich (virtuell) selbstst&auml;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&uuml;ck.");
-               $linkInstance->addActionLink('moneybank&amp;sub=payback_credits', "Jetzt deinen Kredit tilgen.");
-       } else {
-               // Money bank is closed!
-               $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte sp&auml;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&auml;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&uuml;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&uuml;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&uuml;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&uuml;ck.");
+       $linkInstance->addLinkNote('moneybank_depleted', "Die Bank kann dir kein Geld mehr leihen, bitte zahle es auch wieder zur&uuml;ck.");
        $linkInstance->addActionLink('moneybank_payback_credits', "Jetzt deinen Kredit tilgen.");
 } else {
        // Money bank is closed!
-       $linkInstance->addLinkNote("Die Bank hat derzeit geschlossen. Bitte sp&auml;ter nochmal versuchen.");
+       $linkInstance->addLinkNote('moneybank_closed', "Die Bank hat derzeit geschlossen. Bitte sp&auml;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&ouml;glich oder gest&ouml;rt und wurde von uns deaktiviert.");
+       $linkInstance->addLinkNote('refill_disabled', "Das Aufladen ist derzeit nicht m&ouml;glich oder gest&ouml;rt und wurde von uns deaktiviert.");
 }
 
 // Flush content to the template
index 3c15204..8a73e0c 100644 (file)
@@ -1,12 +1,15 @@
 <?php
 // Get form helper instance
-$helper = WebFormHelper::createWebFormHelper($this, 'shipsimu_startup_form');
+$helperInstance = WebFormHelper::createWebFormHelper($this, 'shipsimu_startup_form');
+
+// Prefetch user instance
+$helperInstance->prefetchValueInstance('user');
 
 // Add main form group
-$helper->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausf&uuml;llen!");
+$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausf&uuml;llen!");
 
 // Flush the finished form
-$helper->flushContent();
+$helperInstance->flushContent();
 
 ?>
 <div id="goverment_frame">
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 (file)
index 0000000..3e60274
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+// Get form helper instance
+$helperInstance = WebFormHelper::createWebFormHelper($this, 'shipsimu_training_form');
+
+// Prefetch user instance
+$helperInstance->prefetchValueInstance('user');
+
+// Add main form group
+$helperInstance->addFormNote('reality_warning', "WARNUNG: Bitte dieses Formular nicht mit echten Angaben ausf&uuml;llen!");
+
+// Flush the finished form
+$helperInstance->flushContent();
+
+?>
+<div id="goverment_frame">
+       <div id="goverment_header">
+               Virtuelle Beantragung eines Training-Kursus
+       </div>
+
+       <div id="goverment_form">
+               {?shipsimu_training_form?}
+       </div>
+</div>
index 8e43002..748db67 100644 (file)
@@ -1,21 +1,21 @@
 <?php
 // Get helper instance
-$helper = WebLinkHelper::createWebLinkHelper($this, 'logout_now_link', 'index.php?app={?app_short_name?}&amp;page=logout');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'logout_now_link', 'index.php?app={?app_short_name?}&amp;page=logout');
 
 // Set link text
-$helper->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?}&amp;page=login_area');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'return_login_link', 'index.php?app={?app_short_name?}&amp;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]
 ?>
index bb78982..866489d 100644 (file)
 // 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 &Auml;ndern deines Passwortes zweimal das gew&uuml;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 &Auml;ndern deines Passwortes zweimal das gew&uuml;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: <span id=\"displayed_field\">".$helper->getValueField('email')."</span>");
+$helperInstance->addFormNote('current_email', "Derzeitige Email-Adresse: <span id=\"displayed_field\">".$helperInstance->getValueField('email')."</span>");
 
 // Only for changing email address
-if ($helper->ifEmailChangeAllowed()) {
-       $helper->addFormGroup('email', "&Auml;nderung deiner Email-Addresse:");
-       $helper->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese &auml;ndern m&ouml;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', "&Auml;nderung deiner Email-Addresse:");
+       $helperInstance->addFormSubGroup('email', "Gebe nur deine Email-Adresse zweimal ein, wenn du diese &auml;ndern m&ouml;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&auml;tigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann m&ouml;glichst schnell an.");
+       if ($helperInstance->ifEmailChangeRequireConfirmation()) {
+               $helperInstance->addFormNote('confirm_link', "Es wird ein Best&auml;tigungslink an deine neue Email-Adresse gesendet. Bitte klicke diesen dann m&ouml;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 &auml;ndern.");
+$helperInstance->addFormGroup('profile', "Hier kannst du deine Profildaten &auml;ndern.");
 
 // Persoenliche Daten mit in der Anmeldung abfragen?
-if ($helper->ifRegisterIncludesPersonaData()) {
-       $helper->addFormSubGroup('persona', "Wenn du magst, dann vervollst&auml;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&auml;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 &quot;Ja, ich akzeptiere die aktuellen Spielregeln&quot; 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 &quot;Ja, ich akzeptiere die aktuellen Spielregeln&quot; 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&auml;tigung der &Auml;nderungen dein derzeitiges Passwort ein.");
-$helper->addFieldText('pass_old', "Derzeitiges Passwort:");
-$helper->addInputPasswordField('pass_old');
+$helperInstance->addFormGroup('pass_old', "Bitte gebe zur Best&auml;tigung der &Auml;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&uuml;ltigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link &quot;Datenschutz&quot;.");
-$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&uuml;ltigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link &quot;Datenschutz&quot;.");
+$helperInstance->flushContent();
 ?>
 <div id="content_header">
        Deine Profildaten bearbeiten
index 305c404..b7af0c3 100644 (file)
@@ -1,52 +1,52 @@
 <?php
 // Neue Helper-Instanz holen
-$helper = WebFormHelper::createWebFormHelper($this, 'refill_form');
+$helperInstance = WebFormHelper::createWebFormHelper($this, 'refill_form');
 
 // Pre-fetch payment types
-$helper->prefetchValueInstance('payments');
+$helperInstance->prefetchValueInstance('payments');
 
 // Add form group
-$helper->addFormGroup('refill_form', "Bitte w&auml;hle aus, was du nachbestellen willst und gebe die Menge an.");
+$helperInstance->addFormGroup('refill_form', "Bitte w&auml;hle aus, was du nachbestellen willst und gebe die Menge an.");
 
 // Add sub group
-$helper->addInputSelectField('type', "--- Bitte ausw&auml;hlen ---");
+$helperInstance->addInputSelectField('type', "--- Bitte ausw&auml;hlen ---");
 
 // In-game currencies (if more than default add them here!)
-$helper->addSelectSubOption('currencies', "--- W&auml;hrungen ---");
-$helper->addSelectOption('currency', "{?currency?}");
+$helperInstance->addSelectSubOption('currencies', "--- W&auml;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&auml;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&auml;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&ouml;schen");
-$helper->addInputSubmitButton("Nachbestellung verbindlich aufgeben");
-$helper->flushContent();
+$helperInstance->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung verbindlich!");
+$helperInstance->addInputResetButton("Eingaben l&ouml;schen");
+$helperInstance->addInputSubmitButton("Nachbestellung verbindlich aufgeben");
+$helperInstance->flushContent();
 ?>
 <div id="refill_frame">
        <div class="content_header">
index 88a47b1..a87303c 100644 (file)
@@ -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&auml;tigungslink erneut aussenden");
-} elseif ($helper->ifUserAccountLocked()) {
+       $helperInstance->addInputHiddenFieldWithDefault('email');
+       $helperInstance->addInputSubmitButton("Best&auml;tigungslink erneut aussenden");
+} elseif ($helperInstance->ifUserAccountLocked()) {
        // Account is locked
-       $helper->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre:
-               <span id=\"lock_reason\">".$helper->getValueField('lock_reason')."</span>
+       $helperInstance->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre:
+               <span id=\"lock_reason\">".$helperInstance->getValueField('lock_reason')."</span>
                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&auml;steaccounts sind in der Funktionalit&auml;t
+       $helperInstance->addFormNote('status_guest', "G&auml;steaccounts sind in der Funktionalit&auml;t
                leicht eingeschr&auml;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&auml;tigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen.");
-       $helper->addFieldText('code', "Best&auml;tigungscode aus der Mail:");
-       $helper->addInputTextField('code');
+       $helperInstance->addFormGroup('code', "Bitte gebe hier den Best&auml;tigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen.");
+       $helperInstance->addFieldText('code', "Best&auml;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&auml;tigungscode absenden");
+       $helperInstance->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!");
+       $helperInstance->addInputResetButton("Nochmal eingeben");
+       $helperInstance->addInputSubmitButton("Best&auml;tigungscode absenden");
 
        // Flush content and automatically close the form
-       $helper->flushContent();
+       $helperInstance->flushContent();
 } // END - if
 ?>
 <div id="content_header">
index a3f7895..cf2d03f 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 // Get helper instance
-$helper = WebLinkHelper::createWebLinkHelper($this, 'direct_login_link', 'index.php?app={?app_short_name?}&amp;page=login');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'direct_login_link', 'index.php?app={?app_short_name?}&amp;page=login');
 
 // Set link text
-$helper->addLinkWithTextById('direct_login_link_text');
+$helperInstance->addLinkWithTextById('direct_login_link_text');
 
 // Flush the content
-$helper->flushContent();
+$helperInstance->flushContent();
 
 // [EOF]
 ?>
index 07455ab..39bca5a 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 // Get helper instance
-$helper = WebLinkHelper::createWebLinkHelper($this, 'login_retry_link', 'index.php?app={?app_short_name?}&amp;page=login');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'login_retry_link', 'index.php?app={?app_short_name?}&amp;page=login');
 
 // Set link text
-$helper->addLinkWithTextById('login_retry_text');
+$helperInstance->addLinkWithTextById('login_retry_text');
 
 // Flush the content
-$helper->flushContent();
+$helperInstance->flushContent();
 
 // [EOF]
 ?>
index fed90b3..86f81d3 100644 (file)
@@ -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&uuml;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&uuml;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&#39;s Spiel ist derzeit administrativ deaktiviert worden. Bitte komme sp&auml;ter noch mal wieder.");
-       $helper->addFormNote('admin_notice', "Nachricht vom Admin: <span id=\"disabled_reason\">".$this->getConfigInstance()->readConfig('login_disabled_reason')."</span>");
+       $helperInstance->addFormNote('form_deactivated', "Einloggen in&#39;s Spiel ist derzeit administrativ deaktiviert worden. Bitte komme sp&auml;ter noch mal wieder.");
+       $helperInstance->addFormNote('admin_notice', "Nachricht vom Admin: <span id=\"disabled_reason\">".$this->getConfigInstance()->readConfig('login_disabled_reason')."</span>");
 }
 
 // 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&uuml;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&uuml;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&auml;nkt. Mehr dazu unter &quot;Gastlogin&quot;.");
-       $helper->addInputSubmitButton("Als Gast einloggen");
-       $helper->flushContent();
+       $helperInstance->addFormGroup('buttons_guest', "Gastlogins sind in der Funkionsweise eingeschr&auml;nkt. Mehr dazu unter &quot;Gastlogin&quot;.");
+       $helperInstance->addInputSubmitButton("Als Gast einloggen");
+       $helperInstance->flushContent();
 }
 
 // Get helper instance
-$helper = WebLinkHelper::createWebLinkHelper($this, 'register_login_form_link', 'index.php?app={?app_short_name?}&amp;page=register');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'register_login_form_link', 'index.php?app={?app_short_name?}&amp;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();
 
 ?>
 <div id="content_header">
index 4eba180..8e44f11 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 // Get helper instance
-$helper = WebLinkHelper::createWebLinkHelper($this, 'relogin_link', 'index.php?app={?app_short_name?}&amp;page=login');
+$helperInstance = WebLinkHelper::createWebLinkHelper($this, 'relogin_link', 'index.php?app={?app_short_name?}&amp;page=login');
 
 // Set link text
-$helper->addLinkWithTextById('relogin_link_text');
+$helperInstance->addLinkWithTextById('relogin_link_text');
 
 // Flush the content
-$helper->flushContent();
+$helperInstance->flushContent();
 
 // [EOF]
 ?>
index 7760229..70dc67d 100644 (file)
 // 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&uuml;nschten Nickname und dein Zugangspasswort ein.");
-$helper->addFormSubGroup('username', "Dein Nickname wird erst nach Absenden des Formulares gepr&uuml;ft. Sp&auml;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&auml;ter bauen wir hier noch einen automatischen Test ein, der dir sofort die Passwortst&auml;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&auml;tigung) ein, damit wir dir deinen Freischaltlink zusenden k&ouml;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&uuml;nschten Nickname und dein Zugangspasswort ein.");
+$helperInstance->addFormSubGroup('username', "Dein Nickname wird erst nach Absenden des Formulares gepr&uuml;ft. Sp&auml;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&auml;ter bauen wir hier noch einen automatischen Test ein, der dir sofort die Passwortst&auml;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&auml;tigung) ein, damit wir dir deinen Freischaltlink zusenden k&ouml;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&auml;tzlich deine Profildaten vorweg eingeben, du kannst sie aber auch nach dem Login vervollst&auml;ndigen!");
+if ($helperInstance->ifRegisterIncludesProfile()) {
+       $helperInstance->addFormGroup('profile', "Hier kannst du zus&auml;tzlich deine Profildaten vorweg eingeben, du kannst sie aber auch nach dem Login vervollst&auml;ndigen!");
 
-       if (!$helper->ifRegisterRequiresEmailVerification()) {
-               $helper->addFormSubGroup('email', "Die Angabe deiner Email-Adresse ist nur dann n&ouml;tig, wenn du auch Email-Benachrichtigungen (<span id=\"add_note\">*1</span>) haben m&ouml;chtest.");
-               $helper->addFieldText('email1', "Email-Adresse:");
-               $helper->addInputTextField('email1');
+       if (!$helperInstance->ifRegisterRequiresEmailVerification()) {
+               $helperInstance->addFormSubGroup('email', "Die Angabe deiner Email-Adresse ist nur dann n&ouml;tig, wenn du auch Email-Benachrichtigungen (<span id=\"add_note\">*1</span>) haben m&ouml;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&auml;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&auml;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 &quot;Ja, ich akzeptiere die aktuellen Spielregeln&quot; 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 &quot;Ja, ich akzeptiere die aktuellen Spielregeln&quot; 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&ouml;tigten Felder korrekt ausgef&uuml;t hast, kannst du die Anmeldung abschliessen.");
+$helperInstance->addFormGroup('buttons', "Wenn du alle ben&ouml;tigten Felder korrekt ausgef&uuml;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&uuml;ltigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link &quot;Datenschutz&quot;.");
-$helper->flushContent();
+$helperInstance->addInputResetButton("Alles nochmal eingeben");
+$helperInstance->addInputSubmitButton("Anmeldung zum Spiel abschliessen");
+$helperInstance->addFormNote('data_protection', "Deine Daten werden nach den g&uuml;ltigen Datenschutzgesetzten gespeichert und werden nicht an Dritte weitergegeben. Weiteres dazu siehe Link &quot;Datenschutz&quot;.");
+$helperInstance->flushContent();
 ?>
 <div id="content_header">
        Anmeldung bei <span class="app_name">{?app_full_name?}</span>
index 31fecee..ee34a87 100644 (file)
@@ -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("<div class=\"debug_message\">Message: %s</div>\n", $message);
+               } // END - if
+
                // Generate the output
-               $content = sprintf("<pre>%s</pre>",
+               $content .= sprintf("<pre>%s</pre>",
                        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
 
index 4e82ce1..67b388a 100644 (file)
@@ -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;
        }
index 83964d2..f4ce053 100644 (file)
@@ -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;
        }
index feb819e..264c4e1 100644 (file)
@@ -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;
                }
index 522e77a..39bfee2 100644 (file)
@@ -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
index 75e00bd..cf44e53 100644 (file)
@@ -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;
                }
index 7d0bde9..cab4380 100644 (file)
@@ -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
index e36fa38..c87942b 100644 (file)
@@ -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);
 
index 94f4ed5..b4e893f 100644 (file)
@@ -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}<br />\n";
+       protected function openGroupByIdContent ($groupId, $content, $tag) {
+               //* DEBUG: */ echo "OPEN:groupId={$groupId},content=<pre>".htmlentities($content)."</pre>\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("<!-- group %s opened (length: %s, tag: %s) //-->%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("<!-- group %s auto-closed //--></%s>", $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("<!-- group %s closed (length: %s, tag: %s) //-->%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)."<br />\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("<!-- sub-group %s opened (length: %s, tag: %s) //-->%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("<!-- sub-group %s auto-closed //--></%s>", $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("<!-- sub-group %s closed (length: %s, tag: %s) //-->%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=<pre>".htmlentities($groupContent)."</pre><br />\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=<pre>".htmlentities($subGroupContent)."</pre><br />\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?
index a188251..acb419a 100644 (file)
@@ -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 = "    </div>\n</div><!-- Group - CLOSE //-->";
 
                // Is this group opened?
-               if (!$this->ifGroupOpenedPreviously()) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Begin the div/span blocks
                        $content = sprintf("<!-- Group %s - OPEN //-->
 <div class=\"group_box\" id=\"%s_group_box\">
@@ -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 = "    </div>\n</div><!-- Sub group- CLOSE //-->";
 
                // Is this group opened?
-               if (!$this->ifSubGroupOpenedPreviously()) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Begin the span block
                        $content = sprintf("<!-- Sub group %s - OPEN //-->
 <div class=\"subgroup_box\" id=\"%s_subgroup_box\">
@@ -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("</select>");
@@ -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
index 39b62ee..540cf80 100644 (file)
@@ -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("</div>");
-               } else {
-                       // Is a previous opened group still open?
-                       if ($this->ifGroupOpenedPreviously()) {
-                               // Then close it
-                               $this->closePreviousGroupByContent("</div>");
-                       } // END - if
-
-                       // Generate the group content
-                       $content = sprintf("<div id=\"group_%s_%s\">%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("</{$groupCode}>");
+               } // 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
index 83f5ddd..4d86ee0 100644 (file)
@@ -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);
                }
index ed8492c..4a74091 100644 (file)
@@ -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);
                }
index 165d2f7..ba80974 100644 (file)
@@ -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);
                }
index ec61d4e..21694a8 100644 (file)
@@ -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. :-)
index b2f4fcd..1000543 100644 (file)
@@ -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);
                }
index da09dca..2293393 100644 (file)
@@ -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);
                }
index 0c3a4c7..1bbf574 100644 (file)
@@ -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()) {
index 84405dc..3f45a4f 100644 (file)
@@ -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;
index 726e850..6c84ec9 100644 (file)
@@ -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;