More stubs in refill page, refill page filter basicly finished
authorRoland Häder <roland@mxchange.org>
Fri, 15 Aug 2008 18:19:03 +0000 (18:19 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 15 Aug 2008 18:19:03 +0000 (18:19 +0000)
application/ship-simu/config.php
application/ship-simu/main/filter/class_MoneyRefillPageFilter.php
application/ship-simu/templates/de/code/action_login_money_refill.ctp
inc/classes/main/class_BaseFrameworkSystem.php

index 29be1ee2cf2614e691ecdf4ab3da2ea36b0ef2e5..93084b3ced8cdeb3b56912355778c631167f9965 100644 (file)
@@ -205,6 +205,9 @@ $cfg->setConfigEntry('shipsimu_user_login_captcha', "GraphicalCodeCaptcha");
 // CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA
 $cfg->setConfigEntry('shipsimu_guest_login_captcha', "GraphicalCodeCaptcha");
 
 // CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA
 $cfg->setConfigEntry('shipsimu_guest_login_captcha', "GraphicalCodeCaptcha");
 
+// CFG: REFILL-FORM-CAPTCHA
+$cfg->setConfigEntry('refill_form_captcha', "GraphicalCodeCaptcha");
+
 // CFG: LOGOUT-IMMEDIATE
 $cfg->setConfigEntry('logout_immediate', "N");
 
 // CFG: LOGOUT-IMMEDIATE
 $cfg->setConfigEntry('logout_immediate', "N");
 
@@ -226,6 +229,9 @@ $cfg->setConfigEntry('shipsimu_user_login_captcha_secured', "Y");
 // CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA-SECURED
 $cfg->setConfigEntry('shipsimu_guest_login_captcha_secured', "Y");
 
 // CFG: SHIPSIMU-GUEST-LOGIN-CAPTCHA-SECURED
 $cfg->setConfigEntry('shipsimu_guest_login_captcha_secured', "Y");
 
+// CFG: REFILL-FORM-CAPTCHA-SECURED
+$cfg->setConfigEntry('refill_form_captcha_secured', "Y");
+
 // CFG: BLOCK-SHOWS-REGISTRATION
 $cfg->setConfigEntry('block_shows_registration', "Y");
 
 // CFG: BLOCK-SHOWS-REGISTRATION
 $cfg->setConfigEntry('block_shows_registration', "Y");
 
index 68e9c7adfff63f0d0fdf27d7ffdcf6f3cb123b08..98ed3d2530dfaa0d75bec8d51f628cffd2092888 100644 (file)
@@ -57,8 +57,17 @@ class MoneyRefillPageFilter extends BaseFrameworkSystem implements Filterable {
         * @return      void
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
         * @return      void
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub("Please implement this method.");
+               // Is the configuration variable set?
+               if ($this->getConfigInstance()->readConfig('refill_page_active') === "N") {
+                       // Password is empty
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('refill_page_not_active');
+
+                       // Abort here
+                       return false;
+               } // END - if
        }
 }
 
        }
 }
 
index 66f2b73eab1cac459e58f107f337cb7a49cd0fe4..84cf84cd4a0a464ee913dfb90a0e375ac7ac1b0b 100644 (file)
@@ -1,3 +1,39 @@
+<?php
+// Neue Helper-Instanz holen
+$helper = WebFormHelper::createWebFormHelper($this, 'refill_form');
+
+// Add form group
+$helper->addFormGroup('refill_form', "Bitte w&auml;hle aus, was du nachbestellen willst und gebe die Menge an.");
+
+// Add sub group
+$helper->addFormSubGroup('refill_type', "Was m&ouml;chstest du nun nachbestellen?");
+$helper->addInputSelectField('type', "Bitte ausw&auml;hlen");
+
+// In-game currencies (if more than default add them here!)
+$helper->addSelectSubOption('currencies', "--- W&auml;hrungen ---");
+$helper->addSelectOption('currency', "{?currency?}");
+
+// Raw materials
+$helper->addSelectSubOption('raw_materials', "--- Rohstoffe ---");
+$helper->addSelectOption('raw_wood', "Holz");
+$helper->addSelectOption('raw_iron', "Metall");
+$helper->addSelectOption('raw_stones', "Steine");
+
+// This is needed to close the select tag
+$helper->addInputSelectField('type', "");
+
+// CAPTCHA enbaled?
+if ($helper->ifFormSecuredWithCaptcha()) {
+       $helper->addFormGroup('captcha_refill', "Bitte wiederhole den angezeigten Code:");
+       $helper->addCaptcha();
+} // END - if
+
+// Submit button
+$helper->addFormGroup('buttons_refill', "Mit Absenden des Formulars wird deine Nachbestellung rechtskr&auml;ftig!");
+$helper->addInputResetButton("Eingaben l&ouml;schen");
+$helper->addInputSubmitButton("Nachbestellung verbindlich aufgeben");
+$helper->flushContent();
+?>
 <div id="refill_frame">
        <div class="content_header">
                Jetzt dein {?currency?}-Konto aufladen!
 <div id="refill_frame">
        <div class="content_header">
                Jetzt dein {?currency?}-Konto aufladen!
index 198280bd430a4044918eb05421f3f00b0e0e571a..9dd62b4f4467abcbb78a441bd2e85cdc914dd3b4 100644 (file)
@@ -232,7 +232,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Some arguments are there
                        foreach ($args as $arg) {
                                // Add the type
                        // Some arguments are there
                        foreach ($args as $arg) {
                                // Add the type
-                               $argsString .= $arg." (".gettype($arg)."), ";
+                               $argsString .= $arg." (".gettype($arg);
+
+                               // Add length if type is string
+                               if (gettype($arg) == 'string') $argsString .= ", ".strlen($arg);
+
+                               // Closing bracket
+                               $argsString .= "), ";
                        } // END - foreach
 
                        // Remove last comma
                        } // END - foreach
 
                        // Remove last comma