// 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: 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");
* @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
}
}
+<?php
+// Neue Helper-Instanz holen
+$helper = WebFormHelper::createWebFormHelper($this, 'refill_form');
+
+// Add form group
+$helper->addFormGroup('refill_form', "Bitte wähle aus, was du nachbestellen willst und gebe die Menge an.");
+
+// Add sub group
+$helper->addFormSubGroup('refill_type', "Was möchstest du nun nachbestellen?");
+$helper->addInputSelectField('type', "Bitte auswählen");
+
+// In-game currencies (if more than default add them here!)
+$helper->addSelectSubOption('currencies', "--- Wä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äftig!");
+$helper->addInputResetButton("Eingaben löschen");
+$helper->addInputSubmitButton("Nachbestellung verbindlich aufgeben");
+$helper->flushContent();
+?>
<div id="refill_frame">
<div class="content_header">
Jetzt dein {?currency?}-Konto aufladen!
// 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