]> git.mxchange.org Git - city.git/blobdiff - application/city/classes/commands/html/class_CityHtmlLoginAreaCommand.php
Continued:
[city.git] / application / city / classes / commands / html / class_CityHtmlLoginAreaCommand.php
index 8888a092debd83b4bd8995710c6cb8a4b1b03353..d4f5a9f0bc8e178e09655fc252cda6d0b3c5811e 100644 (file)
@@ -1,10 +1,23 @@
 <?php
+// Own namespace
+namespace Org\Mxchange\City\Command;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Controller\Controller;
+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;
+use Org\Mxchange\CoreFramework\Response\Responseable;
+
 /**
  * A command for the login area (member/gamer area)
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
+ * @copyright  Copyright (c) 2015, 2016 City Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -75,7 +88,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the action instance from registry
-               $actionInstance = Registry::getRegistry()->getInstance('action');
+               $actionInstance = GenericRegistry::getRegistry()->getInstance('action');
 
                // Do we have an action here?
                if ($actionInstance instanceof PerformableAction) {
@@ -84,7 +97,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                } // END - if
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
@@ -93,7 +106,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $templateInstance->assignConfigVariable('base_url');
 
                // Assign all the application's data with template variables
-               $templateInstance->assignApplicationData($applicationInstance);
+               $templateInstance->assignApplicationData();
 
                // Load the master template
                $masterTemplate = $applicationInstance->buildMasterTemplateName();
@@ -130,7 +143,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($this->actionName . '_title'));
+               $templateInstance->assignVariable('title', FrameworkBootstrap::getLanguageInstance()->getMessage($this->actionName . '_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.
@@ -165,13 +178,13 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $actionInstance = NULL;
 
                // Get registry
-               $registryInstance = Registry::getRegistry();
+               $registryInstance = GenericRegistry::getRegistry();
 
                // Get our application instance from the registry
                $applicationInstance = $registryInstance->getInstance('application');
 
                // Default action is the one from configuration
-               $this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->getConfigEntry('login_default_action');
+               $this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_default_action');
 
                // Get "action" from request
                $actReq = $requestInstance->getRequestElement('action');
@@ -182,11 +195,8 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                        $this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq;
                } // END - if
 
-               // Get application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
-
                // Get a resolver
-               $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName, $applicationInstance);
+               $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName);
 
                // Resolve the action
                $actionInstance = $actionResolver->resolveAction();
@@ -195,9 +205,7 @@ class CityHtmlLoginAreaCommand extends BaseCommand implements Commandable {
                $actionInstance->addExtraFilters($controllerInstance, $requestInstance);
 
                // Remember this action in registry
-               Registry::getRegistry()->addInstance('action', $actionInstance);
+               GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
        }
-}
 
-// [EOF]
-?>
+}