X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fcommands%2Fhtml%2Fclass_HtmlRegisterCommand.php;h=fa9aa755110a473e29ad95577b2ca7b2c26c29ef;hb=2218902056efcf9a2c66fe7c24995e066bd7cd11;hp=98bd6edce4386dd2ae72b0a5d1c61362135d3994;hpb=8d8cf621bd811811cecd83c65a4ab91f27258e79;p=core.git diff --git a/framework/main/classes/commands/html/class_HtmlRegisterCommand.php b/framework/main/classes/commands/html/class_HtmlRegisterCommand.php index 98bd6edc..fa9aa755 100644 --- a/framework/main/classes/commands/html/class_HtmlRegisterCommand.php +++ b/framework/main/classes/commands/html/class_HtmlRegisterCommand.php @@ -3,10 +3,12 @@ namespace Org\Mxchange\CoreFramework\Command\Register; // Import framework stuff +use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Command\BaseCommand; use Org\Mxchange\CoreFramework\Command\Commandable; use Org\Mxchange\CoreFramework\Controller\Controller; -use Org\Mxchange\CoreFramework\Factory\ObjectFactory; +use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory; +use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper; use Org\Mxchange\CoreFramework\Registry\GenericRegistry; use Org\Mxchange\CoreFramework\Request\Requestable; use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver; @@ -17,7 +19,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable; * * @author Roland Haeder * @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 * @@ -74,46 +76,43 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable { GenericRegistry::getRegistry()->addInstance('extra', $this); // Get the application instance - $applicationInstance = GenericRegistry::getRegistry()->getInstance('application'); - - // Prepare a template instance - $templateInstance = $this->prepareTemplateInstance($applicationInstance); + $applicationInstance = ApplicationHelper::getSelfInstance(); // Assign all the application's data with template variables - $templateInstance->assignApplicationData($applicationInstance); + $this->getTemplateInstance()->assignApplicationData(); // Assign base URL - $templateInstance->assignConfigVariable('base_url'); + $this->getTemplateInstance()->assignConfigVariable('base_url'); // 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 register template - $templateInstance->loadCodeTemplate('register_form'); + $this->getTemplateInstance()->loadCodeTemplate('register_form'); // Assign the register template with the master template as a content ... ;) - $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable('register_form', 'main_content'); + $this->getTemplateInstance()->compileTemplate(); + $this->getTemplateInstance()->assignTemplateWithVariable('register_form', 'main_content'); // Load the master template - $templateInstance->loadCodeTemplate($masterTemplate); + $this->getTemplateInstance()->loadCodeTemplate($masterTemplate); // Set title - $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_register_title')); + $this->getTemplateInstance()->assignVariable('title', FrameworkBootstrap::getLanguageInstance()->getMessage('page_register_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. @@ -123,17 +122,17 @@ class HtmlRegisterCommand 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); } /**