*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* Menu instance
*/
- private $menuInstance = null;
+ private $menuInstance = NULL;
/**
* Current main node
/**
* 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);