X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fresolver%2Faction%2Fclass_BaseActionResolver.php;h=4196b274f79eb21be8cc20a117e8e1fc9bf5d2e0;hb=08330903ee5bd8ea967622ff7473d13dff19beb5;hp=5d4738b996d866903054eb01b7c3a5ec02280cda;hpb=3107989f93cfb5808ce9d75f1c7d2b7ee3d83d18;p=core.git diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index 5d4738b9..4196b274 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseActionResolver extends BaseResolver { - /** - * Prefix for local, remote or other resolver - */ - private $actionPrefix = ''; - /** * Validated action name */ @@ -43,16 +38,6 @@ class BaseActionResolver extends BaseResolver { parent::__construct($className); } - /** - * Setter for action prefix - * - * @param $actionPrefix Last validated actionPrefix - * @return void - */ - protected final function setActionPrefix ($actionPrefix) { - $this->actionPrefix = $actionPrefix; - } - /** * Setter for action name * @@ -73,10 +58,10 @@ class BaseActionResolver extends BaseResolver { } /** - * Checks wether the given action is valid + * Checks whether the given action is valid * * @param $actionName The default action we shall execute - * @return $isValid Wether the given action is valid + * @return $isValid Whether the given action is valid * @throws EmptyVariableException Thrown if given action is not set */ public function isActionValid ($actionName) { @@ -89,11 +74,11 @@ class BaseActionResolver extends BaseResolver { throw new EmptyVariableException(array($this, 'actionName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING); } // END - if + // Create class name + $className = $this->getClassPrefix() . $this->convertToClassName($actionName) . 'Action'; + // Now, let us create the full name of the action class - $this->setClassName(sprintf("%s%sAction", - $this->actionPrefix, - $this->convertToClassName($actionName) - )); + $this->setClassName($className); // Is this class already loaded? if (class_exists($this->getClassName())) { @@ -115,12 +100,13 @@ class BaseActionResolver extends BaseResolver { */ protected function loadAction () { // Init action instance - $actionInstance = null; + $actionInstance = NULL; // Create action class name - $this->setClassName(sprintf("Web%sAction", - $this->convertToClassName($this->getActionName()) - )); + $className = $this->getClassPrefix() . $this->convertToClassName($this->getActionName()) . 'Action'; + + // ... and set it + $this->setClassName($className); // Initiate the action $actionInstance = ObjectFactory::createObjectByName($this->getClassName(), array($this));