/**
* 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
* @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') . '/';
// 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);