X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fcommands%2Fhtml%2Fclass_HtmlHomeCommand.php;h=ff1a09329d8f176024ade6f92d6f5e0789445e7b;hb=2218902056efcf9a2c66fe7c24995e066bd7cd11;hp=6f8be22d40bb4fd6f7d863acc11721b7fbc51119;hpb=78a010fef84895720e796842208f01dfb619c332;p=core.git diff --git a/framework/main/classes/commands/html/class_HtmlHomeCommand.php b/framework/main/classes/commands/html/class_HtmlHomeCommand.php index 6f8be22d..ff1a0932 100644 --- a/framework/main/classes/commands/html/class_HtmlHomeCommand.php +++ b/framework/main/classes/commands/html/class_HtmlHomeCommand.php @@ -1,22 +1,25 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -70,42 +73,40 @@ class HtmlHomeCommand extends BaseCommand implements Commandable { */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Get the application instance - $applicationInstance = $this->getResolverInstance()->getApplicationInstance(); + $applicationInstance = ApplicationHelper::getSelfInstance(); // Prepare a template instance - $templateInstance = $this->prepareTemplateInstance($applicationInstance); - // Transfer application data - $templateInstance->assignApplicationData($applicationInstance); + $this->getTemplateInstance()->assignApplicationData(); // Load the master template $masterTemplate = $applicationInstance->buildMasterTemplateName(); // Load header template - $templateInstance->loadCodeTemplate('header'); + $this->getTemplateInstance()->loadCodeTemplate('header'); // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('header', 'header'); + $this->getTemplateInstance()->compileTemplate(); + $this->getTemplateInstance()->assignTemplateWithVariable('header', 'header'); // Load footer template - $templateInstance->loadCodeTemplate('footer'); + $this->getTemplateInstance()->loadCodeTemplate('footer'); // Compile and assign it with a variable - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('footer', 'footer'); + $this->getTemplateInstance()->compileTemplate(); + $this->getTemplateInstance()->assignTemplateWithVariable('footer', 'footer'); // Load the home template - $templateInstance->loadCodeTemplate('home'); + $this->getTemplateInstance()->loadCodeTemplate('home'); // Assign the home template with the master template as a content ... ;) - $templateInstance->assignTemplateWithVariable('home', 'main_content'); + $this->getTemplateInstance()->assignTemplateWithVariable('home', 'main_content'); // Load the master template - $templateInstance->loadCodeTemplate($masterTemplate); + $this->getTemplateInstance()->loadCodeTemplate($masterTemplate); // Set title - $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_home_title')); + $this->getTemplateInstance()->assignVariable('title', FrameworkBootstrap::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. @@ -115,17 +116,17 @@ class HtmlHomeCommand extends BaseCommand implements Commandable { $menuInstance->renderMenu(); // Transfer it to the template engine instance - $menuInstance->transferContentToTemplateEngine($templateInstance); + $menuInstance->transferContentToTemplateEngine($this->getTemplateInstance()); /* * ... 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. */ - $templateInstance->compileVariables(); + $this->getTemplateInstance()->compileVariables(); // Get the content back from the template engine and put it in response class - $templateInstance->transferToResponse($responseInstance); + $this->getTemplateInstance()->transferToResponse($responseInstance); } /**