X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fcommands%2Fweb%2Fclass_WebHomeCommand.php;h=6bc3ff9000ca870a9e28e80d7610ee148c9c45a2;hb=a3fa89c7cbc54491fc74f13db0927d14acf550c8;hp=6aad8cfb7f91b926bd8e2b3476141d8e8e324356;hpb=c6d73b0e3246efc824cb98338d4be7ee5bc9f308;p=core.git diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 6aad8cfb..6bc3ff90 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -38,7 +38,7 @@ class WebHomeCommand extends BaseCommand implements Commandable { * @param $resolverInstance An instance of a command resolver class * @return $commandInstance An instance a prepared command class */ - public final static function createWebHomeCommand (CommandResolver $resolverInstance) { + public static final function createWebHomeCommand (CommandResolver $resolverInstance) { // Get new instance $commandInstance = new WebHomeCommand(); @@ -67,7 +67,7 @@ class WebHomeCommand extends BaseCommand implements Commandable { $templateInstance->assignApplicationData($appInstance); // Load the master template - $masterTemplate = $appInstance->getMasterTemplate(); + $masterTemplate = $appInstance->buildMasterTemplateName(); // Load header template $templateInstance->loadCodeTemplate('header'); @@ -95,6 +95,16 @@ class WebHomeCommand extends BaseCommand implements Commandable { // Set title $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_home_title')); + // Construct the menu in every command. We could do this in BaseCommand class. But this means + // *every* command has a navigation system and that is want we don't want. + $menuInstance = ObjectFactory::createObjectByConfiguredName('home_menu_class', array($appInstance)); + + // Render the menu + $menuInstance->renderMenu(); + + // Transfer it to the template engine instance + $menuInstance->transferContentToTemplateEngine($templateInstance); + // ... and all variables. This should be merged together in a pattern // to make things easier. A cache mechanism should be added between // these two calls to cache compiled templates.