From f229c798fcaa3de7a4c5296c221397cb77a62a69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 15 Aug 2008 00:43:37 +0000 Subject: [PATCH] Refill page continued --- .gitattributes | 5 ++ application/ship-simu/config.php | 3 + .../ship-simu/main/actions/web/class_WebLogin | 78 ++++++++++++++++++ .../web/class_WebLoginMoneyRefillAction.php | 79 +++++++++++++++++++ application/ship-simu/main/filter/.htaccess | 1 + .../filter/class_MoneyRefillPageFilter.php | 66 ++++++++++++++++ .../de/code/action_login_money_refill.ctp | 8 ++ 7 files changed, 240 insertions(+) create mode 100644 application/ship-simu/main/actions/web/class_WebLogin create mode 100644 application/ship-simu/main/actions/web/class_WebLoginMoneyRefillAction.php create mode 100644 application/ship-simu/main/filter/.htaccess create mode 100644 application/ship-simu/main/filter/class_MoneyRefillPageFilter.php create mode 100644 application/ship-simu/templates/de/code/action_login_money_refill.ctp diff --git a/.gitattributes b/.gitattributes index 95797f5..3a42864 100644 --- a/.gitattributes +++ b/.gitattributes @@ -102,7 +102,9 @@ application/ship-simu/main/actions/ship-simu/.htaccess -text application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php -text application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -text application/ship-simu/main/actions/web/.htaccess -text +application/ship-simu/main/actions/web/class_WebLogin -text application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php -text +application/ship-simu/main/actions/web/class_WebLoginMoneyRefillAction.php -text application/ship-simu/main/bank/.htaccess -text application/ship-simu/main/bank/class_MoneyBank.php -text application/ship-simu/main/class_ -text @@ -136,6 +138,8 @@ application/ship-simu/main/drives/motor/.htaccess -text application/ship-simu/main/drives/motor/class_Motor.php -text application/ship-simu/main/factories/.htaccess -text application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text +application/ship-simu/main/filter/.htaccess -text +application/ship-simu/main/filter/class_MoneyRefillPageFilter.php -text application/ship-simu/main/goverment/.htaccess -text application/ship-simu/main/goverment/class_SimplifiedGoverment.php -text application/ship-simu/main/login/.htaccess -text @@ -195,6 +199,7 @@ application/ship-simu/templates/.htaccess -text application/ship-simu/templates/de/.htaccess -text application/ship-simu/templates/de/code/action_login_company.ctp -text application/ship-simu/templates/de/code/action_login_logout.ctp -text +application/ship-simu/templates/de/code/action_login_money_refill.ctp -text application/ship-simu/templates/de/code/action_login_profile.ctp -text application/ship-simu/templates/de/code/action_login_status_problem.ctp -text application/ship-simu/templates/de/code/action_login_welcome.ctp -text diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index 307310d..29be1ee 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -151,6 +151,9 @@ $cfg->setConfigEntry('captcha_register_verifier_class', "GraphicalCodeCaptchaVer // CFG: CONFIRM-CODE-VALIDATOR-CLASS $cfg->setConfigEntry('confirm_code_verifier_class', "ConfirmCodeVerifierFilter"); +// CFG: REFILL-PAGE-FILTER +$cfg->setConfigEntry('refill_page_class', "MoneyRefillPageFilter"); + // CFG: NEWS-HOME-LIMIT $cfg->setConfigEntry('news_home_limit', 10); diff --git a/application/ship-simu/main/actions/web/class_WebLogin b/application/ship-simu/main/actions/web/class_WebLogin new file mode 100644 index 0000000..c234cd4 --- /dev/null +++ b/application/ship-simu/main/actions/web/class_WebLogin @@ -0,0 +1,78 @@ + + * @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 . + */ +class WebLogin???Action extends BaseAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public final static function createWebLogin???Action (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebLogin???Action(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe add fetching company list of current user here? + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Unfinished method + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class')); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/actions/web/class_WebLoginMoneyRefillAction.php b/application/ship-simu/main/actions/web/class_WebLoginMoneyRefillAction.php new file mode 100644 index 0000000..7f63754 --- /dev/null +++ b/application/ship-simu/main/actions/web/class_WebLoginMoneyRefillAction.php @@ -0,0 +1,79 @@ + + * @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 . + */ +class WebLoginMoneyRefillAction extends BaseAction implements Commandable, Registerable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this action + * + * @param $resolverInstance An instance of an action resolver + * @return $actionInstance An instance of this action class + */ + public final static function createWebLoginMoneyRefillAction (ActionResolver $resolverInstance) { + // Get a new instance + $actionInstance = new WebLoginMoneyRefillAction(); + + // Set the resolver instance + $actionInstance->setResolverInstance($resolverInstance); + + // Return the instance + return $actionInstance; + } + + /** + * Executes the command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Maybe add fetching company list of current user here? + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Unfinished method + } + + /** + * Adds extra filters to the given controller instance + * + * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add user status filter here + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_class')); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/filter/.htaccess b/application/ship-simu/main/filter/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/ship-simu/main/filter/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/ship-simu/main/filter/class_MoneyRefillPageFilter.php b/application/ship-simu/main/filter/class_MoneyRefillPageFilter.php new file mode 100644 index 0000000..68e9c7a --- /dev/null +++ b/application/ship-simu/main/filter/class_MoneyRefillPageFilter.php @@ -0,0 +1,66 @@ + + * @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 . + */ +class MoneyRefillPageFilter extends BaseFrameworkSystem implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createMoneyRefillPageFilter () { + // Get a new instance + $filterInstance = new MoneyRefillPageFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Implement this! + $this->partialStub("Please implement this method."); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/templates/de/code/action_login_money_refill.ctp b/application/ship-simu/templates/de/code/action_login_money_refill.ctp new file mode 100644 index 0000000..66f2b73 --- /dev/null +++ b/application/ship-simu/templates/de/code/action_login_money_refill.ctp @@ -0,0 +1,8 @@ +
+
+ Jetzt dein {?currency?}-Konto aufladen! +
+
+ {?refill_form?} +
+
-- 2.39.5