From f7fd66d99fcae95e27dbce35b593269b198acf85 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 6 Apr 2015 01:55:07 +0200 Subject: [PATCH] Fixes + added missing directories. Signed-off-by: Roland Haeder --- .../selector/class_ApplicationHelper.php | 22 +++++- .../selector/class_ApplicationSelector.php | 2 +- application/selector/config.php | 4 +- application/selector/language/.htaccess | 1 + .../shipsimu/class_ApplicationHelper.php | 22 +++++- application/shipsimu/config.php | 67 ++++++++++--------- application/shipsimu/language/.htaccess | 1 + .../class_ShipSimuHtmlControllerResolver.php | 4 +- core | 2 +- 9 files changed, 81 insertions(+), 44 deletions(-) create mode 100644 application/selector/language/.htaccess create mode 100644 application/shipsimu/language/.htaccess diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index 4f455f3..c94407f 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -170,14 +170,14 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica } // END - if // ... and a new response object - $responseClass = sprintf("%sResponse", $this->convertToClassName($response)); + $responseClass = sprintf('%sResponse', $this->convertToClassName($response)); $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this)); // Remember response instance here $this->setResponseInstance($responseInstance); // Get the parameter from the request - $commandName = $requestInstance->getRequestElement('command'); + $commandName = $requestInstance->getRequestElement('page'); // If it is null then get default command if (is_null($commandName)) { @@ -185,7 +185,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $commandName = $responseInstance->getDefaultCommand(); // Set it in request - $requestInstance->setRequestElement('command', $commandName); + $requestInstance->setRequestElement('page', $commandName); } // END - if // Get a controller resolver @@ -195,10 +195,26 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Get a controller instance as well $this->setControllerInstance($resolverInstance->resolveController()); + // Initialize language system + $languageInstance = ObjectFactory::createObjectByConfiguredName('language_system_class'); + + // And set it here + $this->setLanguageInstance($languageInstance); + // Launch the main routine here $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance); } + /** + * Assigns extra application-depending data + * + * @param $templateInstance An instance of a CompileableTemplate + * @return void + * @todo Nothing to add? + */ + public function assignExtraTemplateData (CompileableTemplate $templateInstance) { + } + /** * Handle the indexed array of fatal messages and puts them out in an * acceptable fasion diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index f8e080a..8dd0648 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -197,7 +197,7 @@ class ApplicationSelector extends BaseFrameworkSystem { $templateInstance = $this->prepareTemplateInstance($appInstance); // Try to load the web template - $templateInstance->loadWebTemplate(sprintf('%s_%s', + $templateInstance->loadHtmlTemplate(sprintf('%s_%s', $this->getConfigInstance()->getConfigEntry('tpl_selector_prefix'), strtolower($appInstance->getAppShortName()) )); diff --git a/application/selector/config.php b/application/selector/config.php index 72a2ca6..9aad2f9 100644 --- a/application/selector/config.php +++ b/application/selector/config.php @@ -28,8 +28,8 @@ $cfg = FrameworkConfiguration::getSelfInstance(); // CFG: HEADER-CHARSET $cfg->setConfigEntry('header_charset', 'utf-8'); -// CFG: DEFAULT-WEB-COMMAND -$cfg->setConfigEntry('default_web_command', 'home'); +// CFG: DEFAULT-SELECTOR-HTML-COMMAND +$cfg->setConfigEntry('default_selector_html_command', 'home'); // CFG: DEFAULT-IMAGE-COMMAND $cfg->setConfigEntry('default_image_command', 'build'); diff --git a/application/selector/language/.htaccess b/application/selector/language/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/selector/language/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/class_ApplicationHelper.php b/application/shipsimu/class_ApplicationHelper.php index 4f455f3..c94407f 100644 --- a/application/shipsimu/class_ApplicationHelper.php +++ b/application/shipsimu/class_ApplicationHelper.php @@ -170,14 +170,14 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica } // END - if // ... and a new response object - $responseClass = sprintf("%sResponse", $this->convertToClassName($response)); + $responseClass = sprintf('%sResponse', $this->convertToClassName($response)); $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this)); // Remember response instance here $this->setResponseInstance($responseInstance); // Get the parameter from the request - $commandName = $requestInstance->getRequestElement('command'); + $commandName = $requestInstance->getRequestElement('page'); // If it is null then get default command if (is_null($commandName)) { @@ -185,7 +185,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $commandName = $responseInstance->getDefaultCommand(); // Set it in request - $requestInstance->setRequestElement('command', $commandName); + $requestInstance->setRequestElement('page', $commandName); } // END - if // Get a controller resolver @@ -195,10 +195,26 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica // Get a controller instance as well $this->setControllerInstance($resolverInstance->resolveController()); + // Initialize language system + $languageInstance = ObjectFactory::createObjectByConfiguredName('language_system_class'); + + // And set it here + $this->setLanguageInstance($languageInstance); + // Launch the main routine here $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance); } + /** + * Assigns extra application-depending data + * + * @param $templateInstance An instance of a CompileableTemplate + * @return void + * @todo Nothing to add? + */ + public function assignExtraTemplateData (CompileableTemplate $templateInstance) { + } + /** * Handle the indexed array of fatal messages and puts them out in an * acceptable fasion diff --git a/application/shipsimu/config.php b/application/shipsimu/config.php index b37151f..4b22332 100644 --- a/application/shipsimu/config.php +++ b/application/shipsimu/config.php @@ -28,8 +28,11 @@ $cfg = FrameworkConfiguration::getSelfInstance(); // CFG: HEADER-CHARSET $cfg->setConfigEntry('header_charset', 'utf-8'); -// CFG: DEFAULT-WEB-COMMAND -$cfg->setConfigEntry('default_web_command', 'home'); +// CFG: DEFAULT-SHIP-SIMU-HTML-COMMAND +$cfg->setConfigEntry('default_ship_simu_html_command', 'home'); + +// CFG: DEFAULT-HTML-COMMAND +$cfg->setConfigEntry('default_html_command', 'home'); // CFG: DEFAULT-IMAGE-COMMAND $cfg->setConfigEntry('default_image_command', 'build'); @@ -184,8 +187,8 @@ $cfg->setConfigEntry('login_register_action_url', 'index.php?app={?app_short_nam // CFG: CONFIRM-DIRECT-LOGIN-ACTION-URL $cfg->setConfigEntry('confirm_direct_login_action_url', 'index.php?app={?app_short_name?}&page=login_area'); -// CFG: WEB-CMD-USER-IS-NULL-URL -$cfg->setConfigEntry('web_cmd_user_is_null_url', 'index.php?app={?app_short_name?}&page=problem&problem=user_null'); +// CFG: HTML-CMD-USER-IS-NULL-URL +$cfg->setConfigEntry('html_cmd_user_is_null_url', 'index.php?app={?app_short_name?}&page=problem&problem=user_null'); // CFG: NEWS-READER-HOME-CLASS $cfg->setConfigEntry('news_reader_home_class', 'DefaultNewsReader'); @@ -454,47 +457,47 @@ $cfg->setConfigEntry('government_startup_help_limit', 3); // CFG: GOVERNMENT-TRAINING-LIMIT $cfg->setConfigEntry('government_training_limit', 2); -// CFG: WEB-BLOCK-HELPER -$cfg->setConfigEntry('web_block_helper', 'WebBlockHelper'); +// CFG: HTML-BLOCK-HELPER +$cfg->setConfigEntry('html_block_helper', 'HtmlBlockHelper'); -// CFG: WEB-FORM-HELPER -$cfg->setConfigEntry('web_form_helper', 'WebFormHelper'); +// CFG: HTML-FORM-HELPER +$cfg->setConfigEntry('html_form_helper', 'HtmlFormHelper'); -// CFG: WEB-LINK-HELPER -$cfg->setConfigEntry('web_link_helper', 'WebLinkHelper'); +// CFG: HTML-LINK-HELPER +$cfg->setConfigEntry('html_link_helper', 'HtmlLinkHelper'); -// CFG: WEB-CMD-GOVERNMENT-FAILED-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_government_failed_resolver_class', 'WebGovernmentFailedCommandResolver'); +// CFG: HTML-CMD-GOVERNMENT-FAILED-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_government_failed_resolver_class', 'HtmlGovernmentFailedCommandResolver'); -// CFG: WEB-CMD-LOGIN-FAILED-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_login_failed_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-LOGIN-FAILED-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_login_failed_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-COMPANY-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_company_resolver_class', 'WebCompanyCommandResolver'); +// CFG: HTML-CMD-COMPANY-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_company_resolver_class', 'HtmlCompanyCommandResolver'); -// CFG: WEB-CMD-HOME-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_home_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-HOME-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_home_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-REGISTER-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_register_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-REGISTER-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_register_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-DO-FORM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_do_form_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-DO-FORM-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_do_form_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-LOGIN-AREA-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_login_area_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-LOGIN-AREA-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_login_area_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-CONFIRM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_confirm_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-CONFIRM-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_confirm_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-PROBLEM-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_problem_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-PROBLEM-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_problem_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-LOGOUT-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_logout_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-LOGOUT-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_logout_resolver_class', 'HtmlCommandResolver'); -// CFG: WEB-CMD-LOGOUT-DONE-RESOLVER-CLASS -$cfg->setConfigEntry('web_cmd_logout_done_resolver_class', 'WebCommandResolver'); +// CFG: HTML-CMD-LOGOUT-DONE-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_logout_done_resolver_class', 'HtmlCommandResolver'); // CFG: REFILL-REQUEST-CURRENCY-PAYMENT-TYPE $cfg->setConfigEntry('refill_request_currency_payment_type', 'test'); diff --git a/application/shipsimu/language/.htaccess b/application/shipsimu/language/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/shipsimu/language/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php b/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php index 9f18f22..dc57483 100644 --- a/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php +++ b/application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php @@ -31,8 +31,8 @@ class ShipSimuHtmlControllerResolver extends BaseControllerResolver implements C // Call parent constructor parent::__construct(__CLASS__); - // Set prefix to 'ShipSimuHtml' - $this->setClassPrefix('ShipSimuHtml'); + // Set prefix to 'html' + $this->setClassPrefix('html'); } /** diff --git a/core b/core index 6a1f1d3..5577e5a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 6a1f1d3ccf79613ad0792e206fd2c1932dbb291e +Subproject commit 5577e5acf2839a1bfa9778c3c70381e44e196b19 -- 2.39.5