]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/resolver/command/web/class_WebCommandResolver.php
Host name fixed (a redirect causes an error), duplicate code rewrriten to be more...
[core.git] / inc / classes / main / resolver / command / web / class_WebCommandResolver.php
index e020350d254f0c15a3df50ecc82fbf6c3aefb2c3..a19ff10c463f86b3ce814e56b4190547daf66012 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -37,7 +37,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                parent::__construct(__CLASS__);
 
                // Set prefix to "Web"
-               $this->setCommandPrefix('Web');
+               $this->setClassPrefix('Web');
        }
 
        /**
@@ -49,7 +49,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
         * @throws      EmptyVariableException          Thrown if default command is not set
         * @throws      InvalidCommandException         Thrown if default command is invalid
         */
-       public final static function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
+       public static final function createWebCommandResolver ($commandName, ManageableApplication $appInstance) {
                // Create the new instance
                $resolverInstance = new WebCommandResolver();
 
@@ -89,7 +89,9 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                $commandName = $requestInstance->getRequestElement('page');
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+               if (empty($commandName)) {
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+               } // END - if
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {
@@ -107,7 +109,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                } // END - if
 
                // Set last command
-               $this->lastCommandInstance = $commandInstance;
+               $this->setResolvedInstance($commandInstance);
 
                // Return the resolved command instance
                return $commandInstance;
@@ -125,7 +127,9 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
                $commandInstance = null;
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+               if (empty($commandName)) {
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
+               } // END - if
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {