Login area extended and misc things changed:
authorRoland Häder <roland@mxchange.org>
Sat, 28 Jun 2008 17:33:19 +0000 (17:33 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 28 Jun 2008 17:33:19 +0000 (17:33 +0000)
- Ship-Simu's action classes moved to sub directory "ship-simu"
- Action for listing shipping companies added which redirects if you have not
  confirmed your email address.
- Template for above action created
- In responses, variable $templateEngine rewritten to $templateInstance and
  removed due to we already have such getter/setter in BaseFrameworkSystem
- Several smaller improvements

22 files changed:
.gitattributes
application/selector/class_ApplicationSelector.php
application/ship-simu/main/actions/class_ShipSimuLoginAction.php [deleted file]
application/ship-simu/main/actions/class_ShipSimuProfileAction.php [deleted file]
application/ship-simu/main/actions/ship-simu/.htaccess [new file with mode: 0644]
application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php [new file with mode: 0644]
application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php [new file with mode: 0644]
application/ship-simu/main/actions/web/.htaccess [new file with mode: 0644]
application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php [new file with mode: 0644]
application/ship-simu/templates/de/code/action_login_company.ctp [new file with mode: 0644]
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/image/class_ImageCodeCaptchaCommand.php
inc/classes/main/commands/web/class_WebHomeCommand.php
inc/classes/main/commands/web/class_WebLoginAreaCommand.php
inc/classes/main/commands/web/class_WebLoginCommand.php
inc/classes/main/commands/web/class_WebLoginFailedCommand.php
inc/classes/main/commands/web/class_WebLogoutDoneCommand.php
inc/classes/main/commands/web/class_WebRegisterCommand.php
inc/classes/main/commands/web/class_WebResendLinkCommand.php
inc/classes/main/mailer/debug/class_DebugMailer.php
inc/classes/main/response/class_HttpResponse.php
inc/classes/main/response/class_ImageResponse.php

index 06875a86b4deb57cf749a5718cdffc416ef98cfd..38eab89450719619c1a8366873fe1b04bdb7fc59 100644 (file)
@@ -56,8 +56,11 @@ application/ship-simu/interfaces/class_TradeableItem.php -text
 application/ship-simu/loader.php -text
 application/ship-simu/main/.htaccess -text
 application/ship-simu/main/actions/.htaccess -text
-application/ship-simu/main/actions/class_ShipSimuLoginAction.php -text
-application/ship-simu/main/actions/class_ShipSimuProfileAction.php -text
+application/ship-simu/main/actions/ship-simu/.htaccess -text
+application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php -text
+application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -text
+application/ship-simu/main/actions/web/.htaccess -text
+application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php -text
 application/ship-simu/main/class_ -text
 application/ship-simu/main/class_BasePersonell.php -text
 application/ship-simu/main/class_BaseSimulator.php -text
@@ -136,6 +139,7 @@ application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php -text
 application/ship-simu/starter.php -text
 application/ship-simu/templates/.htaccess -text
 application/ship-simu/templates/de/.htaccess -text
+application/ship-simu/templates/de/code/action_login_company.ctp -text
 application/ship-simu/templates/de/code/action_login_logout.ctp -text
 application/ship-simu/templates/de/code/action_login_profile.ctp -text
 application/ship-simu/templates/de/code/action_login_status_problem.ctp -text
index 0e9070a95c283d83e1422418519baeee0d242976..007550f6bf00bf07563835a5d2a61e5f36f4f2bb 100644 (file)
@@ -77,9 +77,9 @@ class ApplicationSelector extends BaseFrameworkSystem {
        /**
         * Create a prepared instance of ApplicationSelector
         *
-        * @param               $langInstance           The language sub-system: LanguageSystem
-        * @param               $fileIOInstance The file I/O instance
-        * @return              $selInstance            An instance of ApplicationSelector
+        * @param       $langInstance           The language sub-system: LanguageSystem
+        * @param       $fileIOInstance         The file I/O instance
+        * @return      $selInstance            An instance of ApplicationSelector
         */
        public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIoHandler $fileIOInstance) {
                // Get a new instance
@@ -118,8 +118,8 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * Load the init.php script of an application and append the application
         * instance to $foundApps
         *
-        * @param               $initScript     The FQFN of init.php
-        * @param               $appName                The application's Uni* name
+        * @param       $initScript     The FQFN of init.php
+        * @param       $appName                The application's Uni* name
         * @return      void
         */
        private function loadInitScript ($initScript, $appName) {
@@ -137,10 +137,11 @@ class ApplicationSelector extends BaseFrameworkSystem {
        /**
         * Setter for the selector's template engine instance
         *
-        * @param               $tplEngine      An instance of TemplateEngine
+        * @param       $templateInstance       An instance of TemplateEngine
+        * @return      void
         */
-       private final function setSelectorTemplateEngine (CompileableTemplate $tplEngine) {
-               $this->selectorTplEngine = $tplEngine;
+       private final function setSelectorTemplateEngine (CompileableTemplate $templateInstance) {
+               $this->selectorTplEngine = $templateInstance;
        }
 
        /**
@@ -163,7 +164,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
        }
 
        /**
-        * Method for compatiblity with prepareTemplateEngine()
+        * Method for compatiblity with prepareTemplateInstance()
         *
         * @return      $shortName      This selector's short name
         */
@@ -244,17 +245,17 @@ class ApplicationSelector extends BaseFrameworkSystem {
                        $appInstance = $idx->current();
 
                        // Prepare the template engine for the current template
-                       $tplEngine = $this->prepareTemplateEngine($appInstance);
+                       $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                        // Try to load the web template
-                       $tplEngine->loadWebTemplate(sprintf("%s_%s",
+                       $templateInstance->loadWebTemplate(sprintf("%s_%s",
                                $this->getConfigInstance()->readConfig('tpl_selector_prefix'),
                                strtolower($appInstance->getAppShortName())
                        ));
 
                        // Remember this template and the application for later usage
                        $this->loadedTemplates->append(array(
-                               'template_class'   => $tplEngine,
+                               'template_class'   => $templateInstance,
                                'app_instance' => $appInstance
                        ));
                }
@@ -280,13 +281,13 @@ class ApplicationSelector extends BaseFrameworkSystem {
         */
        public function loadSelectorTemplate () {
                // Prepare the template engine
-               $tplEngine = $this->prepareTemplateEngine($this);
+               $templateInstance = $this->prepareTemplateInstance($this);
 
                // Load the selector's template
-               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
+               $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
 
                // Now store it in the class
-               $this->setSelectorTemplateEngine($tplEngine);
+               $this->setSelectorTemplateEngine($templateInstance);
        }
 
        /**
@@ -302,10 +303,10 @@ class ApplicationSelector extends BaseFrameworkSystem {
         */
        public function insertApplicationTemplates () {
                // First prepare the instance
-               $tplEngine = $this->prepareTemplateEngine($this);
+               $templateInstance = $this->prepareTemplateInstance($this);
 
                // Load template which shall later hold all application templates
-               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
+               $templateInstance->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
 
                // Add all loaded application templates together
                $dummy = "";
diff --git a/application/ship-simu/main/actions/class_ShipSimuLoginAction.php b/application/ship-simu/main/actions/class_ShipSimuLoginAction.php
deleted file mode 100644 (file)
index 500d6d7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * An action class for the login welcome page
- *
- * @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 ShipSimuLoginAction extends BaseAction implements PerformableAction {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set description
-               $this->setObjectDescription("Login welcome action");
-
-               // Generate unique key
-               $this->generateUniqueId();
-       }
-
-       /**
-        * Creates an instance of this action
-        *
-        * @return      $actionInstance         An instance of this action class
-        */
-       public final static function createShipSimuLoginAction () {
-               // Get a new instance
-               $actionInstance = new ShipSimuLoginAction();
-
-               // Return the instance
-               return $actionInstance;
-       }
-
-       /**
-        * Executes the command with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        Maybe we need to do something later here
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/ship-simu/main/actions/class_ShipSimuProfileAction.php b/application/ship-simu/main/actions/class_ShipSimuProfileAction.php
deleted file mode 100644 (file)
index 313f43f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * An action class for the profile page
- *
- * @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 ShipSimuProfileAction extends BaseAction implements PerformableAction {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Set description
-               $this->setObjectDescription("Profile action");
-
-               // Generate unique key
-               $this->generateUniqueId();
-       }
-
-       /**
-        * Creates an instance of this action
-        *
-        * @return      $actionInstance         An instance of this action class
-        */
-       public final static function createShipSimuProfileAction () {
-               // Get a new instance
-               $actionInstance = new ShipSimuProfileAction();
-
-               // Return the instance
-               return $actionInstance;
-       }
-
-       /**
-        * Executes the command with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               /* @TODO Maybe we need to do something later here */
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/ship-simu/main/actions/ship-simu/.htaccess b/application/ship-simu/main/actions/ship-simu/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php
new file mode 100644 (file)
index 0000000..500d6d7
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * An action class for the login welcome page
+ *
+ * @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 ShipSimuLoginAction extends BaseAction implements PerformableAction {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set description
+               $this->setObjectDescription("Login welcome action");
+
+               // Generate unique key
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createShipSimuLoginAction () {
+               // Get a new instance
+               $actionInstance = new ShipSimuLoginAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Maybe we need to do something later here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php
new file mode 100644 (file)
index 0000000..313f43f
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * An action class for the profile page
+ *
+ * @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 ShipSimuProfileAction extends BaseAction implements PerformableAction {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set description
+               $this->setObjectDescription("Profile action");
+
+               // Generate unique key
+               $this->generateUniqueId();
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createShipSimuProfileAction () {
+               // Get a new instance
+               $actionInstance = new ShipSimuProfileAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               /* @TODO Maybe we need to do something later here */
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/ship-simu/main/actions/web/.htaccess b/application/ship-simu/main/actions/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php
new file mode 100644 (file)
index 0000000..283280d
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * An action for shipping company page
+ *
+ * @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 WebLoginCompanyAction extends BaseAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set description
+               $this->setObjectDescription("Shipping comany action");
+
+               // Generate unique key
+               $this->generateUniqueId();
+       }
+
+       /**
+        * 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 createWebLoginCompanyAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebLoginCompanyAction();
+
+               // 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
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->partialStub("Maybe add fetching company list here.");
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/ship-simu/templates/de/code/action_login_company.ctp b/application/ship-simu/templates/de/code/action_login_company.ctp
new file mode 100644 (file)
index 0000000..a00b8cc
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="table_header" id="list_company_header">
+       Auflistung der Reedereien, an denenen du dich beteiligst:
+</div>
+
+<div class="table_list">
+       {?company_list?}
+</div>
+
+<div class="table_footer">
+       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=new_company" title="Hier kannst du mit ausreichend Guthaben eine neue Reederei gr&uuml;nden.">Neue Reederei gr&uuml;nden</a>]&nbsp;-
+       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=list_companies" title="Wenn du dich bei einer Reederei bewerben willst, versuche mal hier dein Gl&uuml;ck.">Reedereien auflisten</a>]&nbsp;-
+       [<a href="$config[base_url]/index.php?app=ship-simu&amp;page=login_area&amp;action=search_companies" title="Suche hier direkt nach einer Reederei anhand des Namens oder Firmenk&uuml;rzels.">Reederei suchen</a>]
+</div>
index 08abd1f8001ec6046bd603f487a638f08ea8fd75..0707487b3c3ae76f659fa89f8277d0aaf078ac68 100644 (file)
@@ -935,17 +935,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @param               $appInstance                    An application helper instance or
         *                                                                              null if we shall use the default
-        * @return              $tplEngine                              The template engine instance
+        * @return              $templateInstance                               The template engine instance
         * @throws              NullPointerException    If the template engine could not
         *                                                                              be initialized
-        * @throws              UnsupportedTemplateEngineException      If $tplEngine is an
+        * @throws              UnsupportedTemplateEngineException      If $templateInstance is an
         *                                                                              unsupported template engine
         * @throws              MissingLanguageHandlerException If the language sub-system
         *                                                                              is not yet initialized
         * @throws              NullPointerException    If the discovered application
         *                                                                              instance is still null
         */
-       protected function prepareTemplateEngine (BaseFrameworkSystem $appInstance=null) {
+       protected function prepareTemplateInstance (BaseFrameworkSystem $appInstance=null) {
                // Is the application instance set?
                if (is_null($appInstance)) {
                        // Get the current instance
@@ -976,10 +976,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                }
 
                // Initialize the template engine
-               $tplEngine = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+               $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
 
                // Return the prepared instance
-               return $tplEngine;
+               return $templateInstance;
        }
 
        /**
index 7a735af1a613639f9f24e3916e1883cfe9873e5b..1ece666e970440e723579c5b32c74204c28356d7 100644 (file)
@@ -73,7 +73,7 @@ class ImageCodeCaptchaCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Assign variable
                $templateInstance->assignVariable('decrypted_code', $decryptedCode);
index eae9dd98c1a9da32aed619633605eb4c35e27384..572d71d043c7514965b38188d879b702e489eec3 100644 (file)
@@ -70,7 +70,7 @@ class WebHomeCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
index a8412732a89fe2791cdd3e206b4a8a1c11366491..eae34135c4e0c9e443716f64626a451a9e1ab9b4 100644 (file)
@@ -96,7 +96,7 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Assign base URL
                $templateInstance->assignConfigVariable('base_url');
index a87b7d836b288551a64b08f2227c1ca8c1b18e10..6dbb59e13490bed387a7957a1480add2961b2c25 100644 (file)
@@ -70,7 +70,7 @@ class WebLoginCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Assign application data with template engine
                $templateInstance->assignApplicationData($appInstance);
index 47eae8055127b8005ae0a382d4d68acb7d65a421..a60bb8e86db291dbc719a2a29b6817e63e9ac0d3 100644 (file)
@@ -70,7 +70,7 @@ class WebLoginFailedCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
index fe07ce5e29454a094b4f5c1dbd597b25aa9a90c8..73dd4d6b172c91e759f989971d09a7da7dc941d1 100644 (file)
@@ -70,7 +70,7 @@ class WebLogoutDoneCommand extends BaseCommand implements Commandable {
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
index a8b8110e4da0d509891374043f2877807db17530..5b4d0b11dbcf247ec35ae3bd4f45dcb36f965c12 100644 (file)
@@ -73,7 +73,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl
                $appInstance = $this->getResolverInstance()->getApplicationInstance();
 
                // Prepare a template instance
-               $templateInstance = $this->prepareTemplateEngine($appInstance);
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
 
                // Assign all the application's data with template variables
                $templateInstance->assignApplicationData($appInstance);
index 5decea579069410061847a723f64cd1cb0fae17d..c08066adc45a5e36c1ef9fe8a23162b9b6c94289 100644 (file)
@@ -66,17 +66,20 @@ class WebResendLinkCommand extends BaseCommand implements Commandable {
         * @return      void
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get a user instance from registry
-               $userInstance = Registry::getRegistry()->getInstance('user');
+               // Get template instance
+               $templateInstance = $responseInstance->getTemplateInstance();
 
                // Get a mailer class
-               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class');
+               $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance));
 
                // Load the mail template
                $mailerInstance->loadTemplate('resend_link');
 
+               // Get a user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
                // Add the recipient
-               $mailerInstance->addRecipientByUser($userInstance);
+               $mailerInstance->addRecipientByUserInstance($userInstance);
 
                // Set subject line from template
                $mailerInstance->setSubjectFromTemplate();
index 6437823bd87da7e14ac0344398db1060453c46df..62c592049898c26113d479a5e45351ec0b6591af 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
- * 
+ * A mailer class for debugging purposes only. This class will print the
+ * prepared mail out and will not send it to the recipient.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -41,12 +42,16 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
        /**
         * Creates an instance of this mailer class
         *
+        * @param       $templateInstance       A template instance
         * @return      $mailerInstance         An instance of this mailer class
         */
-       public final static function createDebugMailer () {
+       public final static function createDebugMailer (CompileableTemplate $templateInstance) {
                // Get a new instance
                $mailerInstance = new DebugMailer();
 
+               // Set template instance
+               $mailerInstance->setTemplateInstance($templateInstance);
+
                // Return the instance
                return $mailerInstance;
        }
index cc3910cffb423c48443a53f182be3c9066360a40..6882981c605b086087fc4671a81357691905c590 100644 (file)
@@ -48,7 +48,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
        /**
         * Instance of the template engine
         */
-       private $templateEngine = null;
+       private $templateInstance = null;
 
        /**
         * Fatal resolved messages from filters and so on
@@ -213,16 +213,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
         * @return      void
         */
        public final function initTemplateEngine (ManageableApplication $appInstance) {
-               $this->templateEngine = $this->prepareTemplateEngine($appInstance);
-       }
-
-       /**
-        * Getter for the template engine instance
-        *
-        * @return      $templateEngine         An instance of the used template engine
-        */
-       public final function getTemplateEngine () {
-               return $this->templateEngine;
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
        }
 
        /**
index 3d81da999cba4ee1cbc6e94d12bbd261f18d6f71..abf349150c8c92cd72b2479cfbcb804414d23995 100644 (file)
@@ -45,11 +45,6 @@ class ImageResponse extends BaseFrameworkSystem implements Responseable {
         */
        private $responseBody = "";
 
-       /**
-        * Instance of the template engine
-        */
-       private $templateEngine = null;
-
        /**
         * Fatal resolved messages from filters and so on
         */
@@ -228,16 +223,7 @@ class ImageResponse extends BaseFrameworkSystem implements Responseable {
                $cfg->setConfigEntry('code_template_type'     , "image");
 
                // Get a prepared instance
-               $this->templateEngine = $this->prepareTemplateEngine($appInstance);
-       }
-
-       /**
-        * Getter for the template engine instance
-        *
-        * @return      $templateEngine         An instance of the used template engine
-        */
-       public final function getTemplateEngine () {
-               return $this->templateEngine;
+               $this->setTemplateInstance($this->prepareTemplateInstance($appInstance));
        }
 
        /**