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 29be1ee..93084b3 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: REFILL-FORM-CAPTCHA
+$cfg->setConfigEntry('refill_form_captcha', "GraphicalCodeCaptcha");
+
 // 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: REFILL-FORM-CAPTCHA-SECURED
+$cfg->setConfigEntry('refill_form_captcha_secured', "Y");
+
 // CFG: BLOCK-SHOWS-REGISTRATION
 $cfg->setConfigEntry('block_shows_registration', "Y");
 
index 68e9c7a..98ed3d2 100644 (file)
@@ -57,8 +57,17 @@ class MoneyRefillPageFilter extends BaseFrameworkSystem implements Filterable {
         * @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 66f2b73..84cf84c 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!
index 198280b..9dd62b4 100644 (file)
@@ -232,7 +232,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // 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