Host name fixed (a redirect causes an error), duplicate code rewrriten to be more...
[core.git] / inc / classes / main / resolver / command / image / class_ImageCommandResolver.php
index fee6f4fe6970d787aed1b122247a7623dfaeefde..cc571227fb5b67e0356778867630316382c11d7a 100644 (file)
@@ -37,7 +37,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                parent::__construct(__CLASS__);
 
                // Set prefix to "Image"
-               $this->setCommandPrefix('Image');
+               $this->setClassPrefix('Image');
        }
 
        /**
@@ -89,7 +89,9 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                $commandName = $requestInstance->getRequestElement('page');
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+               if (empty($commandName)) {
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+               } // END - if
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {
@@ -107,7 +109,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                } // END - if
 
                // Set last command
-               $this->lastCommandInstance = $commandInstance;
+               $this->setResolvedInstance($commandInstance);
 
                // Return the resolved command instance
                return $commandInstance;
@@ -125,13 +127,15 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                $commandInstance = null;
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+               if (empty($commandName)) {
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
+               } // END - if
 
                // Check if command is valid
                if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
-               }
+               } // END - if
 
                // Get the command
                $commandInstance = $this->loadCommand($commandName);
@@ -153,7 +157,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                $commandInstance = null;
 
                // Create class name
-               $className = $this->getCommandPrefix() . $this->convertToClassName($commandName) . 'Command';
+               $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
 
                // Is this class loaded?
                if (!class_exists($this->getClassName())) {