]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/class_ApplicationHelper.php
CSS classes formed to ids and command LocalHome finished
[shipsimu.git] / application / ship-simu / class_ApplicationHelper.php
index a177d343c228d6c88a80909479d0fe8aa0fe0b9b..07aeffc472da90c32959f7e8547ea59496778718 100644 (file)
  * Please remember that this include file is being loaded *before* the class
  * loader is loading classes from "exceptions", "interfaces" and "main"!
  *
- * @author     Roland Haeder <roland __NOSPAM__ [at] __REMOVE_ME__ mxchange [dot] org>
- * @version    0.1
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication {
        /**
@@ -39,22 +55,27 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         */
        private $shortName = "";
 
+       /**
+        * The name of the master template
+        */
+       private $masterTemplate = "shipsimu_main";
+
        /**
         * An instance of this class
         */
        private static $thisInstance = null;
 
        /**
-        * Private constructor
+        * Protected constructor
         *
         * @return      void
         */
-       private function __construct () {
+       protected function __construct () {
                // Call parent constructor
-               parent::constructor(__CLASS__);
+               parent::__construct(__CLASS__);
 
                // Set description
-               $this->setPartDescr("Application-Helper");
+               $this->setObjectDescription("Application-Helper");
 
                // Create an unique ID
                $this->createUniqueID();
@@ -81,7 +102,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Getter for the version number
         *
-        * @return      $appVersion     The application's version number
+        * @return      $appVersion             The application's version number
         */
        public final function getAppVersion () {
                return $this->appVersion;
@@ -90,7 +111,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Setter for the version number
         *
-        * @param               $appVersion     The application's version number
+        * @param       $appVersion             The application's version number
         * @return      void
         */
        public final function setAppVersion ($appVersion) {
@@ -111,7 +132,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Setter for human-readable name
         *
-        * @param               $appName        The application's human-readable name
+        * @param       $appName        The application's human-readable name
         * @return      void
         */
        public final function setAppName ($appName) {
@@ -132,7 +153,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Setter for short uni*-like name
         *
-        * @param               $shortName      The application's short uni*-like name
+        * @param       $shortName      The application's short uni*-like name
         * @return      void
         */
        public final function setAppShortName ($shortName) {
@@ -141,14 +162,35 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                $this->shortName = $shortName;
        }
 
+       /**
+        * Getter for master template name
+        *
+        * @return      $masterTemplate         Name of the master template
+        */
+       public final function getMasterTemplate () {
+               return $this->masterTemplate;
+       }
+
        /**
         * Launches the ship-simulator game
         *
         * @return      void
         */
        public final function entryPoint () {
-               // Must still be implemented!
-               trigger_error(__METHOD__.": Not implemented yet!");
+               // Get default command
+               $defaultCommand = $this->getConfigInstance()->readConfig("default_command");
+
+               // Create a new request object
+               $requestInstance = HttpRequest::createHttpRequest();
+
+               // ... and a new response object
+               $responseInstance = HttpResponse::createHttpResponse($this);
+
+               // Get a new controller instance as well
+               $controllerInstance = LocalControllerResolver::createLocalControllerResolver($defaultCommand, $this)->resolveDefaultController();
+
+               // Handle the request
+               $controllerInstance->handleRequest($requestInstance, $responseInstance);
        }
 }