Obsolete parameter 'applicationInstance' removed from all template engines
[core.git] / inc / classes / main / template / mail / class_MailTemplateEngine.php
index 4230ac6b035e097b6140afec31419d1ec905c909..c4e49b22f580e106554f88b39c41ed704112c82c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  * @todo               This template engine does not make use of setTemplateType()
@@ -63,8 +63,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $appInstance    A manageable application
-        * @return      $templateInstance       An instance of TemplateEngine
+        * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
         * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
@@ -72,16 +71,15 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public final static function createMailTemplateEngine (ManageableApplication $appInstance) {
+       public static final function createMailTemplateEngine () {
                // Get a new instance
                $templateInstance = new MailTemplateEngine();
 
-               // Get language and file I/O instances from application
-               $langInstance = $appInstance->getLanguageInstance();
-               $ioInstance = $appInstance->getFileIoInstance();
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Determine base path
-               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
                // Is the base path valid?
                if (empty($templateBasePath)) {
@@ -101,10 +99,6 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Set the base path
                $templateInstance->setTemplateBasePath($templateBasePath);
 
-               // Set the language and IO instances
-               $templateInstance->setLanguageInstance($langInstance);
-               $templateInstance->setFileIoInstance($ioInstance);
-
                // Set template extensions
                $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
                $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));