]> git.mxchange.org Git - city.git/commitdiff
Used sendGenericGetResponse() from latest 'core' commit.
authorRoland Haeder <roland@mxchange.org>
Sun, 5 Apr 2015 22:00:31 +0000 (00:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 5 Apr 2015 22:00:31 +0000 (00:00 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/city/class_ApplicationHelper.php
application/city/config.php
application/city/main/commands/html/class_CityHtmlHomeCommand.php
application/city/main/resolver/controller/html/class_CityHtmlControllerResolver.php
core

index da8b31b5713e6a8d03f8c7d4b2ab3031348ffa7e..943b3d8c0a1fbd569701df3cb91676a4142899e4 100644 (file)
@@ -177,7 +177,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                $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)) {
index 580273eb8e964d982e4bf83059c038fca182dc9a..4c1275ba66025837f160ef0cc4a446aa77795ca2 100644 (file)
@@ -50,15 +50,27 @@ $cfg->setConfigEntry('city_init_state_class', 'CityInitState');
  *                                HTML client                                 *
  ******************************************************************************/
 
+// CFG: DEFAULT-HTML-COMMAND
+$cfg->setConfigEntry('default_html_command', 'home');
+
 // CFG: DEFAULT-CITY-HTML-COMMAND
 $cfg->setConfigEntry('default_city_html_command', 'home');
 
-// CFG: CITY-HTML-CMD-HOME-RESOLVER-CLASS
-$cfg->setConfigEntry('city_html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
+// CFG: HTML-CMD-HOME-RESOLVER-CLASS
+$cfg->setConfigEntry('html_cmd_home_resolver_class', 'CityHtmlCommandResolver');
+
+// CFG: HTML-CMD-REGISTER-RESOLVER-CLASS
+$cfg->setConfigEntry('html_cmd_register_resolver_class', 'CityHtmlCommandResolver');
+
+// CFG: NEWS-READER-REGISTER-CLASS
+$cfg->setConfigEntry('news_reader_register_class', 'DefaultNewsReader');
 
 // CFG: NEWS-HOME-LIMIT
 $cfg->setConfigEntry('news_home_limit', 10);
 
+// CFG: NEWS-REGISTER-LIMIT
+$cfg->setConfigEntry('news_register_limit', 5);
+
 // CFG: CITY-HOME-MENU-CLASS
 $cfg->setConfigEntry('city_home_menu_class', 'CityHomeMenu');
 
index de1ad2930dc6d99865737c75ad46eceb3304daf8..8a7ef6012e8ec1feef8688fd4752a06ac117d1c6 100644 (file)
@@ -55,66 +55,22 @@ class CityHtmlHomeCommand extends BaseCommand implements Commandable {
         * @param       $requestInstance        An instance of a class with an Requestable interface
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
-        * @todo        ~10% done?
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               // This command doesn't handle any POST requests, so only handle get request
+               if ($requestInstance->isPostRequestMethod()) {
+                       // Don't handle this here
+                       $response->sendRequestMethodNotAllowed();
 
-               // Prepare a template instance
-               $templateInstance = $this->prepareTemplateInstance($applicationInstance);
-
-               // Transfer application data
-               $templateInstance->assignApplicationData($applicationInstance);
-
-               // Load the master template
-               $masterTemplate = $applicationInstance->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 home template
-               $templateInstance->loadCodeTemplate('home');
-
-               // Assign the home template with the master template as a content ... ;)
-               $templateInstance->assignTemplateWithVariable('city_home', 'main_content');
-
-               // Load the master template
-               $templateInstance->loadCodeTemplate($masterTemplate);
-
-               // Set title
-               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage('page_city_home_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('city_home_menu_class', array($applicationInstance));
-
-               // Render the menu
-               $menuInstance->renderMenu();
-
-               // Transfer it to the template engine instance
-               $menuInstance->transferContentToTemplateEngine($templateInstance);
+                       // Bail out
+                       exit();
+               } // END - if
 
                /*
-                * ... 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.
+                * This is a generic HTML request, this means that a regular page with
+                * header, menu, content and footer shall be send to the client.
                 */
-               $templateInstance->compileVariables();
-
-               // Get the content back from the template engine and put it in response class
-               $templateInstance->transferToResponse($responseInstance);
+               $this->sendGenericGetResponse($requestInstance, $responseInstance);
        }
 
        /**
index d390856019ae4f9a5c14feba6f8596c620737edc..8611b80a2413a89429f76b711c4af355f5a946f4 100644 (file)
@@ -32,7 +32,7 @@ class CityHtmlControllerResolver extends BaseControllerResolver implements Contr
                parent::__construct(__CLASS__);
 
                // Set prefix to 'Html'
-               $this->setClassPrefix('city_html');
+               $this->setClassPrefix('html');
        }
 
        /**
diff --git a/core b/core
index 64959d4352a0cc846da9951bb12f6ba86d3dab58..261df392e4c7aea59ce5be06f7b070db37d9da63 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 64959d4352a0cc846da9951bb12f6ba86d3dab58
+Subproject commit 261df392e4c7aea59ce5be06f7b070db37d9da63