]> git.mxchange.org Git - shipsimu.git/blobdiff - application/selector/class_ApplicationHelper.php
Opening times added (still a lot partial stubs)
[shipsimu.git] / application / selector / class_ApplicationHelper.php
index b089944e4d7bf641219a12cf54c64800313fa246..e5e30e5102f25808c80823ea3a73409ea57c860e 100644 (file)
@@ -160,7 +160,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         */
        public function buildMasterTemplateName () {
                // Get short name and add suffix
-               $masterTemplateName = str_replace("-", "", $this->getAppShortName()) . "_main";
+               $masterTemplateName = str_replace('-', '', $this->getAppShortName()) . '_main';
 
                // Return it
                return $masterTemplateName;
@@ -175,9 +175,9 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                // Create a new request object
                $requestInstance = ObjectFactory::createObjectByName('HttpRequest');
 
-               // Default response is HTTP (HTML page) and type is "Web"
-               $response = "http";
-               $responseType = "web";
+               // Default response is HTTP (HTML page) and type is 'Web'
+               $response = 'http';
+               $responseType = 'web';
 
                // Do we have another response?
                if ($requestInstance->isRequestElementSet('request')) {
@@ -203,7 +203,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                        $commandName = $responseInstance->getDefaultCommand();
 
                        // Set it in request
-                       $requestInstance->setRequestElement('page');
+                       $requestInstance->setRequestElement('page', $commandName);
                } // END - if
 
                // Get a resolver
@@ -213,6 +213,12 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                // Get a controller instance as well
                $this->controllerInstance = $resolverInstance->resolveController();
 
+               // Get a web output class
+               $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($this));
+
+               // Set it in this application
+               $this->setWebOutputInstance($outputInstance);
+
                // Handle the request
                $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
        }
@@ -227,7 +233,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
        public function handleFatalMessages (array $messageList) {
                // Walk through all messages
                foreach ($messageList as $message) {
-                       print("MSG:".$message."<br />\n");
+                       print("MSG:" . $message . "<br />\n");
                } // END - if
        }