Obsolete parameter 'applicationInstance' removed from all template engines
authorRoland Häder <roland@mxchange.org>
Mon, 21 Mar 2011 23:21:48 +0000 (23:21 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 21 Mar 2011 23:21:48 +0000 (23:21 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/menu/class_BaseMenu.php
inc/classes/main/template/console/class_ConsoleTemplateEngine.php
inc/classes/main/template/image/class_ImageTemplateEngine.php
inc/classes/main/template/mail/class_MailTemplateEngine.php
inc/classes/main/template/menu/class_MenuTemplateEngine.php
inc/classes/main/template/web/class_WebTemplateEngine.php

index f8dc6b851e1a48c6b81908b03ae924e5d01525e8..70ab046529da504a28c0a40d9e4d74e996bf4021 100644 (file)
@@ -720,7 +720,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Initialize the template engine
-               $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class', array($applicationInstance));
+               $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class');
 
                // Return the prepared instance
                return $templateInstance;
index 4dd1d9c4c4a00ea5c5092b0879c2f71c0a9a5536..32a57c06e94c1a98497a47f30d569e3e0c209a43 100644 (file)
@@ -41,7 +41,7 @@ class BaseMenu extends BaseFrameworkSystem {
         */
        public function renderMenu () {
                // Initialize the menu system by preparing it's template instance
-               $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getApplicationInstance(), $this));
+               $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this));
 
                // Set it for later use
                $this->setTemplateInstance($templateInstance);
index 0a9bc8dc5f022fb22006b3c476f9c1d04efd54c7..15f2f8f34a53367d077afc0c86ab79f58aef222e 100644 (file)
@@ -36,7 +36,6 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $applicationInstance    A manageable application
         * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
@@ -45,10 +44,13 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createConsoleTemplateEngine (ManageableApplication $applicationInstance) {
+       public static final function createConsoleTemplateEngine () {
                // Get a new instance
                $templateInstance = new ConsoleTemplateEngine();
 
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Determine base path
                $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
index 98203154dda905f7ed8296bc996b87c76b7e9ff8..d59c91fa191321678f65decf0906339612ec4f78 100644 (file)
@@ -69,7 +69,6 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $applicationInstance    A manageable application
         * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
@@ -78,10 +77,13 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createImageTemplateEngine (ManageableApplication $applicationInstance) {
+       public static final function createImageTemplateEngine () {
                // Get a new instance
                $templateInstance = new ImageTemplateEngine();
 
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Determine base path
                $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
index eda00738babd1365478b81bb8adb4645b2b8bfbf..c4e49b22f580e106554f88b39c41ed704112c82c 100644 (file)
@@ -63,7 +63,6 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $applicationInstance    A manageable application
         * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
@@ -72,10 +71,13 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createMailTemplateEngine (ManageableApplication $applicationInstance) {
+       public static final function createMailTemplateEngine () {
                // Get a new instance
                $templateInstance = new MailTemplateEngine();
 
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Determine base path
                $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
index b67f7207d6bf6da2270ad2a86f41d1b8044b9e76..1438c91402961cd8919599ed6955e9d88bb6eae2 100644 (file)
@@ -85,7 +85,6 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $applicationInstance    A manageable application
         * @param       $menuInstance                   A RenderableMenu instance
         * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
@@ -95,10 +94,13 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createMenuTemplateEngine (ManageableApplication $applicationInstance, RenderableMenu $menuInstance) {
+       public static final function createMenuTemplateEngine (RenderableMenu $menuInstance) {
                // Get a new instance
                $templateInstance = new MenuTemplateEngine();
 
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Determine base path
                $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
 
@@ -290,7 +292,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Is the template dependency set?
                if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) {
                        // Get a temporay menu template instance
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getApplicationInstance(), $this->getMenuInstance()));
+                       $templateInstance = ObjectFactory::createObjectByConfiguredName('menu_template_class', array($this->getMenuInstance()));
 
                        // Then load it
                        $templateInstance->loadMenuTemplate($templateDependency);
index e4846a815490cb26e5e3a41532cc7078d69a0bc7..ef5a0e2d24845f4f25550d0602c5d5877bfea110 100644 (file)
@@ -36,7 +36,6 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat
        /**
         * Creates an instance of the class TemplateEngine and prepares it for usage
         *
-        * @param       $applicationInstance    A manageable application
         * @return      $templateInstance               An instance of TemplateEngine
         * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
         * @throws      InvalidBasePathStringException  If $templateBasePath is no string
@@ -45,10 +44,13 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat
         * @throws      BasePathReadProtectedException  If $templateBasePath is
         *                                                                                      read-protected
         */
-       public static final function createWebTemplateEngine (ManageableApplication $applicationInstance) {
+       public static final function createWebTemplateEngine () {
                // Get a new instance
                $templateInstance = new WebTemplateEngine();
 
+               // Get the application instance from registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Determine base path
                $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';