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;
use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
+use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
/**
* A command for the login area (member/gamer area)
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
if ($actionInstance instanceof PerformableAction) {
// Execute the action (shall not output anything, see below why)
$actionInstance->execute($requestInstance, $responseInstance);
- } // END - if
+ }
// Get the application instance
- $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
+ $applicationInstance = ApplicationHelper::getSelfInstance();
// Assign base URL
$this->getTemplateInstance()->assignConfigVariable('base_url');
// 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('login_area_menu_class', array($applicationInstance));
+ $menuInstance = ObjectFactory::createObjectByConfiguredName('login_area_menu_class');
// Render the menu
$menuInstance->renderMenu();
* @return void
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
- // Default is no action
- $actionInstance = NULL;
-
- // Get registry
- $registryInstance = GenericRegistry::getRegistry();
-
// Get our application instance from the registry
- $applicationInstance = $registryInstance->getInstance('application');
+ $applicationInstance = ApplicationHelper::getSelfInstance();
// Default action is the one from configuration
$this->actionName = StringUtils::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_default_action');
$actReq = $requestInstance->getRequestElement('action');
// Do we have a "action" parameter set?
- if ((is_string($actReq)) && (!empty($actReq))) {
+ if (!empty($actReq)) {
// Then use it with prefix
$this->actionName = StringUtils::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq;
- } // END - if
+ }
// Get a resolver
$actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName);