X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcommands%2Fweb%2Fclass_WebStatusCommand.php;h=f07eb35a579b7ae7473e3471abb4e6447084c664;hb=f674968df3613418156a68f4a475c98507a1d505;hp=9988097904b614be4db642e1458797ef70be8568;hpb=8c1bb3f5a61a4b832297fa51d4a91559a1220806;p=core.git diff --git a/inc/classes/main/commands/web/class_WebStatusCommand.php b/inc/classes/main/commands/web/class_WebStatusCommand.php index 99880979..f07eb35a 100644 --- a/inc/classes/main/commands/web/class_WebStatusCommand.php +++ b/inc/classes/main/commands/web/class_WebStatusCommand.php @@ -58,7 +58,55 @@ class WebStatusCommand extends BaseCommand implements Commandable { * @todo 0% done */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - $this->partialStub('Unfinished method.'); + // Get the application instance + $appInstance = $this->getResolverInstance()->getApplicationInstance(); + + // Prepare a template instance + $templateInstance = $this->prepareTemplateInstance($appInstance); + + // Transfer application data + $templateInstance->assignApplicationData($appInstance); + + // Load the master template + $masterTemplate = $appInstance->buildMasterTemplateName(); + + // Load header template + $templateInstance->loadCodeTemplate('header'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('header', 'header'); + + // Load footer template + $templateInstance->loadCodeTemplate('footer'); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable('footer', 'footer'); + + // Load the status template + $templateInstance->loadCodeTemplate('status'); + + // Assign the status template with the master template as a content ... ;) + $templateInstance->assignTemplateWithVariable('status', 'content'); + + // Load the master template + $templateInstance->loadCodeTemplate($masterTemplate); + + // Set title + $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_status_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('status_menu_class', array($appInstance)); + + // ... 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(); + + // Get the content back from the template engine and put it in response class + $templateInstance->transferToResponse($responseInstance); } /**