birthday input fields.
- Introduced doTemplateDisplayReferralIdContent() template helper to get rid
of an unneccessary if() block and $content[foo] in template
- Content of template register_header.tpl has now been moved to
inc/language/register_de.php and has marked as deprecated
- Added new template (unfinished) for ext-wernis registration provider
Signed-off-by: Roland Häder <roland@mxchange.org>
'COUNTRY_CODE' => "Ländercode",
'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
'GUEST_ENTER_PASSWORDS' => "Passwort und -wiederholung eingeben:",
+ 'GUEST_REGISTER_GENERIC_TITLE' => "Anmeldeformular zum {?mt_word?} <strong>{?MAIN_TITLE?}</strong>:",
// Points accounts - subject
'POINTS_SUBJECT_REGISTER_WELCOME' => "Anmeldegutschrift",
'GUEST_WERNIS_REGISTRATION_PASSWORD_NOT_SET' => "Bitte geben Sie Ihr Wernis-Passwort ein. Tipp: Dies ist <strong>nicht</strong> Ihr Account-Passwort.",
'GUEST_WERNIS_REGISTRATION_INVALID_CHALLENGE_RESPONSE' => "Es ist beim Anmeldeversuch ein Fehler unterlaufen: Falsche Challenge-Response",
'GUEST_WERNIS_REGISTRATION_ZERO_ROWS_FOUND' => "Es konnte keine Anmeldedaten von der WDS66-API gefunden werden. Haben Sie auch den richtigen Link aufgerufen?",
+ 'GUEST_REGISTER_WERNIS_PROVIDER_TITLE' => "Anmeldung mit WDS66 am {?mt_word?} <strong>{?MAIN_TITLE?}</strong>:",
// Points accounts - subject
'POINTS_SUBJECT_WERNIS_WITHDRAW' => "Einzahlung vom WDS66-Account",
} // END - if
// Generate birthday selection
- switch (getLanguage()) {
- case 'de': // German date format
- $content['birthday_selection'] = addSelectionBox('da', postRequestElement('day')).addSelectionBox('mo', postRequestElement('month')).addSelectionBox('ye', postRequestElement('year'));
- break;
-
- default: // Default is the US date format... :)
- $content['birthday_selection'] = addSelectionBox('mo', postRequestElement('month')).addSelectionBox('da', postRequestElement('day')).addSelectionBox('ye', postRequestElement('year'));
- break;
- } // END - switch
-
- // Shall I display the refid or shall I make it editable?
- if (isDisplayRefidEnabled()) {
- // Load "hide" form template
- $content['refid_content'] = loadTemplate('guest_register_refid_hide', TRUE);
- } else {
- // Load template to enter it
- $content['refid_content'] = loadTemplate('guest_register_refid', TRUE);
- }
+ $content['birthday_selection'] = generateDayMonthYearSelectionBox(postRequestElement('day'),postRequestElement('month'),postRequestElement('year'));
// ZIP codes are numerical values
$content['zip'] = '';
// Is the array filled?
if ((count($return['mapped_data']) > 0) && (empty($return['message']))) {
+ // Set must-fillout fields
+ $return['mapped_data'] = runFilterChain('register_must_fillout', $return['mapped_data']);
+
+ // Add missing elements
+ $return['mapped_data']['gender'] = NULL;
+ $return['mapped_data']['birthday_selection'] = generateDayMonthYearSelectionBox($return['mapped_data']['birth_day'], $return['mapped_data']['birth_month'], $return['mapped_data']['birth_year']);
+
// Display form
loadTemplate('guest_wernis_registration_form', FALSE, $return['mapped_data']);
+
+ // All fine
return TRUE;
} else {
- // Something bad happened
+ // Something unexpected happened (e.g. no API requests left)
displayMessage($return['message']);
return FALSE;
}
} // END - if
// Now call "get.php"
- $response = executeWernisApiGet($rows[0], 'data', 'anrede|vorname|name|strasse|plz|ort|birth_day|birth_month|birth_year|email|werber');
+ $response = executeWernisApiGet($rows[0], 'data', 'vorname|name|strasse|plz|ort|birth_day|birth_month|birth_year|email|werber');
// Was the status okay?
if (isHttpResponseStatusOkay($response)) {
/*
* Do some checks on the decoded string, it should be a
- * serialized array with 11 entries (see above
+ * serialized array with 10 entries (see above
* executeWernisApiGet() call).
*/
- assert(substr($decodedData, 0, 6) == 'a:11:{');
+ assert(substr($decodedData, 0, 6) == 'a:10:{');
assert(substr($decodedData, -1, 1) == '}');
// The array seems to be fine, unserialize it
// All mappings WDS66->mailer
$mappings = array(
- 'anrede' => 'gender',
'vorname' => 'surname',
'name' => 'family',
'strasse' => 'street_nr',
return $out;
}
+// Helper function to display referral id or hide it depending on settings
+function doTemplateDisplayReferralIdContent ($template, $clear = FALSE) {
+ // Ddisplay the refid or make it editable?
+ if (isDisplayRefidEnabled()) {
+ // Load "hide" form template
+ $out = loadTemplate('guest_register_refid_hide', TRUE);
+ } else {
+ // Load template to enter it
+ $out = loadTemplate('guest_register_refid', TRUE);
+ }
+
+ // Return code
+ return $out;
+}
+
// "Getter" for template base path
function getTemplateBasePath ($part) {
// Is there cache?
return $return;
}
+// Generates a selection box suitable for e.g. birthdays: day, month and year
+function generateDayMonthYearSelectionBox ($day, $month, $year) {
+ // This depends on selected language
+ switch (getLanguage()) {
+ case 'de': // German date format
+ $content = addSelectionBox('da', $day) . addSelectionBox('mo', $month) . addSelectionBox('ye', $year);
+ break;
+
+ default: // Default is the US date format... :)
+ $content = addSelectionBox('mo', $month) . addSelectionBox('da', $day) . addSelectionBox('ye', $year);
+ break;
+ } // END - switch
+
+ // Return content
+ return $content;
+}
+
// [EOF]
?>
<table border="0" cellspacing="0" cellpadding="0" width="640" class="table dashed">
<tr>
<td colspan="2" class="table_header bottom">
- {%template,LoadTemplate=register_header%}
+ {--GUEST_REGISTER_GENERIC_TITLE--}
</td>
</tr>
</td>
</tr>
- $content[refid_content]
+ {%template,DisplayReferralIdContent%}
<tr>
<td colspan="2" class="table_header bottom top">
</table>
</td>
</tr>
+
<tr>
<td colspan="2" class="table_footer">
<input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
--- /dev/null
+<div align="center">
+{%form,formMethodPost,formNameRegister=modules.php?module=index&what=register%}
+<input type="hidden" name="registration_provider" value="register" />
+<table border="0" cellspacing="0" cellpadding="0" width="640" class="table dashed">
+ <tr>
+ <td colspan="2" class="table_header bottom">
+ {--GUEST_REGISTER_WERNIS_PROVIDER_TITLE--}
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="table_header bottom">
+ {--REGISTER_PERSONAL_DATA--}:
+ </td>
+ </tr>
+
+ <tr>
+ <td class="bottom" colspan="2" align="center">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td class="register_left" align="right">
+ {--GENDER--}$content[must_fillout_gender]:
+ </td>
+ <td class="register_right">
+ {%pipe,generateGenderSelectionBox=$content[gender]%}
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--SURNAME--}$content[must_fillout_surname],
+ {--FAMILY--}$content[must_fillout_family]:
+ </td>
+ <td class="register_right">
+ <input type="text" class="form_field" name="surname" size="15" maxlength="255" value="$content[surname]" />
+ <input type="text" class="form_field" name="family" size="15" maxlength="255" value="$content[family]" />
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--STREET_NR--}$content[must_fillout_street_nr]:
+ </td>
+ <td class="register_right">
+ <input type="text" class="form_field" name="street_nr" size="25" maxlength="255" value="$content[street_nr]" />
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--COUNTRY--}$content[must_fillout_cntry], {--ZIP--}$content[must_fillout_zip],
+ {--CITY--}$content[must_fillout_city]:
+ </td>
+ <td class="register_right">
+ {%pipe,postRequestElement,addCountryCodeSelectionBox=country_code%}
+ <input type="text" class="form_field" name="zip" size="5" maxlength="10" value="$content[zip]" />
+ <input type="text" class="form_field" name="city" size="20" maxlength="255" value="$content[city]" />
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--EMAIL--}$content[must_fillout_email]:
+ </td>
+ <td class="register_right">
+ <input type="text" class="form_field" name="email" size="30" maxlength="255" value="$content[email]" />
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--BIRTHDAY--}$content[must_fillout_birthday]:
+ </td>
+ <td class="register_right">
+ $content[birthday_selection]
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <div class="notice">
+ $content[must_fillout_marker]:{--GUEST_REGISTER_MUST_SET_NOTICE--}
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="table_header bottom">
+ {--REGISTER_CATEGORIES--}:
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="table_header">
+ {--GUEST_SELECT_LEAST_CATEGORIES--}
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="bottom">
+ {%pipe,registerGenerateCategoryTable=guest%}
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="table_header bottom">
+ {--REGISTER_MISC--}:
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <div class="notice tiny">{--GUEST_EMPTY_PASSWORD_HINT--}</div>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="register_left" align="right">
+ {--GUEST_ENTER_PASSWORDS--}
+ </td>
+ <td class="register_right">
+ <input type="password" class="form_field" name="password1" size="10" maxlength="100" />
+ <input type="password" class="form_field" name="password2" size="10" maxlength="100" />
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ {%pipe,addMaxReceiveList=guest%}
+ </td>
+ </tr>
+
+ {%template,DisplayReferralIdContent%}
+
+ <tr>
+ <td colspan="2" class="table_header bottom top">
+ {--TERMS_OF_USAGE--}:
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="bottom">
+ <table border="0" cellspacing="0" cellpadding="0" width="640" class="table">
+ <tr>
+ <td width="50%" align="right">
+ {--AGREE_TO_THIS--}
+ </td>
+ <td width="50%">
+ <input type="radio" class="form_field" name="agree" value="Y" /> {--YES--}<br />
+ <input type="radio" class="form_field" name="agree" value="N" checked="checked" /> {--NO--}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="table_footer">
+ <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" class="form_submit" name="ok" value="{--SUBMIT_REGISTER--}" />
+ </td>
+ </tr>
+</table>
+{%form_close%}
+</div>
-Anmeldeformular zum {?mt_word?} <strong>{?MAIN_TITLE?}</strong>:
+<!-- @DEPRECATED //-->