X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcommands%2Fweb%2Fclass_WebRegisterCommand.php;h=42f9379bb4d80ffc97131c4919a59006b40b1528;hp=bc10daf07a9cf44ed052e9135d22c54a12f92e14;hb=ec23e72b16433ac136817f3ea78697fb70236e4a;hpb=b3e47fb693fb8d40868158b0192b3392b309d97a diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index bc10daf..42f9379 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @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 * @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class WebRegisterCommand extends BaseCommand implements Commandable { +class WebRegisterCommand extends BaseCommand implements Commandable, Registerable { /** * Protected constructor * @@ -30,15 +30,6 @@ class WebRegisterCommand extends BaseCommand implements Commandable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set special description - $this->setObjectDescription("Command for the registration form"); - - // Create unique ID number - $this->generateUniqueId(); - - // Clean up a little - $this->removeSystemArray(); } /** @@ -66,38 +57,44 @@ class WebRegisterCommand extends BaseCommand implements Commandable { * @return void */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Set request instance as extra instance + Registry::getRegistry()->addInstance('extra', $this); + // Get the application instance $appInstance = $this->getResolverInstance()->getApplicationInstance(); // Prepare a template instance - $templateInstance = $this->prepareTemplateEngine($appInstance); + $templateInstance = $this->prepareTemplateInstance($appInstance); // Assign all the application's data with template variables $templateInstance->assignApplicationData($appInstance); + // Assign base URL + $templateInstance->assignConfigVariable('base_url'); + // Load the master template $masterTemplate = $appInstance->getMasterTemplate(); // Load header template - $templateInstance->loadCodeTemplate("header"); + $templateInstance->loadCodeTemplate('header'); // Compile and assign it with a variable $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable("header", "header"); + $templateInstance->assignTemplateWithVariable('header', 'header'); // Load footer template - $templateInstance->loadCodeTemplate("footer"); + $templateInstance->loadCodeTemplate('footer'); // Compile and assign it with a variable $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable("footer", "footer"); + $templateInstance->assignTemplateWithVariable('footer', 'footer'); // Load the register template - $templateInstance->loadCodeTemplate("register_form"); + $templateInstance->loadCodeTemplate('register_form'); // Assign the register template with the master template as a content ... ;) $templateInstance->compileTemplate(); - $templateInstance->assignTemplateWithVariable("register_form", "content"); + $templateInstance->assignTemplateWithVariable('register_form', 'content'); // Load the master template $templateInstance->loadCodeTemplate($masterTemplate); @@ -122,7 +119,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable { * @return void */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { - // Empty for now + // Empty class } }