Obsolete parameter 'applicationInstance' removed from all template engines
[core.git] / inc / classes / main / template / menu / class_MenuTemplateEngine.php
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);